1.8 KiB
Send Transaction to Peer
You will send your first peer-to-peer transaction between two students.
Instructions
-
Create manually an address on Bitcoin testnet. You can use bitcoin-cli configured on testnet or any other wallet.
-
Get testnet Bitcoin from a faucet (see below).
-
Send a transaction of 0.00001337 bitcoins to another student.
-
Retrieve the main information from the transaction from a public API or a node (using for instance
bitcoin-cli gettransaction
). You might need to convert some fields depending on the API used. -
Store the following values in a variable
tx
in your solutionsend-transaction-to-peer.js
:- Transaction hash
txid
. - Transaction fee
fee
(in Bitcoins, negative integer). - Transaction amount
amount
(in Bitcoins, negative integer). - Transaction date `time.
- Transaction hash
The submitted transaction information needs to be related to a recent (no more than 48 h) transaction!
Expected file
sendTransactionToPeer.js
exports.tx = {
amount: -0.00001337,
fee: -0.00000003,
txid: '95952d9bf7542dfa0c98486495f1ae432a8738bbd7da051915d0aca1bec1f9',
time: 1789670282,
}
Congrats for your first real peer to peer Bitcoin transaction!
Utilities
- A fully open source Bitcoin wallet software electrum
In order to use it on the testnet you will need to launch it from the command line with the
--testnet
option - A full list of Bitcoin compatible wallets bitcoin wallets
- A Bitcoin explorer bitcoin testnet explorer
- A Bitcoin public API documentation esplora
- faucet 1
- faucet 2
- faucet 3