Skip to content

Eight-Stage Traceability

AsiliChain records every physical custody event of a coffee batch across eight defined stages. Each stage event is written to both Mantle (TraceLog.sol) and Hedera HCS, creating an immutable, auditable chain of custody from farm gate to export container.

Stage #StatusTriggerRecorded byDDS relevance
1REGISTEREDFarm boundary GPS mapped and verified against MAAIF NTSMAAIF API or field agentFarm GPS polygon — mandatory for DDS
2DELIVEREDCoffee weighed at collection point. BatchToken minted.Field agent (USSD or agent app)Collection point GPS — mandatory
3GRADEDQuality assessment passed (moisture %, screen size grade)Cooperative quality officerGrade data included in DDS — triggers DDS eligibility
4MILLEDPhysical processing complete (hulled, cleaned, sorted)Mill operator via dashboardCustody chain — included in DDS
5WAREHOUSEDCoffee stored under UWRSA warehouse receiptWarehouse managerStorage reference — included in DDS
6COMMITTEDPurchaseOrder confirmed on-chain by buyerCooperative + buyer portalBuyer reference — included in DDS
7EXPORTEDShipment confirmed by UCDA export licenceExporter via dashboardExport confirmation — included in DDS. Triggers auto-repayment. See Export Certification & Physical Journey for the full certification and logistics process.
8SETTLEDBuyer USDC payment received, loan repaid, net disbursedLendingVault auto-executesFinal settlement — HCS record closed

Every stage event writes to two systems simultaneously:

Mantle (TraceLog.sol):

event StageUpdated(
uint256 indexed batchId,
TraceStage indexed newStage,
address indexed updatedBy,
uint256 timestamp,
bytes32 dataHash // IPFS CID hash of supporting evidence
);

Hedera HCS:

{
"batch_id": "BATCH-2026-004821",
"stage": "GRADED",
"cooperative_id": "COOP-MBALE-001",
"timestamp": "2026-04-17T14:00:00Z",
"grade": "screen18",
"moisture_pct": 11.2,
"recorded_by": "0xCOOP_WALLET",
"mantle_tx_hash": "0xbcd..."
}

Every BatchToken generates a public QR traceability URL:

https://trace.asilichain.xyz/batch/BATCH-2026-004821

Scanning this QR code reveals the full 8-stage history, GPS origin, and DDS status — readable by any EU customs official or buyer compliance team without authentication.

BatchToken’s architecture makes mass-balance blending architecturally impossible:

  • Each BatchToken carries the specific MAAIF farmer IDs of every contributing farmer
  • A DDS can only be generated for BatchTokens that share the same cooperative ID and shipment
  • Mixing batches from unverified farms into a verified container is detectable and blocked at the smart contract level

This is the key architectural difference from paper-based systems where blending is undetectable.