ABX
How ABX works

Code projects

Programs, seeds, token data, rendering, and traits.

A code project stores or points to a program. Its output follows a simple contract:

content + parameters + environment -> output

Code custody

ABX supports two forms:

ModeCode locationEntry point
DirectoryIPFS, Arweave, or a URLindex.html
TemplateOnchain script chunks and dependenciesAssembled by AbxGenerator

A directory project stores a locator in its code collection field. A template project stores script chunks through the code extensions. Dependency index 0 is the runtime by convention.

Token data

The program receives one object called tokenData:

{
  "chainId": 84532,
  "contractAddress": "0x1a2b...",
  "tokenId": "42",
  "seed": "0x9f31...",
  "palette": "Ochre",
  "density": "0.85"
}

Contract parameters provide defaults. Token parameters override them. An augment hook may add or replace values at read time.

The reserved keys are chainId, contractAddress, tokenId, and seed. Keys are sorted and serialized as compact UTF-8 JSON. This canonical form is used when effect inputs are hashed.

The program can receive token data through an injected window.abxTokenData, an abx URL parameter, or an RPC read. The small abx.js helper resolves those paths and exposes:

abx.traits({Palette: 'Ochre'});
abx.done();

Preview the same document shape before deployment:

abx preview --script ./index.html

Seeds

The token asks its seed-source contract for a seed at mint and stores the result. The shared AbxSeedSource uses the project address, token ID, and current block values.

This source is pseudorandom, not secret or lottery-grade randomness. Contract callers and block builders can inspect or influence transaction execution. Use a commitment scheme or VRF-backed source when one outcome has material prize value.

On OP Stack networks such as Base, block.prevrandao comes from the L1 origin and may remain the same across several L2 blocks. Do not treat it as fresh entropy for each L2 block.

On an ERC-721 Series, minting is sequential. The buyer accepts or rejects the next outcome. On an edition, the buyer names the ID. A code edition assigns its seed on that ID's first mint, so an unminted ID is a selection input.

A custom IAbxSeedSource can use different rules:

abx set-seed-source 0xYourContract 0xYourSeedSource

This affects future mints only.

A seed is settled after assignment unless the project declared a seed parameter schema before minting began. That schema lets an authorized party choose a value. It is not a new random draw.

Rendering

AbxGenerator produces the program document.

For a template, it combines token data, abx.js, dependencies, and script chunks. For a directory, it returns the code locator with token data attached.

onChainStatus(token) reports the chosen path, whether all bytes are reachable from chain, and any unresolved dependencies.

A large generated document may exceed an RPC provider's eth_call limit. Clients can read it in parts:

ReadResult
tokenDataJsonCanonical token data
dependencyTagOne dependency tag
registryScriptChunkOne registry chunk
abxJs / gunzipScriptShared runtime bytes

A chain-complete project can still change if it uses a mutable dependency registry. An OnChain dependency points to fixed SSTORE2 bytes.

Images and traits

A program produces the live animation_url. A still image normally comes from the render.image effect. Until that effect lands, the resolver returns a deterministic placeholder.

Before using a managed renderer, run abx remote <name|url> and check its advertised constraints. The managed ABX renderer is CPU/headless and has no GPU/WebGL hardware acceleration. A project that requires hardware acceleration needs a GPU-capable effects worker; the default self-hosted Playwright/Fly scaffold does not itself guarantee GPU access. For slow software-compatible projects, signal readiness with abx.done() and use a supported render.captureDelay when necessary.

Set the collection parameters render.imageWidth and render.aspectRatio (width divided by height) to frame hosted and self-hosted captures consistently. They are part of token data, so a change creates a new render input rather than mutating an existing output.

A script reports traits with abx.traits(). A project may also compute attributes with a Solidity field renderer. When both exist, onchain traits win when the same trait name appears twice.

Parameters do not become marketplace traits automatically. Report the values that belong in the public trait list.

On this page