Tempo subscription key-authorization wire codec and verifier.
The RLP layout and primitive signature envelopes match ox/tempo's
KeyAuthorization ([chainId, keyType, keyId, expiry, limits, calls, witness?, isAdmin?, account?]). Subscription verification requires the
TIP-1053 witness to be the 32-byte decoding of the issuing challenge
id and rejects TIP-1049 admin / account-bound keys.
Summary
Functions
Deserialize and cryptographically verify a signed primitive key authorization.
Decode the object returned by wallet_authorizeAccessKey.
Map a shared subscription period to Tempo's fixed elapsed seconds.
Serialize a key authorization as canonical RLP hex.
Return the decoded RLP field inserted into a Tempo transaction.
Verify that a signed authorization is exactly scoped to a subscription request.
Build the normative wallet_authorizeAccessKey parameter object.
Types
@type key_type() :: :secp256k1 | :p256 | :web_authn
@type t() :: %MPP.Methods.Tempo.KeyAuthorization{ account: String.t() | nil, chain_id: non_neg_integer(), expiry: pos_integer(), field: list(), is_admin: boolean(), key_id: String.t(), key_type: key_type(), limits: [map()], scopes: [map()], signature: binary(), source: String.t(), witness: binary() | nil }
Functions
Deserialize and cryptographically verify a signed primitive key authorization.
Decode the object returned by wallet_authorizeAccessKey.
@spec period_seconds(MPP.Intents.Subscription.t()) :: {:ok, pos_integer()} | {:error, String.t()}
Map a shared subscription period to Tempo's fixed elapsed seconds.
Serialize a key authorization as canonical RLP hex.
Return the decoded RLP field inserted into a Tempo transaction.
@spec verify(t(), MPP.Intents.Subscription.t(), keyword()) :: :ok | {:error, String.t()}
Verify that a signed authorization is exactly scoped to a subscription request.
@spec wallet_params(MPP.Intents.Subscription.t(), keyword()) :: {:ok, map()} | {:error, String.t()}
Build the normative wallet_authorizeAccessKey parameter object.