Whitepaper · 10
Use Cases
Six scenarios showing how the four interfaces of A-REX Core, plus hooks, cover the situations that a grain elevator, a cooperative, an exporter, a lender and a regulator actually face. Each scenario names the calls involved.
1. Stored grain and warehouse receipts
Situation. A cooperative elevator receives 250 t of wheat from a member, issues a certificate of deposit, and later sells the lot in two parts.
On-chain.
createBatch({commodity: HS:100199, unit: KGM, producedAt: harvest, expiresAt: 0, originRef: hash(certificate #CD-88213), metadataHash, uri}, 250_000, member)— the token references the legal receipt; it does not replace it until the jurisdiction says so.setBatchStatus(id, 1 /* IN_STORAGE */, ref("SILO-3"))by the elevator (STATUS_ROLE).transform(member, buyerA, [id], [100_000], [same commodity/unit], [100_000], ref("SALE-1"))— a re-batch, no role needed;parentsOf(newId) == [id].- Second sale likewise; the remaining 50 t stay in the original id.
- On physical withdrawal the buyer's units are burned:
burn(buyerA, newId, 100_000); the elevator retires the parent lot when empty.
Why it matters. Supply is exact (totalSupply), provenance is a chain of BatchTransformed events, and the receipt registry stays authoritative.
2. Pre-harvest financing (CPR, forward, warrant on future crop)
Situation. A Brazilian producer issues an electronic CPR for 1,000 t of soybeans to be harvested in April; a lender advances funds against it.
On-chain.
createBatch({commodity: HS:120190, unit: TNE, producedAt: 0, expiresAt: 0, originRef: hash(CPR-e registry id), …}, 1000, producer)—producedAt == 0is the standard's representation of a future lot.ExpiryHook(allowPreHarvestTransfers = true)so the receivable can be assigned; a spot marketplace would deploy it withfalse.- The lender's security interest:
setFrozenTokens(producer, id, 1000)byENFORCER_ROLE(the platform acting under the pledge agreement). The producer keeps title but cannot move the units. - At harvest:
setBatchMetadatawith the weighing ticket;setBatchStatus(id, 2 /* HARVESTED */); the platform recordsproducedAtin metadata (the on-chain field is immutable by design; the status change is the on-chain fact). - Repayment:
setFrozenTokens(producer, id, 0). Default:forcedTransfer(producer, lender, id, 1000)under the pledge.
Why it matters. The two most common credit events in agriculture — pledge and execution — are two calls, both auditable, both compatible with UCC Article 12 "control" and with registry-based instruments.
3. Coffee export under the EUDR
Situation. A Colombian exporter ships 20 t of green coffee to a roaster in Hamburg after 30 December 2026.
On-chain.
createBatch({commodity: HS:090111, unit: KGM, producedAt: harvest, originRef: hash(DDS reference), …}, 20_000, exporter). Plot polygons stay in the EU Information System and the exporter's restricted storage.- The exporter's compliance officer is a trusted issuer for topic
EUDR:DDS:attest(id, EUDR:DDS, hash(DDS reference), 0). AttestationHook.setRequirement(HS:090111, EUDR:DDS)on the token: transfers of coffee without the attestation returnATTESTATION_MISSING.- Sale:
safeTransferFrom(exporter, roaster, id, 20_000, data); the roaster, a downstream operator, keeps the DDS reference for five years — it is in the batch metadata it now holds. - Roasting:
transform(roaster, roaster, [id], [20_000], [{commodity: HS:090121, …}], [16_800], ref("ROAST-2027-03"))— the roasted lot's parents point to the green lot and, through it, to the DDS.
Why it matters. The regulation's chain of references survives processing, and the geodata that the EDPB says must not be on a public chain never is.
4. Perishable produce and cold chain
Situation. A packer ships strawberries with a 12-day shelf life; a temperature excursion is recorded in transit.
On-chain.
createBatch({commodity: GTIN:…, unit: BX, producedAt: packDate, expiresAt: packDate + 12 days, …}, 4_800, packer); the metadata carries the FSMA traceability lot code assigned at initial packing.ExpiryHookblocks any transfer afterexpiresAt(BATCH_EXPIRED); burns remain possible for write-off.- A cold-chain hook (
DeliveryHook) returnsIN_TRANSITduring transport and records checkpoints inonExecuted. - The excursion is attested by the logistics provider:
attest(id, COLDCHAIN:EXCURSION, hash(sensor log), 0); a buyer-side hook can refuse receipt (canReceivepolicy) or the parties settle off-chain with the attestation as evidence. - Delivery:
burnby the receiver, orsetBatchStatus(id, 255 /* RETIRED */, ref("DELIVERED"))by the packer.
Why it matters. Shelf life, custody and quality incidents are three independent hooks over one batch record; none of them required a change to the token.
5. Cooperative distribution and member settlement
Situation. A cooperative markets a 1,000 t pooled lot and must allocate proceeds and residual grain to 40 members.
On-chain.
- Members deliver into the pool: each delivery is a
createBatchto the member, thentransform(member, coop, [ids], [amounts], [pool spec], [amount], ref("POOL-2026"))merging into the pool lot (re-batch, no role needed if same commodity and unit). parentsOf(pool)lists every member delivery — the allocation key is on-chain.- Sale of the pool to a buyer: one
safeTransferFrom. - Residuals:
transform(coop, coop, [pool], [remaining], [40 outputs], [per-member amounts], ref("RESIDUAL"))andsafeBatchTransferFromto members.
Why it matters. Pooling and de-pooling, which today live in cooperative ledgers, are lineage operations with exact quantities.
6. Recall
Situation. A laboratory finds aflatoxin above the limit in a maize lot that was already split and partly processed.
On-chain.
- The laboratory (trusted issuer for
LAB:AFLATOXIN) attests the result:attest(id, LAB:AFLATOXIN, hash(report), 0). - The platform retires the lot:
setBatchStatus(id, 255, ref("RECALL-2026-07")); transfers stop immediately (ARexBatchRetired), burns (destruction) remain possible. - Forward tracing: every
BatchTransformedwhoseinputIdscontainidyields the children; recursively, the affected feed and food lots. Backward tracing:parentsOf. - The regulator receives the list of affected ids and holders from the event log — the 24-hour requirement is met by an indexer query, not by a records search.
Why it matters. Recall scope is a graph query over standardized events, which is what FSMA 204's transformation CTE was designed to make possible.
What these scenarios have in common
- Four interfaces, three reference hooks and the attestation registry cover all six; no scenario needed a change to the standard.
- Legal instruments (receipts, CPR-e, DDS, lab reports) are referenced and hashed, not re-implemented.
- Enforcement (freeze, forced transfer, retire) is present in every financing and compliance scenario and is always an event.
- Personal data never appears on-chain.