Hush accounts
What a Hush account stores, and how available, pending and apply fit together.
A Hush account is a Token-2022 token account for hSOL or hUSDC, owned by your wallet, with the Confidential Transfer extension configured. You have one per asset. Setting one up registers the public half of your key on the account, so that others can encrypt amounts to you.
What it stores
| Part | What it is | Who reads it |
|---|---|---|
| Available | The balance you can send or withdraw, as a ciphertext | You |
| Available, owner copy | The same number encrypted a second time with your AES key, so the app reads it at once | You |
| Pending | Credits that have arrived and that you haven't applied yet, as ciphertexts | You |
| Pending credit counter | How many credits are waiting in pending | Anyone |
| Encryption public key | The key others encrypt to when they pay you | Anyone |
| Owner and mint | Your wallet address, and hSOL or hUSDC | Anyone |
Encryption explains the ciphertexts. Public view puts the two readings side by side.
Available
Available is what you spend. A send or a withdraw has to prove, without showing the number, that available covers the amount. That proof is made against one exact ciphertext, so available changes when you act on it: you send, you withdraw, or you apply.
Pending
Deposits and incoming sends land in pending. Someone paying you adds to pending and leaves available untouched, which is why a payment arriving in the middle of your own send can't invalidate the proof you just made.
Balances shows pending under available with an Apply button, and each credit's amount is in your activity.
Apply
Apply folds pending into available. It is one transaction signed by you, it costs no Hush fee, and it needs no proof, because adding two ciphertexts gives the ciphertext of the sum. The same transaction stores the new owner copy of available.
An account holds up to 65,536 credits in pending between applies. Applying sets the counter back to zero.
States in the app
| The app shows | The account is |
|---|---|
| Not set up, with a Set up button | Not created yet for this asset |
| Available 0, pending 0 | Set up and empty |
| Pending above 0, with Apply | Holding credits to apply |
| Available above 0 | Ready to send or withdraw |
While the app is locked, Balances shows each account as the chain does: ciphertexts, and the count of pending credits. Unlocking turns them into numbers.