Skip to content
· 9 min LIVE

400 Kilograms, Two Children, Four Anchors: Asset Lineage You Can Recompute

EPIC-239 asset lineage, live in production: a universal asset registry gives physical objects a provable family tree - every split an append-only provenance edge with exact decimal mass conservation enforced inside the write transaction (250 + 150 = 400, or nothing is written). The adversarial pre-audit found a real counterfeiting bug: split the same parent twice and mint 17 kg of children out of 10 kg of parent - now structurally impossible, proven by parity tests on two database backends. Live proof: one 400 kg batch split into 250 + 150 in the production database, custody transitions sealed with EIP-712, four Arc testnet anchors - and an independent cloud verifier with no database access recomputed every hash to MATCH. The lineage tree is publicly readable right now, no account needed.

AB
AgentBadge Team
Agency for the Agentic Web
400 Kilograms, Two Children, Four Anchors: Asset Lineage You Can Recompute
🤖 For AI agents: Machine-readable: JSON Markdown llms.txt Agent Guide

Our ledger already knew how to say what happened - offer, handoff, payment, verdict. It could not say what things are - and it definitely could not prove that the 250 kg of salmon in the processing plant and the 150 kg in the restaurant both came out of the same 400 kg parent batch, with nothing printed out of thin air along the way. EPIC-239 adds a universal asset registry underneath the process ledger: every physical batch gets a stable identity, every split becomes an append-only provenance edge, and exact decimal mass conservation is enforced inside the same database transaction that writes the split - 250 + 150 equals 400, or nothing is written at all. The lineage tree is publicly readable, and each child's custody transition is sealed with EIP-712 and anchored to Arc testnet, where a third party - who never touched our database - recomputed the hashes and got four out of four matches. The adversarial pre-audit found a real counterfeiting bug: you could split the same parent twice and mint 17 kg of child assets out of 10 kg of parent. That bug is now structurally impossible, and the regression tests prove it on two database backends.

This is part of the Arc campaign series. Previous published episode: the driver died mid-shipment, twice (EPIC-245). This article is EPIC-239: asset lineage - the layer that gives physical objects a provable family tree, and the first mass-conserving split to carry its proof all the way to a public blockchain.

The problem: events are not objects

I'll be honest about the gap, because it took us embarrassingly long to name it. Our supply-chain ledger records events: this batch was offered, accepted, handed off, paid for, verified. That's a good memory for things that happen once - and I don't say that to diminish it: events are half the story. But physical work doesn't happen once - it happens to stuff, and stuff gets divided. A 400 kg salmon lot arrives at the warehouse. 250 kg go to the processing plant. 150 kg go to a restaurant chain. Both parts move, get paid for, get verified - separately.

Now ask the simple questions a regulator, a customer or an auditor will ask. Are these two parts really from the same parent batch? When the split happened, did the quantities add up - or did someone, somewhere, mint an extra 20 kg of salmon that never existed? If the only record is a pile of event rows, the honest answer is: nobody knows. The events remember what was said. Nothing remembers what the world actually contained.

For a junior: imagine a cash register that records every time someone says they paid, but there is no inventory system at all. The register can tell you a sale was announced. It can't tell you whether the warehouse still has the goods, or whether the same crate was sold three times. Events without objects are exactly that register. Now scale the problem to agents trading autonomously, and "trust me, the fish was real" stops being a joke.

Provenance is a solved problem - everywhere except software

Here's the embarrassing part, which is becoming a series tradition: none of this is new knowledge. Food supply chains have lived with mandatory lot traceability for decades - one step back, one step forward, every batch traceable to its parent lot, because when contamination happens you recall lots, not vibes. The GS1 EPCIS standard exists precisely because "which physical objects were inputs to which physical objects" is a question entire industries must answer in a machine-readable way. Pharma has drug pedigree law. Chemical plants run mass-balance accounting where discrepancies beyond measurement error trigger investigations, not shrugged shoulders.

And the cost of getting it wrong is public record. In 2013, across Europe, frozen beef lasagna turned out to contain horse meat - in some products up to 100 percent of the meat content. The interesting part isn't the fraud itself; it's that the supply chain could not answer basic provenance questions for weeks. Which batches? Which slaughterhouse? Which lots are affected and which are clean? Retailers pulled millions of products not because they were proven contaminated, but because nobody could prove they weren't. When provenance fails, the penalty is not precision - it's total suspicion. Everything becomes guilty.

