/** * WalletProvisioned gossip codec — wire-byte-identical to the Rust * `WalletProvisionedGossip` struct in `agent-node/src/network/topics.rs` * and the mobile codec in `mobile/src/lib/wire-protocol.ts`. * * Per-wallet DKG completion attestation. Each agent that wrote a share + * metadata to disk publishes one of these immediately after finalize. * Every other agent counts unique attestations into * `protocol::wallet_provisioning_attestations`. `/sign` rejects until the * count equals `expected_committee_size` AND every reported scheme is * identical — eliminates silent committee degradation. * * Rust struct (bincode v1, little-endian, fixed-int): * * pub struct WalletProvisionedGossip { * pub signature_65: Vec, // u64 LE len + bytes * pub publisher_address: String, // u64 LE len + utf8 bytes * pub wallet_id: String, * pub agent_peer_id: String, * pub scheme: String, // "dkls23" | "frost-secp256k1" | ... * pub group_pk_hash: [u8; 32], // RAW 32 bytes (NO length prefix — * // bincode encodes fixed arrays * // as their inner bytes inline) * pub timestamp: u64, // u64 LE seconds since epoch * } * * Publish topic: `sequence0/wallet-provisioned/v1` * * Digest covered by the EIP-191 signature (mirrors * `wallet_provisioned_digest` in `topics.rs`): * * SHA256( "Sequence0WalletProvisioned\n" * || wallet_id_utf8 || "\n" * || agent_peer_id_utf8 || "\n" * || scheme_utf8 || "\n" * || group_pk_hash[32] || "\n" // 32 raw bytes then one "\n" * || timestamp.to_be_bytes() ) // big-endian u64 * * The signer EIP-191 prefixes the digest: * keccak256("\x19Ethereum Signed Message:\n32" || digest) * then ECDSA-signs with the operator owner key. `v = recid + 27` → * 65-byte signature. Verifier recovers to `publisher_address` (lowercase * EVM address compare). */ export interface WalletProvisionedGossip { /** 65-byte secp256k1 signature (r || s || v with v ∈ {27, 28}). */ signature65: Uint8Array; /** EVM address (0x-prefixed) the signer claims to control. */ publisherAddress: string; walletId: string; /** libp2p peer-id (base58btc) of the attesting agent / mobile peer. */ agentPeerId: string; /** "dkls23" | "frost-secp256k1" | "frost-ed25519" | "cggmp21". */ scheme: string; /** keccak256(compressed group public key) — 32 raw bytes. */ groupPkHash: Uint8Array; /** Unix seconds — Rust replay window is `now-600s` .. `now+60s`. */ timestamp: number; } export declare function encodeWalletProvisionedGossip(env: WalletProvisionedGossip): Uint8Array; export declare function decodeWalletProvisionedGossip(bytes: Uint8Array): WalletProvisionedGossip; /** * Compute the WalletProvisioned digest. Mirrors `wallet_provisioned_digest` * in `agent-node/src/network/topics.rs` byte-for-byte (SHA-256 over the * domain-tagged concatenation). Returns 32 raw bytes. * * `@noble/hashes` is an optional peer dependency — install it to use this * helper. The mobile + agent layers already depend on it. */ export declare function walletProvisionedDigest(walletId: string, agentPeerId: string, scheme: string, groupPkHash: Uint8Array, timestamp: number): Uint8Array; /** WalletProvisioned gossip topic — must match Rust `Topics::WALLET_PROVISIONED`. */ export declare const TOPIC_WALLET_PROVISIONED = "sequence0/wallet-provisioned/v1"; //# sourceMappingURL=wallet-provisioned-gossip.d.ts.map