Seedelf-Wallet

Chunk 9 plan: transfer (Seedelf → Seedelf)

Branch: web-wallet/transfer. It already exists: this plan is its first commit. It ends with a PR back into seedelf-web-wallet.

A transfer pays someone’s Seedelf from the Seedelf balance. It’s the CLI’s transfer, and the second Seedelf script spend after the stealth mint. Most of the machinery exists already:

This chunk is mostly a new kind of output (the recipient’s re-randomized register), a lookup, and a screen.

Start here (new session)

  1. Sync the branch:
    git checkout web-wallet/transfer && git pull
    git fetch origin && git merge origin/seedelf-web-wallet   # if it moved since
    git log --oneline HEAD..origin/main                       # merge main first if this lists anything
    
  2. Read:
  3. Read the code this chunk extracts and copies:
    • seedelf-cli/src/commands/transfer.rs: the CLI, still building inline.
    • seedelf-core/src/build.rs: ScriptSpend, select_script_inputs, and mint / mint_from, which are the template.
    • seedelf-core/src/utxos.rs: find_seedelf_datum and find_seedelf_utxo.
    • seedelf-web-wallet/wasm/src/lib.rs: draft_mint, finish_mint, sign_script_spend.
    • extension/src/background/mint.ts (buildStealth, submit) and extension/src/ui/screens/{CreateSeedelf,MoveIn}.tsx.
  4. If the user has the tx hash of chunk 8b’s live account-paid mint, record it in the roadmap first.
  5. The decisions are confirmed.

What transfer does today

seedelf-cli/src/commands/transfer.rs (about 500 lines) will become a thin run() around a builder.

  1. Arguments: one or more --seedelfs (token names, hex), --lovelaces per recipient, optional --asset per recipient, and optional --utxos to spend.
  2. Minimums: each recipient output needs wallet_minimum_lovelace_with_assets(tokens), about 1.46 ADA with no tokens.
  3. The recipient’s register: find_seedelf_datum(name, policy, every contract UTxO), the datum of the UTxO holding that Seedelf token, found in the same whole-contract scan the balance uses.
  4. Selection: utxos::select(params, owned, total lovelace, total tokens).
  5. Outputs:
    • For each recipient: register.rerandomize() (this refuses points outside the prime-order subgroup), at the contract with the lovelace and tokens.
    • Then change under the user’s own fresh registers, tokens 20 to an output.
  6. Script plumbing: as for the stealth mint, but only the wallet script (reference input, and 629 bytes × 15 of fee). There’s no mint.
  7. Budgets: the CLI zips them in answer order (extract_budgets), which is exactly what Budgets::from_ogmios fixes.
  8. Fee: the draft’s size fee on the old Byron formula, plus compute, plus the script reference, rounded to even. ScriptSpend::finalize replaces all of it.

Decisions

Confirmed with the user on 2026-09-24: every suggestion stands except paying your own Seedelf, which is allowed with a warning.

Decision Decided Notes
How the recipient is given Paste the full token name (5eed0e1f…, 64 hex characters). Show the tag it reads as, and whether it was found on chain. Tags aren’t unique: anyone can mint “alice”. A tag search, like the CLI’s util find, could come later, but it must always show the full name to pick.
Recipients per transfer One The CLI allows several. One keeps the form and review simple, and a second transfer is cheap.
What’s sent An ADA amount (the move-in AdaInput rules: 6 decimals, the supply cap, “more than you have”), plus optional tokens, each with an amount Unlike move-in, a token doesn’t move in full: people pay parts of a balance.
Paying your own Seedelf Allowed, with a warning (the plan suggested refusing) It moves money in a circle and costs a fee, but it’s the user’s call. The worker can tell (the recipient’s register isOwned), so the summary says toSelf and the form and review warn.
Max No Max in v1 “Everything” is what withdraw (chunk 10) is for.
Privacy nudges The round-amount nudge from move-in, plus one line: sending right after moving in is easy to match by timing See privacy.md Known links.

Work items

1. Core (seedelf-core/src/build.rs)

2. WebAssembly

3. Service worker

4. UI

5. Tests

6. Docs

Risks and things to check

Out of scope