Apostolos is a fully on-chain cultural data protocol for encoding, preserving, and exchanging digital artifacts as cryptographic objects. This documentation covers the protocol architecture, SDK, and integration guides.
Never commit your private key to version control. Use .env.local or a secrets manager.
On-Chain Encoding
Apostolos encodes artifact data directly into immutable blockchain state. Unlike NFTs that store a URL pointing to off-chain data, Apostolos artifacts are the data no external dependencies, no fragile pointers.
How it works
When you call encode(), the protocol:
Chunks the artifact data into protocol-defined segments
Embeds each segment into transaction calldata or inscription slots
Assembles an on-chain index pointing to each segment
Issues a cryptographic artifact ID tied to the complete data hash
Artifact size limits depend on the underlying chain. On supported L2s, artifacts up to 10MB are supported in a single inscription.
ZK Ownership
Zero-knowledge proofs allow collectors to own, transfer, and prove provenance of artifacts without revealing their identity on-chain.
Ownership model
Every artifact has an associated ownership commitment a cryptographic hash of owner_address + artifact_id + salt. The commitment is stored on-chain; the preimage remains private.
Shielded transfer
javascript
const proof = await client.transfer({
artifactId: "art_abc123",
recipient: "0xRecipientAddress",
zkMode: true, // generates ZK proof of ownership
});
// proof.receipt on-chain transfer receipt
// proof.zkProof verifiable ZK proof for recipient
x402 is an HTTP-native micropayment standard built into the Apostolos protocol. It enables pay-per-access, licensing, and artifact exchange with sub-second settlement no external payment infrastructure needed.
Payment flow
Client requests access to a gated artifact
Server responds with 402 Payment Required + payment details
Client signs and submits micropayment on-chain
Server verifies payment and grants access
javascript
// Gating an artifact with x402
const gate = await client.pay.createGate({
artifactId: "art_abc123",
price: "0.001", // in protocol token
currency: "USDC",
access: "single-view", // or "permanent"
});
// Accessing a gated artifact
const access = await client.pay.unlock({
gateId: gate.id,
payer: "0xYourAddress",
});
console.log(access.contentUrl);
✦
x402 payments settle on-chain within ~1 second on supported L2 networks.
Provenance
Every Apostolos artifact carries an immutable chain of custody from the original inscription through every transfer. Provenance is cryptographically verifiable and cannot be forged or altered.
Apostolos is a three-layer protocol stack. Each layer is independently composable and can be used without the others.
Layer 1
On-Chain Encoding
Artifact data is chunked and inscribed directly into blockchain state. The encoding layer handles chunking, indexing, and integrity verification.
Layer 2
ZK Ownership & Transfer
A zero-knowledge ownership model sits on top of encoded artifacts, enabling private ownership, private transfer, and selective disclosure of provenance.
Layer 3
x402 Commerce
Protocol-native micropayment rails built on the x402 standard. Enables pay-per-access, licensing, and artifact exchange with on-chain settlement.
Data Model
An Apostolos artifact is composed of four components stored on-chain.
typescript
type Artifact = {
id: string; // unique on-chain artifact ID
dataHash: string; // keccak256 of raw artifact bytes
segments: Segment[]; // on-chain encoded data segments
metadata: ArtifactMetadata; // title, creator, mimeType, tags
ownershipCommitment: string; // ZK ownership commitment hash
provenanceRoot: string; // merkle root of transfer history
createdAt: number; // block timestamp of inscription
};
type ArtifactMetadata = {
title: string;
creator: string; // wallet address
mimeType: string;
tags?: string[];
};
Security Model
Apostolos inherits the security guarantees of the underlying blockchain and augments them with zero-knowledge proofs for ownership privacy.
Threat model
✓ Data integrity
Artifact data is hash-committed on inscription. Any mutation is detectable on-chain data is immutable by protocol.
✓ Ownership privacy
ZK proofs reveal nothing about the owner's identity beyond the validity of the commitment. The proof system is based on Groth16.
✓ Provenance forgery
Transfer events are chained via a Merkle root. Inserting or removing events from history is computationally infeasible.
✓ Payment safety
x402 payments are atomic funds and access grants settle in the same transaction. No partial states.
⚠
The ZK proof system is currently in audited beta. See the audit report on GitHub before using in production with high-value artifacts.