This guide covers integration with chains that have Tier 2 support. For a complete list of supported chains, refer to the chains overview.

To integrate Privy with chains that have Tier 2 support (e.g., Sui, Tron), follow these steps:

  1. Create a wallet with the appropriate chain type specified.
  2. Utilize Privy’s “raw sign” functionality to sign transaction hashes or message hashes.

Implementation Examples

Note that the “raw sign” functionality signs the provided hash directly without any additional byte manipulation. Ensure that your hash includes any required prefixes or suffixes before signing.

Stellar

Stellar implements the EdDSA signing algorithm using the ed25519 curve. The following example demonstrates hash signing for Stellar transactions:

Cosmos

Cosmos utilizes the ECDSA signing algorithm with the secp256k1 curve. Below is an implementation example for signing hashes on Cosmos:

Sui

Sui supports multiple cryptographic schemes, with Privy’s implementation utilizing the ed25519 curve and EdDSA signing algorithm. The following example demonstrates transaction signing for Sui:

Tron

Tron implements the ECDSA signing algorithm using the secp256k1 curve. Privy’s implementation returns 64-byte ECDSA signatures (r || s), while Tron requires 65-byte signatures that include a recovery ID (v) as the final byte.

The recovery ID is essential because a 64-byte signature could correspond to two different addresses/private keys. The 65th byte, which can be either 0x1b or 0x1c (derived from 0 or 1 plus 27, following Ethereum standards), resolves this ambiguity.

The following example demonstrates message signing and verification for Tron: