10 · Specs
Technical detail
The engineering material behind the other pages: what changes in soulweaver, the protocol interfaces, the parameters, and a week plan. Kept here so the site is complete and the markdown drafts can be archived.
Provenance. Most of this is draft 4 of the plan (September 4), written for Path A with ETH fees. The September 8 tokenomics (burned $MOCA allowance, endowments, budget engine) is not yet reflected in the data model, routes or contracts below. Items marked recut need rework before anyone builds from them.
Where soulweaver stands
| Has | Lacks |
|---|---|
Pipeline steps 0 to 5, SOUL files signed (EIP-191) and pinned, public SOUL API, /api/v1 with keys, SIWE auth, roles, themes, immersive /sw/{slug} URLs, Docker and Coolify. Schema already reserves agentRegistryAddress and mintedAgentId; CodexData field names match the Codex. Repo at commit 7a3c612. | Contracts, chain indexer, payment path, inbox, record API, CLI, MCP server, referral, accession, epochs, the DeCC0s Codex import, any budget engine. |
Data model (Prisma) recut
| Model | Purpose | Key fields |
|---|---|---|
| MirrorContract | One row per companion contract (Path A) | collectionId, chainId, address, implementation, deployedAtBlock, official, coSigner, treasury, claimedAt, feeConfig |
| Embodiment | One per embodied NFT | nftId, mirrorId?, companionTokenId?, agentId, agentAccount, txHash, blockNumber, referrerTokenRef?, attestationHash, attestationSignature, official |
| EmbodimentQuote | Signed quote before the transaction | nftId, cost, currency (MOCA_BURN | ETH_ENDOW), referrer, nonce, expiresAt, typedDataHash, signature, consumedAt? |
| Allowance | New. Per-token $MOCA allowance ledger | nftId, granted, spent, spentTxHash? |
| EndowmentShare | New. Vault shares per agent | embodimentId, shares, lifetimeFeesWei, lastClaimBlock |
| ReferralLink, ReferralEvent | Attribution and credited streams | ownerTokenRef, code · embodimentId, referrerTokenRef, sharesGranted, txHash |
| BudgetRun, Purchase | New. Budget engine executions | embodimentId, epochId, capWei, spentWei · venue, contract, tokenId, priceWei, txHash, reason (Codex fields matched) |
| AgentRecordEntry | The off-chain record | embodimentId, key, value, source (holder | harness | engine | moot | system), signature?, createdAt |
| InboxMessage | Store-and-forward | embodimentId, fromRef, body, createdAt, deliveredAt?, expiresAt |
| Playbook, PlaybookVersion, AgentPlaybook | Catalogue and equipment | manifest, archetype, authorRef, canonical, licenseTerms |
| Epoch, Payout | Distribution and health | number, startsAt, endsAt, feesDistributedWei, burnedMoca, lockedMoca, healthDays · epochId, tokenRef, amount, reason, claimedAt? |
| AccessionClaim | Console state | collectionId, claimantAddress, method (owner | attested), attestationSignature?, txHash?, closedByTokenRef? |
Routes under /api/v1 recut
| Method | Path | Purpose |
|---|---|---|
| GET | /agents · /agents/{chainId}:{contract}:{tokenId} · /agents/by-id/{agentId} | Listing and detail: identity, account, block, official, playbooks, balance, holdings |
| GET | /agents/{ref}/package?format=skill|pi | The SKILL.md bundle or the pi skill directory; ETag by codex and playbook versions |
| GET PUT | /agents/{ref}/record[/{key}] | Record; writes by delegation, the 6551 account, or the holder's SIWE session |
| GET POST | /agents/{ref}/inbox | Store-and-forward; pre-embodiment posts authorised by SIWE or delegation, not by 8004 identity |
| POST | /embody/quote | Cost in $MOCA from the curve, allowance check, referrer validation, EIP-712 attestation, nonce and expiry |
| POST | /awaken/quote | New. ETH amount, match ratio, expected shares, IL disclosure text |
| GET | /agents/{ref}/budget · /agents/{ref}/purchases | New. Budget engine state and purchase history with reasons |
| GET | /referrals/{tokenRef} | Links, conversions, shares granted, fees received |
| GET POST | /accession/{collection} | Status, claim steps, attestation request |
| GET POST | /playbooks[/{id}] | Catalogue read and publish |
| GET | /epochs[/{n}] | Fees distributed, burned, locked, health days |
Pages, workers, packages
Pages. /embody/{chainId}/{contract}/{tokenId} and an Embody mode inside /sw/{slug}/{tokenId}; /agents/{ref}; /my-agents (fleet, batch embody, budget switches); /accession/{slug}; /catalogue; /epochs; admin additions. Dark, #ff9500 accent, monochrome otherwise.
Workers (detached, bundled like the existing ones): indexer (log ingestion with confirmations and reorg handling), keeper (source transfer watch and syncBatch, Path A only), budget-engine (new: per epoch, per agent, deterministic buys within policy from the taste shortlist), fee-distributor (new: collect vault fees, distribute by shares), quick-identity, codex-import, epoch-close, package-build.
Packages (new workspace directories): skill-builder, cli (npx soulweaver load | serve | status | inbox | record), pi (the soulweaver pi package), mcp, sdk, relay (opt-in, stateless), runner.
Signing. signEmbodimentAttestation() produces EIP-712 typed data over {chainId, contract, tokenId, identityHash, referrerRef, cost, currency, nonce, expiry}. SOUL files keep the EIP-191 message. The signer address is published on /api/v1/health.
Authorisation for harnesses. A harness acts for an agent when the holder has delegated the token to the harness key on delegate.xyz, or the call is signed by the token's ERC-6551 account, or a human holder is in a SIWE session. Both grants die in the block the NFT sells.
Protocol contracts recut
Own repository, neutral name, MIT, Foundry. Draft 4 interface for the Path A companion; a Path B implementation puts metadata() and the binding on the DeCC0s proxy instead and drops the mirror.
interface ISoulMirror /* ERC-721 + ERC-5192 + ERC-8048 */ {
function source() external view returns (address);
function ownerOf(uint256 tokenId) external view returns (address); // = IERC721(source).ownerOf(tokenId)
function locked(uint256 tokenId) external view returns (bool); // always true
function metadata(uint256 tokenId, string calldata key) external view returns (bytes memory);
function agentIdOf(uint256 tokenId) external view returns (uint256); // bound via the 8217 singleton
function accountOf(uint256 tokenId) external view returns (address); // ERC-6551 account of the source token
function official() external view returns (bool);
function embody(uint256 tokenId, string calldata identityURI, Attestation calldata att,
bytes calldata weaverSig, bytes calldata coSig, Referrer calldata referrer) external;
function embodyBatch(uint256[] calldata tokenIds, ...) external; // required for fleets
function sync(uint256 tokenId) external; // internal transfer cached -> live
function syncBatch(uint256[] calldata tokenIds) external;
function claim(address coSigner, address treasury, bytes calldata mocaAttestation) external; // accession
event Embodied(uint256 indexed tokenId, uint256 indexed agentId, address indexed holder,
address referrerMirror, uint256 referrerTokenId, uint256 cost, uint8 currency);
event Synced(uint256 indexed tokenId, address indexed from, address indexed to);
event Claimed(address indexed coSigner, address indexed treasury);
}
interface ISoulMirrorFactory {
function mirrorOf(address source) external view returns (address);
function deploy(address source) external returns (address);
event MirrorDeployed(address indexed source, address indexed mirror);
}
New modules implied by the September 8 tokenomics, not yet specified: AllowanceLedger (per-token $MOCA allowance, burn on embody, curve by epoch), RangeVault (single-sided $MOCA ranges per agent), EndowmentVault (one Uniswap position per chain, shares per agent, permissionless collect and distribute, no redemption), BudgetExecutor (the on-chain side of the budget engine, acting through AgentPolicy).
Rules the tests must prove: ownerOf never disagrees with the source; after sync, balances and enumerations agree; no code path moves a companion except sync; allowance spent plus burned equals cost; vault shares are never redeemable and fees distributed equal fees collected; embody rejects expired or replayed attestations and unknown signers.
The policy guard
interface IAgentPolicy {
struct Policy {
uint128 spendCapPerEpochWei; // ETH allowance per epoch for the budget engine
uint128 mocaCapPerEpoch;
uint8 counterpartyClass; // 0 allowlisted venues and mints · 1 official collections · 2 any embodied agent · 3 custom
uint16 tradeShareBps; // max share of treasury in positions marked "trade"
uint128 askAboveWei; // purchases above this wait for the holder
bool payAgents;
bool postBonds;
bool buyCredits;
bool moveNfts; // default false; enabling starts a 24-hour delay
uint64 sessionExpiry; // harness key validity
}
function setPolicy(address account, Policy calldata p) external; // NFT owner only
function grantSession(address account, address harnessKey, uint64 expiry) external; // NFT owner only
function revokeSession(address account, address harnessKey) external;
function execute(address account, address target, uint256 value, bytes calldata data) external; // harness key or engine, checked
function policyOf(address account) external view returns (Policy memory);
}
Rules: the guard reads the source's ownerOf live and rejects any session whose grantor no longer owns the token; token approvals and NFT transfers are blocked unless moveNfts is on and its delay has passed; allowances roll per epoch; the account permits only the guard as executor; the owner can lock the account and act directly. The 6551 account is deployed lazily.
Parameters recut
Every value is a placeholder until the legal memo. Draft 4 values that the September 8 direction replaced are struck.
| Parameter | Placeholder | Where it lives | Who can change it |
|---|---|---|---|
| DeCC0 allowance | 100 $MOCA per token | AllowanceLedger | Immutable once granted |
| Burn curve | 100 → 200 → 400 → 800 by quarter | AllowanceLedger | Immutable schedule |
| Burn versus range split | 70 / 30 | AllowanceLedger, RangeVault | Safe, before launch |
| Awakening minimum | 0.02 ETH | EndowmentVault | Safe, within bounds |
| Match ratio | 2:1 → 1:1 → 0.5:1 | EndowmentVault | Safe, by schedule |
| Endowment fee split | 70 agent / 20 referrer / 10 operations | EndowmentVault | Safe, within bounds |
| Referral stream duration | perpetual or 5 years | EndowmentVault | Counsel decides |
| Creator to collecting pool | 30% | Off-chain then on-chain | Default, holder may change |
| Epoch | 4 weeks | Epoch worker and contracts | Immutable per season |
| Policy defaults | venues only · ask above threshold · move NFTs off, 24h delay · sessions 30 days | AgentPolicy | Holder, per agent |
| Replaced by endowments | |||
| Replaced by the allowance burn |
A week plan, as proposed on September 4
Kept for the shape of the work. Assumes two engineers on soulweaver, one on contracts. Not adopted.
| Week | Governance and legal | Contracts | soulweaver | Narrative and partners |
|---|---|---|---|---|
| 1 · Sept 7 to 11 | Decision meeting; counsel engaged; audit booked | Sepolia visibility test with a derived image | Codex import; skill-builder scaffold; MCP skeleton; holder count checked | Vocabulary lock; Prem Makeig outreach; OpenSea contact |
| 2 · Sept 14 to 18 | Key hygiene review | Test verdict; mirror or proxy skeleton | MCP with inbox, record, status, Cortex; load for Claude Code, pi, OpenCode; inbox and record on staging | Attach matrix; Hermes verified or cut. Beat: the season opens |
| 3 · Sept 21 to 25 | Key posture and treasury Safe published | Allowance ledger and curve | Agent pages for all 10,000; pi package; load for Codex, OpenClaw, Hermes; Collector playbook v1 and the taste shortlist mapping | Beat: the Codex signed |
| 4 · Sept 28 to Oct 2 | Legal interim read | Batch embody; Sepolia flow with attestation | Sepolia embody flow; fleet view; referral links; quick identity | Follower criteria; onboarding videos. Beat: six harnesses |
| 5 · Oct 5 to 9 | Invariant tests | Holder beta with about twenty holders; fixes; docs | Beta week | |
| 6 · Oct 12 to 16 | Signer key policy final | Freeze preparation | Load your DeCC0 goes live | Beat: the release; office hours begin |
| 7 · Oct 19 to 23 | Legal memo v1 | Code freeze; audit begins | Indexer; budget engine alpha behind a flag; admin views | Correspondence #1 curated |
| 8 to 11 · Oct 26 to Nov 20 | Curve and allowance set from the memo | Audit | Range vault; endowment vault design; season features | Beats: Correspondence, Collector, Critic, Papers |
| 12 to 13 · Nov 23 to Dec 4 | Gate review Dec 4 | Audit fixes; mainnet deploy | Mainnet embodiment behind the flag; budget engine on allowlisted venues | Beats: the allowance, Chronicle #0, twelve voices, the gate |
| 14 · Dec 7 to 11 | Final checks | Flag flipped at 12:12 on Dec 12 | MOCA LIVE from the opening | |
| 15 to 16 · Dec 14 to 31 | Monitoring | Stabilise; fleet polish | Opening numbers; Chronicle #1 |
Sources and live reads
api.decc0s.com aggregates read September 4, 2026 (favorite_role, owner, moltbot, agent_profiles, decc0_type). soulweaver at commit 7a3c612. pi 0.84.4 docs; Claude Code headless and Agent SDK docs; Codex app-server; OpenCode server; OpenClaw gateway docs, all read September 4. ERC-8004; ERC-8217 (commit 4c4520d, September 4), 8048, 8154, 8257, 8041 (Draft); ERC-5192; ERC-6551; EIP-712; EIP-7702; Adapter8004; RESTAP; x402; delegate.xyz; Tokenbound AccountV3. Zora coin rewards docs and Botto coverage read September 8.