Skip to main content
Payy Network is an EVM-compatible network with a native stablecoin (PUSD). Because it’s EVM-compatible, you can use Privy’s React SDK to authenticate users, create embedded wallets, and sign or send transactions on Payy with minimal configuration. This recipe shows how to:
  • Configure Privy for the Payy Network testnet
  • Create an embedded wallet on Payy
  • Sign messages, typed data, and transactions
  • Send native PUSD transfers

Prerequisites

Install dependencies

Step 1: Define the Payy chain

Use viem’s defineChain to create a custom chain definition for Payy Network, then pass it to addRpcUrlOverrideToChain from @privy-io/chains so Privy routes requests through the Payy RPC endpoint.

Step 2: Configure PrivyProvider

Set Payy as the default and only supported chain in your PrivyProvider. This constrains embedded wallets to operate exclusively on Payy Network.
Setting supportedChains to only [payyTestnet] ensures Privy creates wallets targeting Payy by default. If your app supports multiple chains, add them to supportedChains alongside Payy.

Step 3: Authenticate users

Use usePrivy to handle authentication. Users must be authenticated before creating or using a Payy wallet.

Step 4: Create a Payy wallet

Because Payy is EVM-compatible, use Privy’s standard useCreateWallet hook. The wallet will target Payy Network based on your PrivyProvider configuration.

Step 5: Sign messages and transactions

All standard Privy signing hooks work on Payy. Pass the embedded wallet’s address to target it for signing.

Sign a message

Sign typed data

Send a transaction

Use useSendTransaction for standard EVM sends on Payy:

Step 6: Send PUSD with manual transaction control

For tighter control over nonce, gas, and broadcasting, sign and broadcast transactions manually through the embedded wallet’s Ethereum provider. This approach is useful when you need custom fee handling, RPC routing through your own backend, or explicit nonce management for PUSD transfers.
This example uses a fixed gas price of 1 gwei for both maxFeePerGas and maxPriorityFeePerGas. In production, query the network for current gas prices or implement dynamic fee estimation.

Step 7: Read PUSD balances

Query the Payy RPC endpoint directly for native PUSD balances:

Choosing a transaction method

Payy Network reference

Configuring EVM networks

Learn how to add custom chains to Privy

Reference implementation

Full example repo for Payy + Privy integration