[ PACK LIBRARY / PAYMENTS & BLOCKCHAIN ]

TASKFREE SAMPLE

Sweep a legacy wallet's UTXOs into a new 1Sat wallet

STAFF UNO SATOJ · V0.1.0
1sat:sweep

REQUIRES

  • claude plugin install 1sat@b-open-io

WHEN TO REACH FOR THIS

You are migrating off an old wallet and want everything — plain BSV, ordinals, and BSV21 tokens — moved cleanly into a new BRC-100 wallet with nothing stranded. Done by hand, one mismatched key or asset type leaves dust or an inscription behind. This task runs 1sat:sweep so the migration is complete and auditable in one sitting.

REQUIRES

  • 1Sat plugin: claude plugin install 1sat@b-open-io
  • The source wallet's private key(s) in WIF format
  • A destination BRC-100 wallet (1sat:wallet-setup) + enough BSV to cover fees

CONTEXT INPUTS

{{SOURCE_WIFS}}         # One or more WIF keys controlling the legacy funds
{{DESTINATION_WALLET}}  # How the new BRC-100 wallet is instantiated (package + storage)
{{ASSET_SCOPE}}         # What to sweep: bsv | ordinals | tokens | all
{{DRY_RUN}}             # true to enumerate assets and estimate fees before broadcasting

THE PROMPT

PASTE INTO YOUR AGENT
You are Uno Satoj, migrating assets from a legacy wallet into a new BRC-100 wallet.

Load the `1sat:sweep` skill and follow it exactly. The external-sweep actions
take keys as PrivateKey[] (from @bsv/sdk), parallel to inputs - NOT WIF strings.
Convert each WIF first with PrivateKey.fromWif(...).

Setup:
1. Instantiate {{DESTINATION_WALLET}} → createContext(wallet, { services }). Convert
   each key in {{SOURCE_WIFS}} to a PrivateKey and derive its address.

Enumerate (always, even when DRY_RUN is false):
2. Discover the external UTXOs each key controls. Build the inputs array with
   prepareSweepInputs, then build a keys array of the same length parallel to it
   (one PrivateKey per input, e.g. inputs.map(() => key)); prepareSweepInputs builds
   only the inputs. Report a manifest: plain BSV sats, each ordinal (origin +
   content type), each BSV21 token id with amount.
   If {{DRY_RUN}} is true: print the manifest + estimated fee per sweep and STOP. Do
   not broadcast.

Sweep (only when DRY_RUN is false), scoped by {{ASSET_SCOPE}}:
3. Ordinals and tokens FIRST (sweepOrdinals, sweepBsv21) so inscriptions/token UTXOs
   are never spent as fee inputs; plain BSV LAST (sweepBsv). Each sweepBsv21 call
   takes inputs of a single tokenId, so group token UTXOs by tokenId and make one
   sweepBsv21 call per token. Capture each txid.

Verify:
4. Re-enumerate each source address and confirm it is empty (no ordinals/tokens,
   zero or dust-only BSV). List anything that did NOT move and why.

Negative prompts:
- Do NOT sweep plain BSV before ordinals/tokens - you can burn an inscription as fee.
- Do NOT pass WIF strings where PrivateKey[] is expected.
- Do NOT invent UTXOs or txids; report only what the wallet and services return.
- Do NOT skip the verification - "swept" means the source is proven empty.

EXPECTED OUTPUT

A migration manifest (BSV, ordinals, tokens on the source keys), the broadcast txids per sweep, and a verification pass showing the source is empty. On a dry run, the manifest plus fee estimates with nothing broadcast.

FOLLOW-UP CHAIN

  • pb-wallet-backup — Encrypt and back up the new wallet
  • pb-address-lookup — Reconcile the new wallet's balance on-chain
  • pb-custody-policy — Write a custody policy for the new wallet

← PACK CONTENTS