Deploy provenance records to an EVM blockchain. Records are cryptographically tamper-evident and independently verifiable — even if ProvenanceKit’s API goes away.
Overview
ProvenanceKit supports two on-chain recording modes:
Both modes write to the same
ProvenanceRegistry contract. Records are never deleted on-chain — this is the source of truth.
Deployed Contracts
API-Side Recording (Relayer Model)
WhenBLOCKCHAIN_* env vars are set on provenancekit-api, the server wallet acts as a trusted relayer. Every provenance action is automatically anchored on-chain — no user wallet or transaction signing required.
POST /v1/activity call now records on-chain automatically. The on-chain anchor is added to the action’s ext:onchain@1.0.0 extension:
SDK-Side Recording (User Wallet)
For user-initiated actions where the user’s wallet address should appear on-chain, use the SDK chain adapters.Option 1: viem (server-side or Node.js)
Option 2: EIP-1193 Provider (MetaMask / Privy / WalletConnect)
For browser environments using any EIP-1193 compatible wallet:UX: No Per-Action Signing Required
A common concern: “Does recording provenance require users to sign a transaction for every action?” No — and this is by design. The API-side relayer model (recommended for most apps) means:- Users never see MetaMask popups for provenance recording
- The server wallet pays gas and signs on behalf of the app
- Entity IDs and content CIDs are what’s recorded — not raw wallet addresses
- Attribution is anchored via content hashing, not wallet signing
- You want the user’s wallet address to appear as
msg.senderon-chain (e.g. on-chain splits) - The user is explicitly publishing a work and should own the on-chain record
Payment Routing and On-Chain Splits
When using the relayer model, payment streaming (Superfluid) still works because:- The entity’s
walletaddress is stored off-chain in the database - The distribution calculator reads
entityId → walletAddressfrom the DB - Superfluid streams tokens to the resolved wallet addresses
Verifying On-Chain Records
Any record can be independently verified without ProvenanceKit:Multi-Network Environment Isolation
ProvenanceKit API supports one active network at a time. To maintain clean separation between development, staging, and production, deploy separate API instances with different environment variables.Recommended pattern
Each API instance has its own
pk_live_ API keys, separate database, and its own blockchain relayer wallet. Provenance records on testnet and mainnet are completely isolated — they share no state.
Dashboard network indicator
The ProvenanceKit dashboard (provenancekit-app) shows the active network on every project page and in the provenance explorer. When a project’s configured Chain ID differs from the API’s active chain, the dashboard shows a mismatch warning:- Amber badge — testnet (Base Sepolia, Ethereum Sepolia, etc.)
- Emerald badge — mainnet (Base, Ethereum, Polygon, etc.)
- Grey badge — unknown / custom chain
Environment variables per network
Querying network info from the API
The API exposes its current network configuration viaGET /management/network:
Deploying to Your Own Chain
Use the Foundry deploy script to deployProvenanceRegistry to any EVM chain:
deployments/<network>.json with the deployed address, then set BLOCKCHAIN_CONTRACT_ADDRESS in your API env.
Gotchas
- Gas: The API server wallet must have ETH on the target chain. Monitor the balance — if it runs out, on-chain recording silently falls back to off-chain only (fire-and-forget semantics).
- Chain ID mismatch:
BLOCKCHAIN_CHAIN_IDmust match the chain ID ofBLOCKCHAIN_RPC_URL. Wrong chain ID causes viem to reject transactions. - Private key format:
BLOCKCHAIN_PRIVATE_KEYmust include the0xprefix. - Verification: Contract verification on Basescan requires
BASESCAN_API_KEY. The contract is already deployed and functional without it. - Testnet vs mainnet: Use Base Sepolia (
84532) for development. Get test ETH from the Coinbase Base Sepolia faucet.