Native Passkeys, a Four-State Inbox, and an On-Chain Firewall for AI Agents

For fifteen years, most blockchain account systems have rested on a fragile binary assumption: without the private key, you can do nothing; with a signature, or an approve(MAX_UINT256) authorization, you can expose the entire account.
When humans made only occasional manual transfers, hardware wallets and careful inspection could partly compensate for this coarse permission model. In the era of ARC (Agentic Realm Computer) and collaboration among multiple agents, the actors using accounts have changed:
- Signers now include AI agents running around the clock. Put a primary account's private key in an agent's environment variables, and a prompt injection or compromised dependency can expose the entire vault within milliseconds.
- Attacks arrive through incoming assets as well as outgoing signatures. On conventional public chains, anyone can send an address spam NFTs with phishing links, lookalike tokens, or assets carrying unwanted associations. The wallet inbox is effectively an unmoderated public noticeboard.
- Browsers and mobile devices are the main interface, but seed phrases create a usability and security conflict. Schemes that derive a mnemonic seed from passkey output, known as
Passkey-as-a-Seed, turn hardware-backed protection back into a plaintext secret in application memory.
For the next generation of ArcBlock ledger security, we rebuilt both the cryptographic foundation through native passkey support and the state-machine boundaries through declarative AccountGuard policies and a four-state inbox. The objective is concrete: hardware-authenticated control without exposing signing private keys in application memory, quarantine for unwanted assets, and protocol-enforced limits for every AI agent.
1. Native passkey security: why we reject derived signing seeds
To spare users the task of recording twelve mnemonic words, some wallets use Passkey-as-a-Seed. They obtain entropy through the WebAuthn prf extension or a signature over a fixed message, then derive a secp256k1 or Ed25519 private key in browser JavaScript memory.
We rejected this approach during architecture review and adopted a strict rule: Zero Signing SK in Memory. No client runtime may construct, export, or assemble a private-key scalar capable of signing transactions.
The reason is straightforward. With a hardware-backed passkey, software asks an Apple Secure Enclave, Android Keystore, or hardware security key to sign a challenge; it does not read the private key. If the application uses that interaction to derive another signing key in browser memory, an XSS exploit or malicious extension can steal the derived key. The second key bypasses the hardware boundary we wanted to preserve.
Native P-256 and DID role support
Rather than forcing passkeys to accommodate legacy curves, we taught the ledger core to verify their signatures directly.
In @ocap/ledger-core, NIST P-256 (secp256r1, KeyType.P256 = 3) and ROLE_PASSKEY = 22 are first-class elements of the DID address specification and transaction verification engine:
- Deterministic COSE public-key normalization (RFC 8949 Canonical COSE_Key). WebAuthn registration produces COSE public keys (
kty=2 EC2,alg=-7 ES256,crv=1 P-256). Protocol-levelstrict_v2validation rejects nondeterministic key ordering, unknown extra keys, and invalid coordinates. Bothxandymust be exactly 32 bytes and identify a point on the curve. - Low-S signature normalization against malleability. ECDSA DER signatures admit the related forms
(r, s)and(r, n - s). Inbound verification and state transitions enforces <= n / 2. Idempotent deduplication uses the signature-strippedunsignedTxHash, preventing a flippedsvalue from creating a distinct logical transaction. - Strict origin and RP ID binding. Inside the state-transition verifier,
strict_v2checksauthenticatorDataforrpIdHash === SHA256(allowedRpId)and theUserPresent (UP)flag, and checksclientDataJSON.challenge === base64url(SHA256(unsignedTxBytes)). This binds the signature to the permitted relying party and transaction challenge, rather than trusting a frontend's assertion that authentication succeeded.
How do you derive subaccounts without a private-key seed?
A nonexportable hardware passkey cannot perform BIP-32-style hierarchical private-key derivation. Does a user need to register a new hardware credential for every application, privacy context, or department?
No. We move derivation from client-side private-key arithmetic to hardware authentication plus deterministic public-salt derivation at the protocol layer (SubAccountSalt):
Root Passkey (Hardware Secure Enclave, P-256 Public Key PK_root)
│
├─ Account #0 (Main Vault) : did:abt:z... ← Hash(PK_root || Salt_0)
├─ Account #1 (AI Agent Ops): did:abt:z... ← Hash(PK_root || Salt_1)
└─ Account #2 (Gaming/Trial): did:abt:z... ← Hash(PK_root || Salt_2)All subaccounts share the hardware-protected verification anchor PK_root, while retaining separate DID addresses, asset balances, and firewall policies in the ledger state tree. A user can manage these isolated accounts through the same hardware credential without any signing private key leaving the device.

