MPP.Methods.Tempo.Proof (mpp v0.6.2)

Copy Markdown View Source

EIP-712 proof credentials for zero-amount Tempo charge flows.

Wallet-bound MPP domain version 3: the signed account field binds the proof to a specific payer so it cannot be replayed against another wallet for the same challenge. Matches refs/mppx/src/tempo/internal/proof.ts.

Summary

Functions

Compute the EIP-712 signing digest (32-byte binary) for a proof credential.

Recover the authorized access-key signer when direct wallet verification fails.

Build the EIP-712 typed-data map for a Tempo proof credential.

Verify a proof signature recovers to expected_account.

Types

params()

@type params() :: %{
  account: String.t(),
  chain_id: non_neg_integer(),
  challenge_id: String.t(),
  realm: String.t()
}

Functions

hash(params)

@spec hash(params()) :: <<_::256>>

Compute the EIP-712 signing digest (32-byte binary) for a proof credential.

recover_authorized_proof_signer(params, signature_hex, source_address)

@spec recover_authorized_proof_signer(params(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, String.t()}

Recover the authorized access-key signer when direct wallet verification fails.

Matches recoverAuthorizedProofSigner in refs/mppx/src/tempo/server/Charge.ts. Returns {:ok, access_key_address} or {:error, reason}.

typed_data(map)

@spec typed_data(params()) :: Cartouche.Typed.t()

Build the EIP-712 typed-data map for a Tempo proof credential.

verify_signature(params, signature_hex, expected_account)

@spec verify_signature(params(), String.t(), String.t()) :: :ok | {:error, String.t()}

Verify a proof signature recovers to expected_account.

Returns :ok or {:error, reason}.