TIP-1034 Tempo Channel Reserve voucher and EIP-712 signature verification.
The signed type is Voucher(bytes32 channelId,uint96 cumulativeAmount)
under the TIP20 Channel Reserve version 1 domain. Signatures are canonical
65-byte secp256k1 signatures, matching the contract-backed mppx voucher path.
Summary
Functions
Compute the 32-byte EIP-712 voucher signing digest.
Compute the voucher signing digest, raising ArgumentError on invalid input.
Create a validated signed voucher.
Create a signed voucher, raising ArgumentError on invalid input.
Build the EIP-712 typed data for a voucher.
Build voucher typed data, raising ArgumentError on invalid input.
Verify that a voucher signature recovers to the expected signer.
Types
@type t() :: %MPP.Session.Voucher{ channel_id: String.t(), cumulative_amount: non_neg_integer(), signature: String.t() }
Functions
@spec hash(t(), String.t(), non_neg_integer()) :: {:ok, <<_::256>>} | {:error, term()}
Compute the 32-byte EIP-712 voucher signing digest.
@spec hash!(t(), String.t(), non_neg_integer()) :: <<_::256>>
Compute the voucher signing digest, raising ArgumentError on invalid input.
Create a validated signed voucher.
Create a signed voucher, raising ArgumentError on invalid input.
@spec typed_data(t(), String.t(), non_neg_integer()) :: {:ok, Cartouche.Typed.t()} | {:error, term()}
Build the EIP-712 typed data for a voucher.
@spec typed_data!(t(), String.t(), non_neg_integer()) :: Cartouche.Typed.t()
Build voucher typed data, raising ArgumentError on invalid input.
@spec verify_signature(t(), String.t(), non_neg_integer(), String.t()) :: :ok | {:error, term()}
Verify that a voucher signature recovers to the expected signer.