We didn't want agents trading physical goods on that kind of foundation. If a machine is going to commit to "this child batch descends from that parent, quantities conserved," the claim has to be data - enforceable, verifiable, and checkable by someone who doesn't trust us.

What shipped: identity, edges, and arithmetic that can't lie

EPIC-239 adds a universal asset registry under the process ledger - domain-agnostic, because agents will eventually track far more than fish:

  • Asset identity, separate from quantity - an asset is a stable identity plus public namespaced references. Quantity never lives on the asset itself; it lives only on the relationship edge between parent and child. A child is not a copy of the parent object - it's a separately addressable asset with a provenance edge back to its origin.
  • splitAsset and mergeAssets - server-side operations with exact decimal-string conservation on BigInt arithmetic. No floats, ever: 0.1 + 0.2 style drift is simply not in the vocabulary. If the children don't sum exactly to the parent total in the same unit, the write transaction rejects and nothing is recorded.
  • Consumptive, single-use split - once a parent has been split, it can never be split again. The operation is final by construction (more on why below - it was an audit finding, not a taste preference).
  • Bounded honesty in queries - lineage traversal stops at depth 64 and returns explicit truncated and depthLimitReached markers. A bounded answer never pretends to be the complete graph.
  • A public, leak-checked read surface - GET /api/ledger/shipments/:id returns the lineage tree using only public references: no internal UUIDs, no tenant identifiers, no operation payloads. The write side is internal-only, and production verification confirmed there is no public write endpoint.
The conservation invariant - a database transaction containing one parent block of 400 kg on one side and two child blocks of 250 and 150 kg on the other, locked together; decimal strings locking into place like machined parts

The audit found a counterfeiting machine

Before any of this touched production, two independent adversarial auditors reviewed the module in parallel - clean context, no knowledge of each other. One returned "approve with nits." The other returned BLOCK - and the blocking claim reproduced, which is the only kind of audit disagreement worth having.

Here's the bug, and it's a beauty. Conservation was enforced inside one operation - each split had to sum correctly. But nothing stopped you from splitting the same parent twice. Take a 10 kg parent: split it as 6 + 4 under operation reference R1, then split it again as 7 + 3 under reference R2. Each individual split is perfectly conserved. And you've just minted 17 kg of child assets out of 10 kg of parent. Seven kilograms of salmon - or cocaine precursor, or aircraft-grade titanium - conjured from arithmetic that checked out locally. This is the kind of bug no unit test writes itself into existence to find, because every test case you naturally write is about one operation.

The fix was a design decision, not a patch: v1 splits are consumptive and single-use. The moment any outgoing split edge exists on a parent, a second split rejects with ASSET_PARENT_ALREADY_SPLIT - in the same transaction, on both the in-memory and Postgres backends, with parity tests proving identical behavior on each. The same remediation round closed the convergent findings both auditors independently flagged: mutable operation references that callers could rewrite after the fact, unbounded JSON payloads, negative quantities. 61 out of 61 focused parity tests green on memory and dev PostgreSQL; 29 out of 29 in the database package.

The live proof: one batch, two children, four anchors

Then we ran it for real, in production, against the production database

  • with deliberate small stakes, because the point is the proof, not

the fish. Parent batch devin-test-239-prodseed-1: 400 kg, full custody lifecycle journaled through canonical events - offer, accept, handoff, pay, verify. Then the split:

parent:  devin-test-239-prodseed-1             400 kg
child A: devin-test-239-prodseed-1-split-a     250 kg
child B: devin-test-239-prodseed-1-split-b     150 kg
relationships: 2 x SPLIT_FROM, append-only
250 + 150 = 400 - exact decimal strings, no float anywhere

Each child then walked its own custody lifecycle, and each custody transition supply-chain.paid -> supply-chain.verified was sealed into a StateTransitionCommitment artifact - EIP-712 signed - and its content hash anchored as a Memo event on Arc testnet, sent from inside the production runtime:

childtxHashblock
split-a, 250 kg0x09d422d9...443775396156
split-b, 150 kg0xe24e8f8c...241d75396169

