Skip to main content
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)

When BLOCKCHAIN_* 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.
On startup you’ll see:
Every 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:
The API records on-chain fire-and-forget — if the blockchain transaction fails, the off-chain record still succeeds. This makes on-chain recording non-fatal and prevents blockchain congestion from breaking your application.

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
For the SDK model, you only need user signing when:
  1. You want the user’s wallet address to appear as msg.sender on-chain (e.g. on-chain splits)
  2. The user is explicitly publishing a work and should own the on-chain record
Use smart wallet session keys (Privy, Coinbase Smart Wallet) to avoid per-action popups even with user wallets:

Payment Routing and On-Chain Splits

When using the relayer model, payment streaming (Superfluid) still works because:
  1. The entity’s wallet address is stored off-chain in the database
  2. The distribution calculator reads entityId → walletAddress from the DB
  3. Superfluid streams tokens to the resolved wallet addresses
The on-chain record attests to what happened (content hash, action type, timestamp). The payment routing is a separate concern resolved from the provenance graph in the off-chain DB. For on-chain splits (0xSplits, canvas example), entities’ wallet addresses must be registered when creating entities:

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. 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
The badge links to the block explorer so you can verify transactions directly.

Environment variables per network

Never use the same BLOCKCHAIN_PRIVATE_KEY across environments. Use separate relayer wallets per environment with minimal funded balances.

Querying network info from the API

The API exposes its current network configuration via GET /management/network:

Deploying to Your Own Chain

Use the Foundry deploy script to deploy ProvenanceRegistry to any EVM chain:
Update 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_ID must match the chain ID of BLOCKCHAIN_RPC_URL. Wrong chain ID causes viem to reject transactions.
  • Private key format: BLOCKCHAIN_PRIVATE_KEY must include the 0x prefix.
  • 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.