Guides

Deposit and withdraw a private balance

Set up a private balance with one signature, deposit a mint into it, and withdraw to any public account.

A private balance is where remits are opened from and where payees are paid. This guide sets one up, puts money in and takes money out. It is the same for an owner and for a payee.

You need a Solana wallet with the mint you want to deposit and a little SOL for transaction fees.

Set up a private balance

  1. Connect a wallet

    Open the app and press Connect, then the wallet's name.

  2. Derive your private keys

    Press Sign to derive the keys and approve the message in the wallet. The wallet signs one fixed message, and the keys that read and spend your private balance come from that signature. No transaction is sent and nothing moves.

    The app keeps the signature in the tab and asks again in a new one. Disconnect and forget the keys in the wallet menu drops it at once.

  3. Register

    Press Register and approve the transaction. It records your public viewing key, so that others can pay your private address knowing only your wallet address.

The wallet now has a private address. Anyone can see that it registered. Nothing else about it is public.

Deposit

  1. Open Balance

    Go to Balance. Deposit is selected.

  2. Enter the amount

    Type the amount in Amount. If the app offers more than one mint, pick it under Mint first.

  3. Read what the chain will show

    The panel lists it before you sign: that your wallet deposited, the mint, and the amount.

  4. Press Deposit

    Approve the transaction in the wallet. The line under the button moves through Building, Signing, Sending and Confirmed, and ends with the transaction's signature, which copies on a click.

The Private balance panel now shows the amount. From here on it moves encrypted: opening a remit from it, a payee being paid into it and a refund returning to it show no amount to anyone else.

Withdraw

  1. Switch to Withdraw

    On Balance, press Withdraw.

  2. Enter the amount and the destination

    Amount shows how much is available. Destination is the public account that receives it, filled in with your connected wallet. Replace it to pay out somewhere else.

  3. Press Withdraw

    Approve the transaction. The chain shows that your private address withdrew, the mint, the amount and the destination account.

What can stop it

MessageWhat to do
"The signature was declined. Nothing was derived."Press Sign to derive the keys again and approve.
"This wallet cannot sign messages, which deriving the private keys needs."Use a wallet that signs messages.
"The transaction was not signed. Nothing was sent."Press the button again and approve in the wallet.
"The private balance holds … "The amount is more than the balance. Enter less.
"Enter a Solana address."The destination is not a valid address.

With the SDK

A server that holds its own key does the same three things in code:

TypeScript
import { createOwner } from '@remit/sdk'

const me = createOwner({ keys: process.env.OWNER_SECRET_KEY! })

await me.register()
await me.deposit({ mint: process.env.MINT!, amount: '20000000' })
console.log(await me.balances())
await me.withdraw({ mint: process.env.MINT!, amount: '5000000', destination: '<a public account>' })

Amounts are in base units of the mint: '20000000' is 20 USDC.

Loading the index