Skip to main content

Module sign

Module sign 

Source
Expand description

Signing primitives: keccak, msgpack, EIP-712, L1 actions and user-signed actions.

Re-exports§

pub use eip712::Domain;
pub use eip712::Field;
pub use eip712::TypedStruct;
pub use eip712::digest;
pub use eip712::digest_of_wallet_json;
pub use keccak::keccak256;
pub use l1::L1Action;
pub use l1::connection_id;
pub use l1::l1_digest;
pub use l1::phantom_agent;
pub use msgpack::Map;
pub use msgpack::Value;
pub use user_signed::NonceKey;
pub use user_signed::UserAction;
pub use user_signed::UserSigned;

Modules§

eip712
EIP-712 for the flat structs Hyperliquid signs, and HyperEVM contracts that take the same kind (one level, uint256[] the only array): hashing, and the typed data a browser wallet’s eth_signTypedData_v4 is handed.
keccak
Keccak-256, the Ethereum hash: pad byte 0x01, not SHA3’s 0x06.
l1
L1 actions: msgpack, hashed into a connection id, signed as a phantom agent Agent{source, connectionId} under Exchange/1/1337/0x0. The source is "a" on mainnet and "b" on testnet; the hash has no network.
msgpack
Msgpack as the venue hashes an L1 action: map keys in insertion order, never sorted, and a non-negative integer always unsigned.
user_signed
User-signed actions: EIP-712 typed data signed by the account’s own wallet (never an agent) under HyperliquidSignTransaction/1/<chain>/0x0, the chain being the network’s signature chain (42161 on mainnet, 421614 on testnet).