Contract e23893a7b25f551bf6b5c2b8615ede592ecf1356cfdabbcb63ce18c8cce44eb8

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.94.0

Instances

  • CD32576TIHJS5CPPB7TGLK2O5X6JENBZUWMPYXCVNWS62KAZCAZSASRD

Interface

Verify a WebAuthn authentication assertion against a Soroban auth payload hash.

Arguments

  • hash - The 32-byte Soroban auth payload hash. The client base64url-encodes this and embeds it as the challenge field in clientDataJSON.
  • key_data - Bytes containing a 65-byte uncompressed secp256r1 public key (0x04 prefix + 32-byte X + 32-byte Y) followed by an optional variable-length credential ID suffix. The credential ID is client-side metadata and is stripped by canonicalize_key.
  • sig_data - XDR-encoded WebAuthnSigData struct containing:
  • signature: 64-byte compact P-256 signature (r || s)
  • authenticator_data: raw authenticator data bytes (≥37 bytes)
  • client_data: raw clientDataJSON bytes

Returns

true if the assertion is valid. Panics on any verification failure.

fn verify(
    env: soroban_sdk::Env,
    hash: soroban_sdk::Bytes,
    key_data: soroban_sdk::Bytes,
    sig_data: soroban_sdk::Bytes,
) -> bool

Returns the canonical 65-byte public key, stripping any credential ID suffix.

Two registrations of the same P-256 key with different credential IDs must produce identical canonical output — this enables the smart account to detect and reject duplicate signers regardless of which device was used to register.

Panics with Error(Contract, #3119) if key_data is shorter than 65 bytes.

fn canonicalize_key(
    env: soroban_sdk::Env,
    key_data: soroban_sdk::Bytes,
) -> soroban_sdk::Bytes

Canonicalizes a batch of WebAuthn keys, preserving input order.

fn batch_canonicalize_key(
    env: soroban_sdk::Env,
    key_data: soroban_sdk::Vec,
) -> soroban_sdk::Vec

Imports

WebAssembly Text (WAT) ▶