Skip to content
CCPEDIAby Unity Nodes
App Development

Naust: A deposit address per customer, no memo

7 posts115 views1 likesLast activity 17d ago

CIPs mentionedCIP-0056
  1. jadonamiteOP

    Hi all,

    I’m building Naust for HackCanton Season 3, and I’d like feedback from people who run deposits on Canton.

    The problem it takes on came up in the thread Per-user deposit destination on a single party without a memo field: exchange withdrawals arrive from a pooled party that names nobody, the memo is the only clue, and every missed memo becomes a support case.

    Naust gives every customer their own Canton party as a deposit address. When a transfer lands on it, Naust:

    1. sees the incoming CIP-0056 transfer offer on the customer’s party,
    2. accepts it as that party,
    3. writes a DepositReceipt contract (signed by the business, observed by the customer’s party, so no other customer can see it),
    4. sweeps the holding to the treasury, and records the sweep on the receipt.

    Each step checks the ledger before acting, and commands carry IDs derived from the deposit, so a crash at any point resumes without crediting twice or skipping a step.

    It runs live on DevNet with real Canton Coin:

    Where I’d value your input:

    • If you take exchange deposits on Canton, would a party per customer work with your setup, or does the party count push you toward leased addresses from a pool?
    • On a validator you run, is allocating a party per customer at sign-up something you’d do, or would you want the addresses under a separate participant?
    • Anything in the accept-and-sweep flow you’d handle differently, for example the traffic cost of about six transactions per deposit?

    If anyone wants to try it beside their own node on TestNet, I’m glad to set that up. Replies here are perfect.

    Thanks,
    Jadon

  2. crisog
    • If you take exchange deposits on Canton, would a party per customer work with your setup, or does the party count push you toward leased addresses from a pool?

    Party per customer. Since Canton 3.6.1, on networks running protocol version 36, each new party no longer adds memory on your node.

    • On a validator you run, is allocating a party per customer at sign-up something you’d do, or would you want the addresses under a separate participant?

    The same validator is fine. Create the customer parties through the Ledger API.

    • Anything in the accept-and-sweep flow you’d handle differently, for example the traffic cost of about six transactions per deposit?

    Set up a preapproval on each customer address and on the treasury. Deposits then arrive without an accept step, and a deposit can’t bounce back to the exchange if Naust is down.

    Sweep on a schedule, many deposits at once, instead of one by one. Your node then sends nothing when a deposit arrives, and one transaction per customer when you sweep.

  3. jadonamite

    Thanks Crisog, this is the input I was after.

    Party per customer on the business’s own validator, created through the Ledger API, is how Naust already works, so good to hear 3.6.1 takes the memory cost out of it. Does that need the synchronizer on protocol version 36, or does a 3.6.1 participant get it on PV35 as well?

    Preapprovals and scheduled sweeps make the flow better, so I’m rebuilding around them:

    • Each customer address proposes a preapproval with the validator as provider, so the validator accepts and renews it. Deposits land as holdings, with no accept step and nothing to bounce back if Naust is offline.
    • Naust watches customer addresses for new holdings instead of transfer offers.
    • On a schedule, each customer with waiting deposits gets one transaction: the receipts are written and the holdings swept to treasury together.

    That takes a deposit from about six transactions to one per customer per sweep, however many deposits are waiting. I’ll post the measured numbers once it runs.

    Jadon

  4. crisog

    It needs the synchronizer on protocol version 36. On PV35, a 3.6.1 participant keeps running the old ACS commitment processor, which is where the per-party memory cost comes from, and the new one can’t send commitments below PV36. So the gain arrives when the synchronizer moves to PV36 (release note).

    Your preapproval setup matches what I tested on LocalNet: the validator accepted the proposal in about 20 seconds, renewed it for 90 days, and charged no CC. Naust only needs rights on the customer parties.

    I’d still watch for transfer offers too. If a preapproval lapses, or for tokens other than CC, deposits still arrive as offers.

    Since the customer parties are local, whoever controls your participant node controls every deposit, so secure it like a hot wallet.

  5. jadonamite 1

    Brilliant,
    That settles it, thanks. I’ll quote PV36 as the point where party count stops costing memory, and keep the offer path for lapsed preapprovals and other tokens.

    On the hot-wallet point: I’m splitting the treasury out as an external party with its own preapproval, so sweeps land on keys that never sit on the node, and sweeping often enough that customer addresses hold little at any time. Naust’s ledger user only gets act-as rights on the business and customer parties.

    I’ll post the LocalNet numbers when the batched sweep runs.

    Jadon

  6. joao_trakx

    Thanks for building this and for linking it back to our thread — it answers the exchange/custodian case I described there.

    Some feedback from an operator’s angle:

    • Party per customer vs leased pool: for us the party count is in the thousands, so a party per customer is fine, and a lease model would reintroduce the attribution ambiguity we are trying to remove (a deposit that lands after the lease expires). The pool only makes sense for exchanges with millions of occasional depositors.
    • Own validator: yes, we would allocate at sign-up on our own participant. Keeping the addresses under a separate participant adds operational surface without a clear benefit once PV36 removes the memory coupling.
    • Accept-and-sweep: six transactions per deposit is the part I would not take as is. If the business is the instrument admin, or can get the receiving party to create a transfer pre-approval, the offer/accept step disappears and the transfer lands directly. The sweep can be batched. The DepositReceipt as a ledger artifact is a nice touch, but for us the internal ledger is the source of truth and the chain is the projection, so we would keep the receipt off-chain.
    • One thing I’d check: the shared-key external party pattern (one key, many hints) suggested in the other thread. It would let the “treasury as external party” and the customer addresses all live under one managed key, which simplifies custody considerably.
  7. noahevans

    The shared-key external-party idea is worth testing, but I’d separate the signing policy from the party hints: one managed key across treasury and customer addresses makes a signing-policy mistake or key rotation affect every deposit address at once. If you try it, document which key and hint control which party and keep act-as rights scoped per customer, so the operational simplification doesn’t collapse the treasury/customer isolation you just gained. Also, if receipts stay off-chain, make the sweep transaction itself carry enough reference to reconcile it back to the internal ledger.