Generate a P2PKH address and a QR barcode to make basic transactions on the Bitcoin blockchain network.

Using Bitcoin Mainnet...

Generate the keys

Use GenerateAsymmetricKeyPair to create a Bitcoin key pair to be used for sending and receiving bitcoin:

Encode the keys

Use BlockchainKeyEncode to derive a unique new Bitcoin address from the public key:

  • The address is a representation of the public key.

Create QR code

Use BarcodeImage to create a QR code associated with this Bitcoin address:

Send QR code

Use SendMessage to send the address and QR code to your mobile device:

  • If this is the first time you are sending a message, you will need to add a phone number to your Wolfram Account. Verify the phone number, then rerun SendMessage.

Save the private key

Use Export to save the private keys to a .wl file for later use:

  • The private key proves you are the owner of the bitcoins you want to send and lets you unlock unspent bitcoins you have in the blockchain at a later time.

Using Bitcoin Testnet...

Generate the keys

Use GenerateAsymmetricKeyPair to create a Bitcoin key pair to be used for sending and receiving bitcoin:

Encode the keys

Use BlockchainKeyEncode to derive a unique new Bitcoin address from this public key:

  • The address is a representation of the public key.

Create QR code

Use BarcodeImage to create a QR code associated with this Bitcoin address:

Send QR code

Use SendMessage to send the address and QR code to your mobile device:

  • If this is the first time you are sending a message, you will need to add a phone number to your Wolfram Account. Verify the phone number, then rerun SendMessage.

Save the private key

Use Export to save the private keys to a .wl file for later use:

  • The private key proves you are the owner of the bitcoins you want to send and lets you unlock unspent bitcoins you have in the blockchain at a later time.

Notes

For this workflow to be useful, you need to have existing bitcoin in your wallet.