Skip to content
create-bsv-app
9 / 9

Your first testnet payment

Everything so far was signatures: free, and nothing on the blockchain. A payment is a transaction: your wallet builds it, the user approves it, and it's broadcast to the network. This lesson uses testnet, where coins are free and worthless.

The tutorial wallet can't do this: it has no coins and never broadcasts. You need a real one.

Before you start#

  1. Install BSV Browser (opens in a new tab) and switch it to testnet.
  2. Get test coins from the BSV Faucet (opens in a new tab): sign in, paste a testnet receive address from your wallet, and request some. Up to 10 million satoshis a day.
  3. Under the preview, switch the wallet to Your wallet. The preview now talks to your real wallet, exactly as a scaffolded app on your machine would.

Your task#

In client/src/pay.ts, ask the wallet to create the transaction:

ts
const { txid } = await wallet.createAction({
  description: 'Tip the author',
  outputs: [{
    lockingScript: new P2PKH().lock(address).toHex(),
    satoshis,
    outputDescription: 'Tip for the author'
  }]
})
return txid

Then connect, paste a testnet address (a second address of your own is fine) and Pay. Approve it in your wallet. The app shows the transaction ID, linked to a block explorer.

Your task

  • Send a testnet payment and get a transaction ID back