Encoding and delivery
Store once. Prepare once. Copy at read time.
Native bytes, compression, URI81, shell boot fragments, exact reuse, escaping, and complete-return accounting.
Fresh dense COPY
For nested URI/JSON delivery, select URI81 bulk transport explicitly when preparing compressed binary COPY work. The shell decodes the payload in the browser; carriage defaults depend on the installed SDK revision.
Build-time preparation
Compress the source first, prepare URI81-block-v1 text, and store that prepared representation once. buildKeelPreparedDenseCopyShell is exported by @keel/sdk. Only compressed shell boot fragments use Base64 literals; do not wrap the complete HTML, metadata, or bulk payload in another Base64 layer.
import { buildKeelPreparedDenseCopyShell } from '@keel/sdk';
// Supply the verified graph, resources, and selected-chain binding.
const shell = await buildKeelPreparedDenseCopyShell({
...verifiedShellOptions,
embeddedContainerDelivery: { chainId, store },
binaryPayloadCarriage: 'uri81',
shellBootCompression: 'gzip',
});Contract COPY and browser decoding
The compatible registered contract copies committed prefix, payload, descriptor, and suffix fragments. It does not encode or decompress the bulk resources during tokenURI. The browser checks stored, decoded, and member commitments before mounting the chosen shell.
Strict URI and JSON boundaries
URI81's alphabet is literal-safe for the nested URI/JSON payload. Surrounding metadata and HTML still need correct escaping. Use the SDK serializers; Base90/Base91 do not waive URI escaping. Quotes, script terminators, percent signs, and unsafe URI characters each belong to their actual serialization boundary.
Existing objects and native binary
Keep compatible immutable resources intact. A new wrapper is not a reason to pay for another encoded copy.
Assembly-only reuse
Call keel-inline-reuse-plan before preparation or upload. Preserve exact ordered IDs, media types, chain, store, and bytes. Existing prepared Base64 or percent fragments use their matching builder without transcoding. Assembly-only reuse has zero new source bytes and no object-write plan.
An incompatible binary pack is different
Padding arbitrary native binary cannot make it a valid Base64 slice or prepared dense fragment. Use its registered native reader/composer when available. A creator-authorized migration to COPY needs new prepared fragments and an honest new-storage quote.
Measure the actual return
Use separate measurements for storage economics, public reads, and browser execution.
Required measurements
The collector receives the complete tokenURI, including both URI layers, image, shell, decoder, payloads, descriptors, and delimiters. A 900 KB compressed pack does not promise a 900 KB tokenURI. Upload gas is independent of read gas.
- Source
- Original bytes and their digest
- Storage
- New versus reused carrier bytes
- Return
- Exact complete collection response
- Read
- Actual call gas within the public RPC limit
- Runtime
- Decoded bytes, browser memory, and execution
Publication gate
Run keel-inline-token-audit and keel-inline-publication-check against the exact expected and actual collection return. Local byte equality remains distinct from selected-chain receipts and offline browser proof. Reject altered transport, missing resources, and digest mismatches.

