moth

Token3 min read

How a withdrawal reaches your wallet

Credit you can withdraw leaves your balance as a request, joins one daily batch on Robinhood Chain and arrives in your own wallet as USDG when you sign once.

Share on X

Key points

  • Holder Credit and USDG top-ups you have not spent can be withdrawn as USDG on Robinhood Chain, from $5 at a time.
  • A request leaves your balance at once, can be cancelled until the day's batch, and reads Ready to claim within a day.
  • Each batch moves the day's USDG into the claims contract and posts one fingerprint of every claim in it.
  • You claim with one signature from the wallet you signed in with, and the contract pays only that wallet, never more than the batch holds.

What can leave your balance

Your Moth balance pays for every model, in Moth Chat or with a moth_ key. Since 30 November part of it can also leave as USDG, the dollar token on Robinhood Chain, to the wallet you sign in with.

  • Can be withdrawn

    Holder Credit, and USDG top-ups you have not spent.

  • Stays as credit

    Promo credit, $MOTH top-ups and credit from Moth. Spending uses these first, so what you can withdraw lasts as long as possible.

  • The least you can ask for

    $5 at a time.

The Holder Credit page in Moth Console shows the amount you can withdraw, and the Credit page now has a Withdraw as USDG button beside Add credit that opens it.

The balance that pays for your prompts can now also come home as USDG.

Requested: the amount leaves your balance

Pick an amount and confirm. It leaves your balance at once and the request reads Requested, so the same dollars can never be spent on a model and withdrawn as well.

Until the day's batch you can change your mind. Cancel puts the whole amount back on your balance, and nothing has touched the chain yet.

The daily batch

Once a day Moth gathers every request into one batch and settles it on Robinhood Chain in two transactions.

The balance card in Moth Chat. Under the balance, a Holder Credit line with its amount, and the words: added to your balance by itself, every hour.
The balance in Moth Chat. Holder Credit sits under it, added by itself every hour.
  1. Fund

    The day's USDG moves into the claims contract, a public contract that holds only USDG and does nothing but pay claims.

  2. Fingerprint

    Moth posts one root to the contract, a single fingerprint that covers every wallet's running total of what it may claim. Each wallet's line is a leaf under that root.

  3. Ready

    Once both transactions are final on the chain, every request in the batch reads Ready to claim in Moth Console.

Totals only ever grow. A wallet's leaf says how much it may claim in all, since its first withdrawal, and the contract remembers how much it has already paid that wallet, so a new batch adds to what is owed and never rewrites an earlier amount.

One root on chain stands for every claim in the batch.

Claim: one signature, your own wallet

Press Claim and sign once from the wallet you signed in with. Your wallet sends the transaction itself, so it needs a little ETH on Robinhood Chain for gas, and the USDG lands in that wallet when the transaction is in.

The claims contract checks three things before it pays a cent.

  • Whose leaf it is

    The proof must lead from a leaf holding the sender's own address to the posted root. Another wallet cannot claim your line, even with your proof in hand.

  • What is still owed

    It pays your running total minus what it has already paid you, and refuses when nothing is left.

  • What the batch holds

    It never pays out more than the batches have put in, so one claim can't reach into another's dollars.

MothHolderClaims.sol, the claimsolidity
function claim(uint256 cumulative, bytes32[] calldata proof)
    external nonReentrant returns (uint256 paid) {
    if (paused) revert Paused();
    if (!_verify(proof, leaf(msg.sender, cumulative))) revert BadProof();
    uint256 before = claimed[msg.sender];
    if (cumulative <= before) revert NothingToClaim();
    paid = cumulative - before;
    if (totalClaimed + paid > cumulativeTotal) revert Underfunded();
    claimed[msg.sender] = cumulative;
    totalClaimed += paid;
    _transfer(msg.sender, paid);
}

Check every step yourself

Nothing about a withdrawal needs to be taken on trust. The claims contract's page on the explorer lists every batch's root and every claim paid, each as a transaction anyone can open without an account.

Moth Stats shows how much has been withdrawn as USDG in all and how much of it was Holder Credit, as totals with no wallet behind them.

What you withdraw is between your wallet and the contract. What you spend stays private as always: every request through Moth leaves with your IP address, device, key and wallet taken off, and Moth keeps no prompt and no reply.

Read further

Try Moth

Open Moth Chat in your browser, or get a key and point the SDK you already use at the Mothpoint.