ProvenanceKit’s ProvenanceRegistry contract lets you anchor provenance actions on any EVM chain. On-chain records are the source of truth; off-chain databases are materialized views indexed from chain events.
Architecture
ProvenanceRegistry
The contract stores one event per provenance action:actionId is a bytes32 derived from the off-chain UUID. CIDs are hashed to bytes32 for gas efficiency.
The contract is permissive by design — any address can record any action. Authenticity is established off-chain via attribution signatures and API key ownership.
Deploying the contract
PROVENANCEREGISTRY_ADDRESS in your API .env after deployment.
Supported networks
The contract is standard EVM — deploy to any EVM-compatible chain:| Network | Chain ID | Status |
|---|---|---|
| Ethereum mainnet | 1 | 📋 Planned |
| Base | 8453 | 📋 Planned |
| Optimism | 10 | 📋 Planned |
| Any EVM chain | — | ✅ Self-deploy |
Enabling on-chain anchoring in the SDK
The SDK ships with acreateViemAdapter helper for viem:
EIP-1193 adapter (framework-agnostic)
For browser wallets (MetaMask, WalletConnect) or other environments that expose an EIP-1193 provider:Indexing chain events
@provenancekit/indexer reads ActionRecorded events from the contract and syncs them back into the API’s database, so queries against the API always reflect the on-chain state.
Building on another network
To use ProvenanceKit’s standards on a chain we haven’t deployed to:- Deploy
ProvenanceRegistrywithforge script(any EVM chain) - Implement
IChainAdapteror usecreateViemAdapter/createEIP1193Adapter - Run
@provenancekit/indexerpointed at your deployment - Everything else (SDK, API, extensions) works unchanged
Gotchas
- On-chain failure is non-fatal. If the transaction reverts or times out,
pk.file()still succeeds and returns the off-chainactionId. Checkresult.onchainfor the tx details. - Gas estimation.
recordAction()costs roughly 60–100k gas depending on the number of CIDs. Budget accordingly for high-volume pipelines. - Self-attribution on-chain is intentional. The contract does not verify that the
recorderaddress owns the entities being attributed. Authenticity enforcement is the responsibility of your off-chain verification layer.