Hush accounts

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

PartWhat it isWho reads it
AvailableThe balance you can send or withdraw, as a ciphertextYou
Available, owner copyThe same number encrypted a second time with your AES key, so the app reads it at onceYou
PendingCredits that have arrived and that you haven't applied yet, as ciphertextsYou
Pending credit counterHow many credits are waiting in pendingAnyone
Encryption public keyThe key others encrypt to when they pay youAnyone
Owner and mintYour wallet address, and hSOL or hUSDCAnyone

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 showsThe account is
Not set up, with a Set up buttonNot created yet for this asset
Available 0, pending 0Set up and empty
Pending above 0, with ApplyHolding credits to apply
Available above 0Ready 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.