Skip to content

Onchain ID registry

A campaign picks one of two ways to hand out deposit-address indices when it is created. The choice is incrementMode and it cannot change later.

Mode Who counts
offchain The Altar server keeps a counter for each campaign and network.
onchain A contract called ProjectIdRegistry keeps the counter.

ProjectIdRegistry is one contract for each chain. The deployment on PulseChain (chain 369) is at 0xb8781c9cd7b6f41e05c7b11d0e86b22909a1d6cd. The trusted forwarder is the unmodified OpenZeppelin ERC2771Forwarder at 0x68f82bf601260731c7c33f3fa022121c45149365. Both are verified on Sourcify with an exact match of the creation and the runtime bytecode (verified on 2026-06-16). The repository file docs/registry-verification.md holds the compiler settings, the constructor arguments, and the commands to reproduce the check.

The registry has no owner. The contract stores counters and destination addresses as keys. It stores no deposit addresses.

  • Create a project. Anyone can call createProject(name, admin). The project key is keccak256(abi.encode(creator, name)). The creator address is part of the key, so nobody can claim another account’s name.
  • Enable networks. The project admin calls enableNetwork for each network. The first index on a network is 1.
  • Register. Anyone can get an index for a destination address. registerSelf registers the caller. registerWithVoucher takes a voucher that the destination signed, and anyone can submit it. The Altar server can relay a voucher and pay the gas (POST /address/register-voucher). You can also submit your own voucher.
  • Assignments are permanent. An address that has an index always gets the same index back. Nobody can change or remove an assignment, project admins included.
  • Finalize. The admin calls finalize(start, end) once. It records an advisory schedule and gives up the admin’s power to change counters: after it, the admin can no longer enable or disable networks. The schedule does not stop issuance.
  • Publish anchors. The admin can still call publishAnchor(count, root) after finalizing. It stores the Merkle root of the next contiguous range of deposit addresses. Anchors can be added. They cannot be changed or removed.

The voucher message uses the typed data RegisterVoucher(bytes32 projectKey, bytes32 networkKey, address destination, uint256 deadline). Its domain is the registry contract (name ProjectIdRegistry, version 1), not the Altar domain.

  • It does not check deposits. Deposits are read from each chain by the collectors.
  • It does not hold or move funds.
  • Its status view (Setup, Pending, Running, Ended) is advisory and never blocks issuance.

An onchain campaign must set registryAddress (a valid EVM address) and registryProjectKey (the 32-byte key). An offchain campaign must leave both empty. Altar checks this before it creates the campaign.

For networks that derive one address per index, an admin can upload a range of addresses ahead of time and publish its Merkle root. Anyone can then read the root with GET /{projectId}/address-sets and ask for a proof with GET /{projectId}/address-proof/.... See Verify it yourself.