SignatureEnvelope
Signature envelope utilities for secp256k1, P256, WebAuthn, and keychain signatures.
Tempo transactions support multiple signature types: secp256k1 (65 bytes), P256 for passkeys
(type 0x01), WebAuthn (type 0x02), and Keychain for access keys (type 0x03).
Examples
import { Secp256k1 } from 'ox'
import { SignatureEnvelope } from 'ox/tempo'
const privateKey = Secp256k1.randomPrivateKey()
const signature = Secp256k1.sign({ payload: '0xdeadbeef', privateKey })
const envelope = SignatureEnvelope.from(signature)Functions
| Name | Description |
|---|---|
SignatureEnvelope.assert | Asserts that a SignatureEnvelope.SignatureEnvelope is valid. |
SignatureEnvelope.deserialize | Deserializes a hex-encoded signature envelope into a typed signature object. |
SignatureEnvelope.from | Coerces a value to a signature envelope. |
SignatureEnvelope.fromRpc | Converts an RPC-formatted signature envelope to a typed signature envelope. |
SignatureEnvelope.getType | Determines the signature type of an envelope. |
SignatureEnvelope.serialize | Serializes a signature envelope to a hex-encoded string. |
SignatureEnvelope.toRpc | Converts a signature envelope to RPC format. |
SignatureEnvelope.validate | Validates a signature envelope. Returns true if the envelope is valid, false otherwise. |
Errors
| Name | Description |
|---|---|
SignatureEnvelope.CoercionError | Error thrown when a signature envelope cannot be coerced to a valid type. |
SignatureEnvelope.InvalidSerializedError | Error thrown when a serialized signature envelope cannot be deserialized. |
SignatureEnvelope.MissingPropertiesError | Error thrown when a signature envelope is missing required properties. |
Types
| Name | Description |
|---|---|
SignatureEnvelope.GetType | Statically determines the signature type of an envelope at compile time. |
SignatureEnvelope.Keychain | |
SignatureEnvelope.KeychainRpc | |
SignatureEnvelope.P256 | |
SignatureEnvelope.P256Rpc | |
SignatureEnvelope.Secp256k1 | |
SignatureEnvelope.Secp256k1Flat | |
SignatureEnvelope.Secp256k1Rpc | |
SignatureEnvelope.Serialized | Hex-encoded serialized signature envelope. |
SignatureEnvelope.SignatureEnvelope | Represents a signature envelope that can contain different signature types. |
SignatureEnvelope.SignatureEnvelopeRpc | RPC-formatted signature envelope. |
SignatureEnvelope.Type | Union type of supported signature types. |
SignatureEnvelope.WebAuthn | |
SignatureEnvelope.WebAuthnRpc |