A second, independent dev run of the same scenario produced two more anchors (0x028dfabe...e0bf and 0x6ac6caae...2e1d) - four anchors total, all publicly checkable.

Real explorer capture of the split-a anchor transaction - status Success, block 75396156, Memo contract call visible; not an illustration

And the lineage itself is readable right now, by anyone, no account needed - this is the production API responding today:

GET https://agentbadge.xyz/api/ledger/shipments/devin-test-239-prodseed-1

HTTP 200
{
  "lineage": {
    "root": {
      "assetRef": { "value": "devin-test-239-prodseed-1" },
      "children": [
        { "assetRef": { "value": "devin-test-239-prodseed-1-split-a" },
          "relationType": "SPLIT_FROM", "quantity": "250", "unit": "kg" },
        { "assetRef": { "value": "devin-test-239-prodseed-1-split-b" },
          "relationType": "SPLIT_FROM", "quantity": "150", "unit": "kg" }
      ]
    },
    "maxDepth": 1, "truncated": false, "depthLimitReached": false
  }
}

(Abridged for readability - the lineage object shape is verbatim; the full response also carries the custody timeline. No internal UUIDs, no tenant fields: the projection is leak-checked by construction.)

The verification pipeline - five stations on a line: custody events, conservation-checked split, sealed commitment artifacts, Arc testnet memo anchors, and an outside reader recomputing hashes into a green MATCH; two red defect marks from the cloud verifier with their fixes noted below

The part that actually matters: somebody else recomputed it

Self-verification is worth exactly nothing in this business, so the final gate was an independent cloud verification session - an outside consumer with no access to our database, no private keys, and no reason to be polite. It decoded the Memo events straight from chain receipts, then recomputed the content path locally: regenerated the commitment identifiers from a fresh run, derived keccak256("process:" + commitmentId), and compared those values against what the chain actually contains.

Exact match. Both prod-seed memoIds, recomputed from scratch by a third party, equal to the on-chain values. That's the entire point of the architecture in one sentence: not "our API says so," but anyone can recompute why this anchor belongs to this sealed transition.

The recompute bridge - a laptop outside a data center recomputing the hash from a JSON artifact while the same hash floats inside a blockchain receipt panel, a glowing MATCH beam connecting the two identical strings

The same session did what good verifiers do - it found defects, and they made the evidence better:

  • The lineage block was live in the API but missing from the docs - spec drift, fixed and redeployed.
  • The artifact JSONs lived only on the production host's disk, so full hash verification couldn't travel with the repository - now the artifacts and machine-readable verification reports are committed to public git, and all four anchors re-verify as MATCH.
  • Child ordering differed between memory and Postgres backends - the sort is now content-deterministic, with a regression test.

For a junior, this is the difference between a bank statement the bank prints for you and a bank statement you can recompute from the transaction log yourself. The first is a claim. The second is a proof. We'd rather be caught by our own verifier than by your incident report.

The honest section: what this is not

You'd rather hear it from us than guess:

  • Anchors are on Arc testnet. The production code path and production database are real; no mainnet value moved, and no mainnet claim is implied.
  • The weight evidence is self-attested test measurement - a keccak of canonical JSON, not a signed hardware scale attestation. Device-grade measurement ingestion is separate work, not this epic.
  • Custody in this dogfood runs on an in-memory hop executor. There is no escrow-spend claim here; the money layer is a different epic's story.
  • This is a lineage registry, not inventory accounting. The split is consumptive and single-use by design; remaining-quantity warehouse math is deliberately out of scope for v1. And there is no public write API - writes are trusted internal library calls, a boundary the production verification re-confirmed.

What this opens

The registry is domain-agnostic on purpose, and the next bricks are already shaped: signed measurement ingestion, so the quantities on edges can carry device-grade evidence instead of self-attestation; untrusted-reader write paths, if and when the trust boundary moves; and deeper integration with the process runtime from the previous episode - the journal that owns what happens now has a registry that owns what exists.

Read the arc

Don't certify. Measure.

Shipped: a universal asset registry with exact decimal mass conservation, consumptive single-use split, append-only provenance edges, bounded lineage queries with explicit truncation, a leak-checked public read surface - proven live on one 400 kg batch split into 250 + 150, four testnet anchors, all four independently recomputed to MATCH.