Skip to content
Logo

TIP-712

TIP-712 is TRON's typed-data signing format and reuses EIP-712 encoding. Enable it with the signer-tip712 feature (or full):

tronz = { version = "0.5", features = ["signer-tip712"] }

Use sign_typed_data for generated SolStruct values or sign_dynamic_typed_data for TronWeb-shaped JSON parsed as TypedData.

use tronz::{TronSigner, signers::TypedData};
 
let signature = signer.sign_dynamic_typed_data(&payload).await?;

TIP-712 address fields use the 20-byte EVM form, not a 21-byte/base58check TRON address. Returned signatures can be converted to legacy v values with to_legacy_bytes() for TronWeb interoperability.

See the runnable TIP-712 example and the TIP-712 specification.