Import
Signature
Verify identity headers against timestamp skew and Algorand signature. First checks for the presence of the modern X-Identity-Txn header (if genesis_hash_b64 is provided). If absent or verification fails, falls back to inspecting the legacy x-sender-address, x-sender-timestamp, and x-sender-signature headers.

Parameters

Mapping[str, Any]
required
HTTP request headers mapping (case-insensitive inspection).
int
default:"120"
Maximum allowable clock skew in seconds between the timestamp and now.
int | None
default:"None"
Current unix timestamp in seconds. Defaults to int(time.time()).
str | None
default:"None"
Base64-encoded network genesis hash. Required to verify X-Identity-Txn.

Returns

str or None
The verified Algorand sender address if signature and skew checks pass, or None if invalid or missing headers. Never raises exceptions.

Examples

See also

  • verify_identity_txn: Specific verification for the X-Identity-Txn format.
  • sign_identity: Client-side helper for legacy identity headers.
Source: ai_economy_sdk/identity.py