Protocol Specification

Protocol Specification

How OCF records, the API, contracts, and poller fit.

System model

LayerSourceResponsibility
OCF recordsocf/schema and MongoDBOffchain issuer, stakeholder, stock class, transaction, and support-record shapes.
API serverserver/routesValidates OCF-shaped input, writes MongoDB records, and calls contracts.
Contractschain/srcStores issuer, stock class, stakeholder, active position, and transaction state onchain.
Event pollerserver/chain-operations/transactionPoller.tsSyncs contract events back into MongoDB history records.

Contract structs live in Structs Library; stock lifecycle behavior lives in Stock Functions.