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

HasLacks
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

ModelPurposeKey fields
MirrorContractOne row per companion contract (Path A)collectionId, chainId, address, implementation, deployedAtBlock, official, coSigner, treasury, claimedAt, feeConfig
EmbodimentOne per embodied NFTnftId, mirrorId?, companionTokenId?, agentId, agentAccount, txHash, blockNumber, referrerTokenRef?, attestationHash, attestationSignature, official
EmbodimentQuoteSigned quote before the transactionnftId, cost, currency (MOCA_BURN | ETH_ENDOW), referrer, nonce, expiresAt, typedDataHash, signature, consumedAt?
AllowanceNew. Per-token $MOCA allowance ledgernftId, granted, spent, spentTxHash?
EndowmentShareNew. Vault shares per agentembodimentId, shares, lifetimeFeesWei, lastClaimBlock
ReferralLink, ReferralEventAttribution and credited streamsownerTokenRef, code · embodimentId, referrerTokenRef, sharesGranted, txHash
BudgetRun, PurchaseNew. Budget engine executionsembodimentId, epochId, capWei, spentWei · venue, contract, tokenId, priceWei, txHash, reason (Codex fields matched)
AgentRecordEntryThe off-chain recordembodimentId, key, value, source (holder | harness | engine | moot | system), signature?, createdAt
InboxMessageStore-and-forwardembodimentId, fromRef, body, createdAt, deliveredAt?, expiresAt
Playbook, PlaybookVersion, AgentPlaybookCatalogue and equipmentmanifest, archetype, authorRef, canonical, licenseTerms
Epoch, PayoutDistribution and healthnumber, startsAt, endsAt, feesDistributedWei, burnedMoca, lockedMoca, healthDays · epochId, tokenRef, amount, reason, claimedAt?
AccessionClaimConsole statecollectionId, claimantAddress, method (owner | attested), attestationSignature?, txHash?, closedByTokenRef?

Routes under /api/v1 recut

MethodPathPurpose
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|piThe 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}/inboxStore-and-forward; pre-embodiment posts authorised by SIWE or delegation, not by 8004 identity
POST/embody/quoteCost in $MOCA from the curve, allowance check, referrer validation, EIP-712 attestation, nonce and expiry
POST/awaken/quoteNew. ETH amount, match ratio, expected shares, IL disclosure text
GET/agents/{ref}/budget · /agents/{ref}/purchasesNew. 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.

ParameterPlaceholderWhere it livesWho can change it
DeCC0 allowance100 $MOCA per tokenAllowanceLedgerImmutable once granted
Burn curve100 → 200 → 400 → 800 by quarterAllowanceLedgerImmutable schedule
Burn versus range split70 / 30AllowanceLedger, RangeVaultSafe, before launch
Awakening minimum0.02 ETHEndowmentVaultSafe, within bounds
Match ratio2:1 → 1:1 → 0.5:1EndowmentVaultSafe, by schedule
Endowment fee split70 agent / 20 referrer / 10 operationsEndowmentVaultSafe, within bounds
Referral stream durationperpetual or 5 yearsEndowmentVaultCounsel decides
Creator to collecting pool30%Off-chain then on-chainDefault, holder may change
Epoch4 weeksEpoch worker and contractsImmutable per season
Policy defaultsvenues only · ask above threshold · move NFTs off, 24h delay · sessions 30 daysAgentPolicyHolder, per agent
Follower ETH fee split 50/20/20/10flat ETH feeReplaced by endowments
$MOCA fee discount 20% with burnReplaced 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.

WeekGovernance and legalContractssoulweaverNarrative and partners
1 · Sept 7 to 11Decision meeting; counsel engaged; audit bookedSepolia visibility test with a derived imageCodex import; skill-builder scaffold; MCP skeleton; holder count checkedVocabulary lock; Prem Makeig outreach; OpenSea contact
2 · Sept 14 to 18Key hygiene reviewTest verdict; mirror or proxy skeletonMCP with inbox, record, status, Cortex; load for Claude Code, pi, OpenCode; inbox and record on stagingAttach matrix; Hermes verified or cut. Beat: the season opens
3 · Sept 21 to 25Key posture and treasury Safe publishedAllowance ledger and curveAgent pages for all 10,000; pi package; load for Codex, OpenClaw, Hermes; Collector playbook v1 and the taste shortlist mappingBeat: the Codex signed
4 · Sept 28 to Oct 2Legal interim readBatch embody; Sepolia flow with attestationSepolia embody flow; fleet view; referral links; quick identityFollower criteria; onboarding videos. Beat: six harnesses
5 · Oct 5 to 9Invariant testsHolder beta with about twenty holders; fixes; docsBeta week
6 · Oct 12 to 16Signer key policy finalFreeze preparationLoad your DeCC0 goes liveBeat: the release; office hours begin
7 · Oct 19 to 23Legal memo v1Code freeze; audit beginsIndexer; budget engine alpha behind a flag; admin viewsCorrespondence #1 curated
8 to 11 · Oct 26 to Nov 20Curve and allowance set from the memoAuditRange vault; endowment vault design; season featuresBeats: Correspondence, Collector, Critic, Papers
12 to 13 · Nov 23 to Dec 4Gate review Dec 4Audit fixes; mainnet deployMainnet embodiment behind the flag; budget engine on allowlisted venuesBeats: the allowance, Chronicle #0, twelve voices, the gate
14 · Dec 7 to 11Final checksFlag flipped at 12:12 on Dec 12MOCA LIVE from the opening
15 to 16 · Dec 14 to 31MonitoringStabilise; fleet polishOpening 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.