Contract & risk model
Security & Contracts
How ZhenRegistry isolates admin and signing keys on X Layer, enforces holder-bound badges, and handles responsible disclosure.
Contracts & key isolation
Administrative control and verdict signing are strictly separated across distinct keys on X Layer mainnet (chain 196).
| Component | Address | Role | Scope |
|---|---|---|---|
| ZhenRegistry | 0xba2B0f…2C9819 | Badge registry | Verifies EIP-712 signatures, checks live ownerOf, stores seller badges. |
| Registry Owner | 0x0b81DB…BdB82c | Ownable2Step | Can revoke badges, rotate signer, adjust fee and withdraw fees. Renounce disabled. |
| API Signer | 0xf29352…a3f045 | Hot signing key | Signs non-danger verdicts only; zero admin or withdrawal rights. |
| TapeOut Factory | 0x1f09da…760761 | Read-only source | Enumerates every TapeOut processor deployed on X Layer. |
| FAB-Genisis | 0x87bfca…c8f9a6 | Read-only source | FabX Proof-of-Design processor contract read by the indexer. |
| ZhenAnchor | 0xb29e39…a8c006 | Merkle root anchor | Stores the Merkle root of each index snapshot. Write-once, blocks only increase. |
| Anchor Owner | 0x0b81db…bdb82c | Ownable2Step | Can replace the anchorer. Cannot change or remove a root already posted. Renounce disabled. |
| Anchorer | 0x209149…854a5e | Hot wallet with a little OKB | Posts the root of a newer snapshot after each refresh. Cannot overwrite a root or move funds of the contracts. |
On-chain guards
EIP-712 seller & domain binding
Every signature binds to chainId 196, ZhenRegistry address, msg.sender, subject, verdictHash, checkedAtBlock, a 256-bit nonce and a 15-minute deadline.
Danger verdicts rejected on-chain
attest reverts with DangerNotBadged if level >= 2, and POST /api/v1/badge/sign refuses any verdict containing hidden findings.
50,000-gas holder auto-lapse
attest and isVerified call processor.ownerOf(id) via assembly staticcall capped at 50,000 gas and 32 return bytes, dropping badges immediately upon transfer.
Monotonicity & permanent revocation
A seller can overwrite their badge only with a strictly newer checkedAtBlock. Revoked subjects revert with SubjectRevoked forever.
Known boundaries & disclosure
- Processor deployer lookup: TapeOut processors do not expose an on-chain deployer getter, so processor badges verify against the indexed creation transaction sender.
- Buy-back badge reactivation: If a circuit is transferred away and later bought back by the earlier badge recorder, isVerified turns true again under the older checkedAtBlock. Always inspect checkedAtBlock alongside active status.
- Private reporting: Report issues via GitHub private security advisories. Expect acknowledgement within 72 hours and a status update within 7 days.
| In scope | Out of scope |
|---|---|
| ZhenRegistry signature checks, fee accounting, holder checks, revocation | Upstream TapeOut or FabX contracts (report to their owners) |
| Signing API key handling, injection, SSRF or wrong-verdict indexer bugs | Compromised user wallets/browsers or public read API rate limits |