Bitcoin transaction process, Digital Signature, Private key and Public key.

in #bitcoin8 years ago

Hi all!
This time I will go a bit deeper of how the transaction of Bitcoin works. Before getting into the headline let us first recap of what happens in the background when someone sends a Bitcoin, or in this case, Bob.
Bob send 5 BTC to Allice.
What is happening in the background is the following;

  1. The transaction is being broadcasted to the networks
  2. The miners will verify the transaction
  3. The transaction will be put into a block
  4. Miners get their Bitcoin rewards, move to the next block

To verify the transaction the miner needs to solve a cryptographic puzzle, the so-called SHA 256. Why so? For the sake of the security, and this function it’s not only used in Bitcoin but already everywhere without us knowing that we have been using it all the time (Bank transaction, the password for social media, etc.).
That’s basically what happens in the background. But what if I forge my transaction?

Digital Signatures.
How can we be sure that Bob really send 5 BTC to Allice and he is not broadcasting a fake one saying that Allice sent him 100 BTC?

The answer, Allice must sign the transaction in order for the transaction to be valid, and only she can do that. How does that work?

First, everyone in the network (me, you, everyone who want to send and receive Cryptocurrency) have the so-called public key and private key. The private key is as the name suggest, private to our self, it should be kept safe and should not be shared with anyone, and the public key is available to everyone.

This is basically what happens when Allice makes a transaction to Bob

• Allice signs the transaction derives from her Private key and send it to Bob’s address.
Sign (transaction, private key)

• The miners verify the transaction using Allice’s public key in order to check her signature.
Verify (transaction, signature, public key) = True/False

Using this concept and the technology behind it, the miners can verify that it was indeed Allice’s signature by checking her public key and without knowing her private key, and no one can copy her signature because it changes for each transaction.
The signature will change but it will always correspond to her private key in order for the miners to verify her transaction.

Bob send 5 BTC to Allice, does Bob even has 5 BTC to begin with?
Now instead of having a balance of all transactions to proof that indeed Bob has at least 5 BTC to begin with, Bitcoin system works like the following;
Every transaction on the Bitcoin's blockchain is linked to the previous transaction. So, in the background not only Bob send 5 BTC to Allice's address, Bob also needs to refer the previous transaction(s) where he received 5 or mote BTC into his transaction. And the miners will also verify that Bob indeed received in the past from one or many transaction(s) a total of 5 or more BTC.

So that’s it for this post, critics are welcome 😊

Sort:  

Hi I upvote you.... I am new to this platfrom plz visite my profile........ if you like my contents then follow me and upvote me :) @palcrypto

Congratulations @alreader! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.102
BTC 63928.68
ETH 1855.62
USDT 1.00
SBD 0.39