Step by step create and broadcast a bitcoin transaction on Testnet
Mục lục bài viết
Step by step create and broadcast a bitcoin transaction on Testnet
As a developer I wanted to test my own HD wallet and I needed to test a bitcoin transaction on the test net.
If you like to know what is the HD wallet, you can read it from here: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
Anyway, If you need to create a wallet for test net you can get it from here:
https://bitcoinpaperwallet.com/bitcoinpaperwallet/generate-wallet.html?design=alt-testnet
Then you will see your wallet like this:
Now, we have an address, it is different for each person. I have a wallet with this address: mqVf2pW6KRT5xqDioGPpPznBuFFPA8kmCb
We need to get some bitcoin in our wallet. Use this site: https://bitcoinfaucet.uo1.net/
Or any other site that give faucet bitcoin, you can google it like this:
Put your address here and write amount of bitcoin that you want (up to 0.0022 BTC) and click on Send testnet bitcoins.
Done!
We can check the transaction.
Here is our transaction id. We can check it with id or with our address to get balance.
This is mine:
You can change the transaction id with yours:
You have to wait until at least 1 confirmation.
Now, go to this address:
https://testnet.smartbit.com.au/api
And find Transaction.
Click on it and go to Parameters tab:
Paste your transaction id here and click on Get.
In the response you will see something like this with a series of differences. Find in output section your address, we need it.
Now, we want to spend our bitcoin (AFTER Confirmed).
Go to here : https://nubits.com/cointoolkit/#newTransaction
click on Advanced option
Settings:
Change it to test net and then Save!
From here back to the New transaction page.
I want to send my all balance (0.00022000)
to 2NGZrVvZG92qGYqzTLjCAewvPZ7JE8S8VxE
Or any other address.
now change the tab and go to inputs tab
We need these items
1:
2:
Find your Address that you have bitcoin in it and we need it’s n. mine in this transaction is 0.
3:
4:
Here is final view:
We have 0.00022000 and we want to send 0.00021000 and 0.00001000 will be fee for this transaction.
Click on the Generate button and you will see :
click on the Continue to sign button:
paste your private key here from your wallet:
click on sign :
This is your transaction raw. This site can’t broadcast it, so we have to go here:
https://testnet.smartbit.com.au/txs/pushtx
paste here and click on PUSH TRANSACTION.
Done ^_^ you can check it with link
Also Read: Best Bitcoin Hardware Wallets