Tuesday, 19 December 2017

Bitcoin Transaction 101: PART 1

Bitcoin is all the rage these days, but lets face it, at the current rates most of us will probably never have the opportunity to own Bitcoins and learn how these transactions work.

But fret not! You can still learn how Bitcoin transactions work via our Demo Framework. On this article, I'll guide you through from signing-up and performing your first Bitcoin transaction!

Getting Your Demo Account

Step 1: Get a free demo account. Click here to sign-up 

Step 2: An email will be sent to your registered email address with your username and password, and a link to the login page.

Step 3: To login, you will need to key in your Account Id, Username and Password

Step 4: The system will prompt you to change your password if this is your first time logging in

Setting Up Your Bitcoin Wallet

* Please note: Our Bitcoin Wallet resides on Bitcoin's TestNet. Bitcoins that you receive and send from this wallet only works on the TestNet and has no actual value on the real world.

Once logged in, you should see this page. 

This is the home page. There are a few other demo functionalities available on our framework, but let's focus on the 'Bitcoin Wallet Demo' for now... Click on the 'Bitcoin Wallet Demo' button.

You will now be routed to to the Bitcoin Wallet demo page

Step 1: Click on the 'View Wallet' to go to your Wallet 
Step 2: Click on the 'Create New Wallet' button to create a new Bitcoin Address
Once the system has completed generating your Bitcoin address you should see it appear on your screen and it will look something like this:

Side Note: Generation of Bitcoin addresses is a whole topic onto itself. I talked about it a little bit on an older article. 

You are now ready to receive some Bitcoins.... but wait... you don't know anyone that's willing to give you their Bitcoins? Luckily we are on the TestNet. There are a few good souls that have setup 'faucets' for you to get TestNet Bitcoins from. 

Faucets are FREE TestNet Bitcoins that you can apply for in order to test out Bitcoin transactions. Now before we do anything else, highlight your Bitcoin address, you know the funny long number as shown in the image:

Copy the address by pressing CTRL-C, we will use it on the faucet page later.

Now click on this link to open a faucet page: https://testnet.manu.backend.hamburg/faucet
(Note: There are many faucets available, so you can use whichever one you are familiar with)

Once the faucet page loads, paste your address into the textbox and click on 'Give me some coins'. Don't forget to verify yourself via the Recaptcha function, everyone is afraid of bots these days.

The TestNet will now begin to mine your Bitcoin and the transfer should be reflected in your wallet within the next few minutes. (The TestNet performance is much slower than Bitcoin's live environment so you might have to wait a bit).

A transaction id should appear from the faucet page. Note the id generated by the faucet.

This id is the number of the transaction generated by the Blockchain which records the transfer of Bitcoins from the faucet owner to your address. We will get back to this id later.

Go back to your wallet page and click on F5 to refresh the page.

Whoa we got 2.2 BTC! (BTC - Bitcoin's unit of measure just like USD is to US Dollar). Results might differ from each application, you might get a lot more or a little less depending on the faucet you choose. Notice the transaction id also appears. This transaction id should be the same from the one recorded on the faucet's page. This transaction id is the actual transaction that records the transfer of ownership of 2.2 BTC from the faucet's address to yours.

The Bitcoin Transaction

In Bitcoin transactions, the addresses that you create are actually containers for a transfer of value. They do not actually 'store' your Bitcoins in a 'wallet' in the traditional sense of the word. When a person sends you his BTC he is actually making a transfer of ownership transaction in the Bitcoin's Blockchain from his address (or a combination of addresses) to your address.

Maybe a graphical representation will help:

Alice and Bob are the Blockchain's permanent residents. You will see them everywhere.

In the image above, Alice transfers ownership of 6 BTC to Bob. Like I mentioned before; because the Blockchain is a ledger of transactions, your wallet address does not actually store any value or any total amounts of BTC that you 'own'. Alice does not have enough BTC from one transaction to complete the transfer, she has to 'collect' BTC from one or more transactions attributed to her address in order to transfer 6 BTC to Bob (don't worry this is done automatically by the wallet software).

But what happens to the remaining amounts? The 2 BTC remaining will be attributed back to Alice in the new transaction id generated by the Blockchain.

Ok, lets go back to our transaction:

Click on the transaction id from our wallet:

The new page that appears is actually the transaction record. A Bitcoin transaction has a lot of properties, in our demo, we display only a few of the available properties. We will study the Bitcoin transaction properties in a later post, but for now scroll down the page until you see the the input and output portion:

The Input List is the total BTC from the sender that is involved in this transaction. So the faucet was working with a transaction total 1974.36914575 BTC for this particular transaction.

The Output List contains your wallet address and the amount they transferred to you: 2.20000000 BTC and 1972.16814575 BTC which is attributed back to sender.

Doing the math: 
1974.36914575 - (1972.16814575 + 2.20000000) = 0.00100000 BTC

The transaction does not balance! Where did the 0.00100000 BTC go?

The 0.00100000 BTC is the mining fee for this transaction and is attributed to whoever or whatever that mined this particular transaction.

Notice also there is an 'Origin Transaction' table at the bottom of the page. If you click on the origin transaction id, it will take you to the previous transaction attributed to the faucet address, which resulted in the transaction that they used to send you the 2.2 BTC. 

Technically, you will be able to keep on clicking on the origin transaction id until you get to the first transaction or block to ever be recorded in the Blockchain, what is called the 'Genesis' transaction or 'Genesis Block'. 

Transactions in the Blockchain are interconnected to each other which is essential to the it's properties of being an immutable, transparent and verifiable ledger. This is one of the key concepts that allowed cryptocurrency to exist in the first place, and removes dependency on an existing third party money transfer system to manage funds and exchanges of value.

How do I know that this demo was really done on Bitcoin TestNet Blockchain ?

Well that's the beauty of the Blockchain. Its easily verifiable from another third party Blockchain explorer. 

Try this TestNet Blockchain explorer: https://www.blocktrail.com/tBTC

Copy and paste our transaction id into the textbox on their page and click on the 'Search Testnet' button.

Our transaction should appear and the Input/Output list, block numbers etc. should match. That's Blockchain's verifiable ledger property in action. As long as you know what you're looking for you really don't have to trust my word for it, the network will help you verify transactions yourself.

In Part 2, we will discuss more about the Bitcoin transaction properties and how unscrupulous individuals steal your coins.

No comments:

Post a Comment

Popular Posts