2. Why a smart-contract wallet is not enough
EVM ecosystems introduced ERC-4337 account abstraction and smart-contract wallets to improve the coarse permissions of externally owned accounts. Implementing account security in external, Turing-complete contracts still leaves two structural concerns.
The first is implementation defects and upgrade backdoors. Proxy contracts, plugin hooks, and reentrancy boundaries can turn a defect in the protective layer into a route to the assets it protects.
The second is inconsistent security semantics. Each wallet can invent its own permission storage. Wallet clients, explorers, and light nodes cannot reliably explain an account's safeguards without simulating its bytecode.
We therefore made IAccountGuardDsl a deterministic protocol-level state machine inside @ocap/ledger-core. An account's policy is a schema-constrained declarative configuration that a light node can parse directly. Five independent modules define its protection:
| Module | Direction | Engineering problem | Deterministic protocol action |
|---|---|---|---|
inboundGuard | Incoming asset admission | Spam airdrops, phishing NFTs, and dust-based address poisoning | Unapproved transfers enter the four-state quarantine inbox (InboundInbox) |
outboundGuard | Outgoing transfer limits | A stolen key or abnormal script rapidly draining a vault | Per-transaction limits, rolling 24-hour limits, hourly frequency caps, and cooldowns for new recipients |
agentCapabilities | Fine-grained AI agent authorization | Agents invoking dangerous transactions or altering records beyond their authority | Three-layer VerifyDelegation capability tree: transaction type, field predicates, and budget buckets |
timelockAndKillSwitch | Delayed execution and emergency intervention | Large transfers that cannot be stopped, or delegates that cannot be disabled quickly | Over-threshold transactions enter an on-chain delay queue; a guardian key can veto them and freeze a delegate |
metaGuard | Protection against policy tampering | An attacker disabling safeguards before transferring assets | Tightening takes effect immediately; loosening requires a 24-hour ratchet timelock |
3. A four-state inbound inbox for unwanted assets
On conventional chains, receiving an asset is passive and cannot be refused. Anyone who knows an address can place unwanted tokens or NFTs carrying fraudulent messages into its account state.
We introduced a protocol-level four-state inbound inbox (InboundInbox), controlled by inboundGuard, to give recipients an admission boundary.
When a transfer, NFT transfer, or cross-chain credit reaches a protected account, an untrusted sender or unapproved asset type does not immediately increase the spendable balance. The state machine routes it into an isolated InboundInboxItem queue with four explicit outcomes:
Accept. The owner signs an acceptance, moving the quarantined asset into the account's available balance or collection.Reject. The owner refuses the asset, and the protocol returns it to the sender.Timeout. If no action occurs withininboxTtlSeconds, the expired item becomes eligible for stateless cleanup. The account'sexpiredInboxActionpolicy determines whether it is returned or burned, preventing unbounded quarantine growth.Burn. For malicious airdrops and phishing NFTs, the owner or configured inbound policy can send the asset todid:abt:burn, removing it from the active state tree instead of returning it for another round of harassment.
The account gains the equivalent of an email quarantine gateway and a discard mechanism. Unapproved incoming assets remain outside its usable holdings.
4. Enforcing AI agent limits through delegation and timelocks
An autonomous agent needs enough authority to buy compute, pay API fees, and settle small transactions. That authority also needs enforceable boundaries that survive a compromised agent.
With AccountGuard, the human's primary account remains controlled by its hardware passkey. Instead of sharing a primary key, the owner issues each agent an on-chain-verifiable delegation credential. Three defenses constrain its use.
A three-layer VerifyDelegation capability trie
The VerifyDelegation engine rejects blanket authority. Every agent-initiated transaction must satisfy three checks:
- Layer 1: transaction-type prefixes. Capabilities such as
fg:t:transfer_v3andfg:t:exchange_v2permit only specific state transitions. Attempts to invokeaccount_migrateor modify security policies outside that scope are rejected during parsing. - Layer 2: field-level predicates. Policies constrain fields inside the payload. For example,
itx.tomust belong to an approved set of service-provider DIDs, oritx.valuemust remain below a specified threshold. - Layer 3: rolling-window quotas. The on-chain state machine maintains
perTxLimit,rolling24hLimit, andmaxTxPerHourfor the delegation ID.
A delay queue and emergency stop: vetoTimelockAndFreezeDelegate
Some transactions fall between immediate approval and outright rejection. A transfer to a new recipient may trigger newRecipientCooldownSec; another may exceed the immediate-release threshold while remaining below the hard cap. These requests enter the on-chain TimelockQueue.
The user's mobile wallet receives a light-node alert. If the request appears to result from prompt injection, a fingerprint-authorized vetoTimelockAndFreezeDelegate call performs two actions in one atomic state transition: invalidate the queued transaction and freeze the offending agent's delegated public key.
The MetaGuard ratchet: immediate tightening, delayed loosening
A familiar attack starts by changing policy rather than transferring assets. An attacker raises the daily limit to an unlimited amount, then drains the account.
The fifth module, metaGuard, closes this route with a one-way security ratchet:
- Tightening (
tightenImmediate: true). Lowering transfer limits, shortening a delegation, removing an agent permission, or adding a blocked address takes effect in the current signed transaction. - Loosening (
loosenTimelockSec: 86400). Raising limits, disabling inbox filtering, or adding a powerful delegation requires a public delay of at least 24 hours (86,400 seconds). During that window, the primary account can veto the change with a recovery key or passkey.
Wallet-side semantic clear signing through buildWalletClearSigningPreview, together with asset-change assertions in TransactionBlockPostConditions, adds an intent-and-outcome check. The user or agent can see what a transaction authorizes, while postconditions constrain the resulting asset changes.

