Skip to content

feat!: release 0.6.0 — spec 16 relay fee claim, memo_hash and v2 reci… - #5

Merged
nol4lej merged 1 commit into
mainfrom
feat/spec16-clients
Sep 28, 2026
Merged

nol4lej merged 1 commit into
mainfrom
feat/spec16-clients

Conversation

@nol4lej

@nol4lej nol4lej commented Sep 28, 2026

Copy link
Copy Markdown
Member

Summary

Releases @orbinum/protocol 0.6.0 for runtime spec 16 and @orbinum/circuits 0.15.0:

  • the public relay fee claim;
  • memo_hash and the v2 recipient binding for the memo-bound circuits;
  • pool rejection codes;
  • extrinsic and event models brought up to date with the pallets.

Every compatibility shim is removed: consumers moving to 0.6.0 update to the current API instead of carrying legacy paths.

Breaking:

  • removed: claimShieldedFees, CircuitId.ValueProof, RECOVERED_TX_RESULT, evmAddressToAccountId, and the fabricated zk-verifier fields;
  • addressToFieldElement now requires the circuit version;
  • CURRENT_CIRCUIT_VERSION is 2.

What changed

Circuits v2

  • memoHash(memos): the memo_hash public input. It is blake2_256 over the SCALE-encoded memo list, read little-endian, mod BN254 r.
    • Transfer hashes its two output memos in order.
    • Unshield hashes a list holding its change memo (one empty memo for a total unshield).
  • addressToFieldElement(address, circuitVersion):
    • v2 binds the recipient as blake2_256(accountId32) LE mod r. v1's raw mod r let an alias R ± r redirect a pending unshield.
    • The version is required; anything other than 1 or 2 throws.
  • CURRENT_CIRCUIT_VERSION = 2: new notes are v2, and v1 notes spend under v2.
  • The memo and recipient cross-repo vectors match the node (statement.rs, encoding.rs).

Relay fees (spec 16)

  • ShieldedPoolModule.claimRelayFees (claim_relay_fees) and ShieldedPoolPrecompile.claimRelayFees / buildClaimRelayFeesCalldata / estimateClaimRelayFeesGas (0x2a3274dd). The claim is public, with no note or proof.
  • Both paths share one parameter check (shielded-pool/validation.ts): assetId a u32 and amount in 1..2^128-1.
  • SP_SEL.COMMIT_RELAY (0xc9b235ff) and SP_SEL.CLAIM_RELAY_FEES, with decoders.
  • Types: CommitRelayArgs / ClaimRelayFeesArgs in ShieldedPoolCall, and RelayFeesClaimedEvent in ShieldedPoolEvent.

Errors

  • extractPoolRejection / poolRejectionKind: pool-admission codes 1–4 and 10–13 (matching validate_unsigned/codes.rs), plus Stale / Payment. classifyChainError falls back to them.
  • New pallet error names: RelayerNotRegistered, NotRegistered, TooManyCommits.

Mappers

  • mapExtrinsicArgs now covers spec 16:
    • private_transfer / unshield with fee, change note and circuit_version;
    • commit_relay and claim_relay_fees;
    • zk-verifier retire_version / unretire_version / purge_circuit.
  • mapZkEventData now covers Unshielded's change note, TreeSealed, RelayFeesClaimed, VersionRetired / VersionUnretired, CircuitPurged and BatchVerificationKeysRegistered.
  • Fixed: the mapper keys on the method name alone, and its deposit / withdraw aliases for shielded events swallowed balances.Deposit / Withdraw (fee refunds and withdrawals) with the wrong fields.

Removed

  • claimShieldedFees: builders, the 0x88d9deba selector and its decoder. The call was never used on-chain.
  • 'shieldBatch' from PrecompileMethod: the precompile has no such selector.
  • CircuitId.ValueProof (6). CircuitId is now { Transfer: 1, Unshield: 2 }, in its own module.
  • Unexported, stale zk-verifier call and event types.
  • ZkVerifierCircuitVersionInfo.proofSystem / historicalVersions and ZkVerifierVkHash.stats: the RPC returns none of them.
  • RECOVERED_TX_RESULT: use recoveredTxResult(txHash).
  • evmAddressToAccountId: Ethereum prefix padding, which does not match the runtime.
  • Mapper aliases and alternate field names the chain does not use.

Test plan

  • npm run check (typecheck, lint, format, build, test): 868 passing
    • new: ZkVerifierModule, the shared claim validation, ShieldedPoolModule.claimRelayFees, the spec-16 mapper calls and events, the balances Deposit / Withdraw regression, recipient version guards, retired circuit ids
  • Cross-repo vectors checked against the node (memo digest, v2 recipient, pool rejection codes)
  • Node repo e2e-memo-clients-live.cjs against this dist/ on a dev node: 32/32, including memoHash against the node formula

@nol4lej
nol4lej merged commit 3022848 into main Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant