Skip to main content
Generate a shielded payment address locally from an incoming viewing key (ivk) and a diversifier (d). TRON nodes typically do not expose an RPC for this; derive on the client using a Sapling library and then use the address to receive shielded TRC20 payments.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Inputs

  • ivk — incoming viewing key as a 32‑byte (64‑hex) string, no 0x prefix.
  • d — diversifier as 11 bytes (22 hex), no 0x prefix.

Outputs

  • pkd — payment address public key in hexadecimal format (no 0x).
  • payment_address — the complete shielded payment address.

Use case

The wallet/getshieldedpaymentaddress method is used for:
  • Generating shielded addresses to receive private TRC20 payments
  • Creating diversified payment addresses from viewing keys and diversifiers
  • Supporting wallet implementations that need to generate receiving addresses
  • Enabling privacy-preserving transaction receiving capabilities

How it works (Sapling)

  1. Parse ivk (32 bytes) and d (11 bytes) from hex.
  2. Compute g_d = diversifyHash(d) (Jubjub point derived from the diversifier).
  3. Compute pkd = ivk · g_d (scalar multiplication on Jubjub).
  4. Encode (d, pkd) into a TRON Sapling payment address (Bech32 with HRP ztron).
Use a Sapling implementation (Rust/WASM or native). Do not implement the primitives yourself.

Example (JavaScript, WASM Sapling)

Example (Python, Rust FFI/WASM)

  • Exact lengths: ivk = 64 hex (32 bytes), d = 22 hex (11 bytes). No 0x prefix.
  • Use a maintained Sapling library (Rust → WASM/FFI). The node does not provide this derivation.
Last modified on June 22, 2026