5. The anti-Parity principle for external-chain vaults
Can the same passkey and AccountGuard policies protect assets held on Ethereum, Solana, or Bitcoin?
The implementation boundary matters here. Native passkeys (ROLE_PASSKEY = 22, strict_v2), the five-module AccountGuard, and the four-state InboundInbox are implemented and verified in @ocap/ledger-core. Extending that engine into a cross-chain control plane for external-chain vaults is the next architecture under design.
That design follows an anti-Parity principle: Zero Custom External Vault Contracts:
Do not write or deploy custom asset-custody smart contracts on external chains such as Ethereum or Solana.
Custom bridges and multisignature vault contracts have repeatedly become security failure points. Our design reuses established multisignature infrastructure on the destination chain: standard Safe on Ethereum, Squads v4 on Solana, and native Taproot OP_CHECKSIGADD + OP_CSV timelock scripts on Bitcoin. Each vault uses a 2-of-3 threshold:
- Key 1: the user. A hardware passkey, or an intent signature issued through the client light node.
- Key 2: the policy guardian. An
AccountGuardstate-machine cluster on the ArcBlock chain. Only after the withdrawal passes inbound and outbound limits, agent quotas, and the 24-hour delay does the guardian cluster cooperate through MPC/TSS to produce the second signing contribution. - Key 3: the sovereign recovery path. An offline hardware key held entirely by the user. In the Bitcoin Taproot branch, this path is bound to an
OP_CSVrelative timelock.
Under this design, routine activity uses the fine-grained AccountGuard policy engine; if the cross-chain control plane goes offline, the user can recover the assets directly through Key 1 + Key 3 on Ethereum Safe, Solana Squads, or Bitcoin. The unified policy layer retains an independently usable recovery path.

Security makes autonomous collaboration practical
Each major computing transition has required new isolation primitives: unprotected shared memory gave way to virtual address spaces and sandboxed permissions, followed by zero-trust gateways in cloud systems.
Blockchain accounts are now moving from records that humans update occasionally to operational accounts used continuously by people and hundreds of AI agents. A single unrestricted private key and unlimited contract approvals are too coarse for that workload.
By placing native hardware passkeys, a four-state quarantine inbox, a five-module declarative AccountGuard, and a one-way policy ratchet inside the ledger protocol, we make incoming and outgoing activity subject to explicit, verifiable constraints. People gain time to intervene, and agents gain a defined space in which they can act autonomously.