Docs · Contracts
Registry
An append-only record of post-quantum key hashes, one history per account, timestamped by the chain. It has no owner and no admin.
Purpose
After elliptic curve keys break, a signature no longer proves who owns a wallet. A commitment made before that point still does. The Registry exists to hold that commitment with a timestamp nobody can backdate.
What is stored
struct Commitment {
bytes32 pqKeyHash; // hash of the account's one-time public key
uint64 timestamp; // block.timestamp when it was recorded
uint64 blockNumber; // block.number when it was recorded
}
Each account has an array of these. Entries are only ever added, so the first one stays readable for good.
Robinhood Chain is an Arbitrum Nitro chain. Inside a contract, block.number is the Ethereum block number the sequencer last saw, not Robinhood Chain's own block height. Every block number these contracts record or compare is on that clock, so compare blockNumber with Alarm.trippedAtBlock() and never with eth_blockNumber.
Writing
Records the first key hash for the caller. Reverts with AlreadyCommitted if the caller has an entry.
Appends a new key hash for the caller. Reverts with NoCommitment if there is nothing to rotate from.
Appends an entry for a modular smart account. The caller must be a validator module currently installed on account, checked with isModuleInstalled(1, msg.sender, ""). This is how the Vault validator commits during install. The account chose to install the module, so the commitment is still the account's own decision.
Reading
The latest entry and the number of entries. Returns zeros and a count of 0 when the account has none.
Any past entry, oldest first. Reverts with IndexOutOfRange past the end.
True once the account has at least one entry.
import { createPublicClient, http } from "viem";
import { registryAbi } from "@enquantum/abi";
const client = createPublicClient({ transport: http(RPC_URL) });
const [pqKeyHash, timestamp, count] = await client.readContract({
address: REGISTRY,
abi: registryAbi,
functionName: "commitmentOf",
args: [wallet],
});
Rules
- Writes close when the alarm trips. Every write checks
alarm.tripped()and reverts withAlarmTripped. A commitment made after the trip proves nothing. - The zero hash is refused. Writes revert with
ZeroHash. - Nothing is ever removed. There is no delete, no owner and no upgrade path.
- The timestamp comes from the chain. The caller cannot supply or adjust it.
It proves that whoever controlled the account at that block held the key behind the hash. It does not move funds or change how a plain wallet signs. See the security model.
Events and errors
event Committed(
address indexed account,
bytes32 indexed pqKeyHash,
uint256 index,
uint256 timestamp,
address committer
);
| Error | When |
|---|---|
AlarmTripped() | Any write after the alarm has tripped. |
ZeroHash() | The key hash is zero. |
AlreadyCommitted() | commit when an entry exists. Use rotate. |
NoCommitment() | rotate with no entry. Use commit. |
IndexOutOfRange() | commitmentAt past the end of the history. |
NotInstalledValidator() | commitFor from a caller that is not an installed validator on the account. |