pen-to-squaresign_seismic_tx_eip712

Sign and serialize TxSeismic using EIP-712 hashing

Sign and serialize a Seismic transaction using EIP-712 typed data hashing. This is the primary signing function for message_version == 2 transactions.

Signature

def sign_seismic_tx_eip712(
    tx: UnsignedSeismicTx,
    private_key: PrivateKey,
) -> HexBytes

Parameters

Parameter
Type
Required
Description

tx

Yes

The unsigned Seismic transaction (should have message_version == 2)

private_key

Yes

32-byte secp256k1 private key

Returns

Type
Description

HexBytes

Full signed transaction bytes (0x4a prefix + RLP) ready for eth_sendRawTransaction

Steps

  1. Sign with eth_keys.PrivateKey.sign_msg_hash()

  2. Serialize with serialize_signed(tx, sig) — same RLP as raw signing

The RLP serialization is identical to raw signing mode; only the ECDSA message hash differs. The Seismic node checks message_version to determine which verification path to use.

EIP-712 vs raw signing

Aspect

EIP-712 (message_version=2)

Raw (message_version=0)

Signing hash

Structured EIP-712 hash

RLP hash of unsigned tx

Wallet support

Better UX (structured display)

Generic message signing

RLP output

Identical

Identical

Verification

Node uses EIP-712 path

Node uses raw path

Example

Warnings

  • The function does not enforce message_version == 2; callers should set it appropriately

  • Ensure expires_at_block hasn't passed before broadcasting

See Also

Last updated