Login Register






How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain filter_list
Author
Message
How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #1
How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain


[Image: bitcoin-australia.png]

Cryptocurrencies are often viewed as very complex, and the Bitcoin blockchain is viewed as something magical that makes everything decentralized (it does the opposite, we'll talk about that later though).  In this thread, I'm going to explain how the blockchain explained in the original Bitcoin whitepaper by Satoshi Nakamoto works, so you can start thinking about how to implement your own cryptocurrency.

What's a blockchain?

A blockchain is a data structure composed of 'blocks'.  Each block contains the hash of the previous block, so earlier blocks cannot be modified without rebuilding every block after it.
Now, you may be wondering what a block is...
A block is another data structure, which, as described in the whitepaper, contains the following items:
  • The previous block's hash
  • The Nonce, which is a random number
  • A Merkle tree of the transactions
  • The hash of the Merkle root, the nonce, and the previous hash

Merkle trees:

A Merkle tree is another data structure, where each item is hashed, then those hashes are combined and hashed, and then those are combined and hashed...
Eventually, you have 1 hash left, this is called the Merkle Root.
The advantage to using Merkle trees instead of directly storing the transactions, is that once a transaction is old, it can be removed from the blockchain, saving space, without breaking the blockchain.
Here's a diagram which describes this:
[Image: jUO0jcE.png]
Since the hash of the previous block doesn't include the Merkle branches, only the Merkle root, the branches can be pruned without a problem.

Proof of work:

Bitcoin implements what is called a 'proof of work' mining system.  Proof of work systems are often described as systems that make the miner computers solve 'complex math problems', and when a solution is found, they are awarded in Bitcoin.  I hate this explanation, since it says nothing.
A better explanation is that they try to find a nonce value, that when the block is hashed, the hash is under a certain value.  This is hard, since hashing takes a lot of computational resources, and each computer would need to go through a lot of values, thus a lot of hashes, to find the answer.
There are problems with proof of work systems, however... Bitcoin miners use enough energy, at any given moment, to power a large city. This energy usually comes from fossil fuels, which harm the environment... This is a huge waste of energy.

Conclusion

I hope you've learned from this. If you think about it, blockchains aren't really that complex, so all those people who say it is have no idea what they are talking about.
Keep an eye out for the next thread in the series!
It's possible that I got something wrong. If I did, post about it please.


Post below with comments, questions, or general discussion related to this.

Source: Bitcoin: A Peer-to-Peer Electronic Cash System by Satoshi Nakamoto - https://bitcoin.org/bitcoin.pdf
(This post was last modified: 12-01-2017, 07:28 PM by Blink.)


(11-02-2018, 02:51 AM)Skullmeat Wrote: Ok, there no real practical reason for doing this, but that's never stopped me.

[+] 3 users Like Blink's post
Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #2
Something I've been struggling with trying to understand is how Proof of Stake works.

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #3
(12-01-2017, 07:27 PM)themakokid Wrote: Something I've been struggling with trying to understand is how Proof of Stake works.

I'm gonna be explaining that in the next thread!


(11-02-2018, 02:51 AM)Skullmeat Wrote: Ok, there no real practical reason for doing this, but that's never stopped me.

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #4
(12-01-2017, 07:29 PM)Ender Wrote:
(12-01-2017, 07:27 PM)themakokid Wrote: Something I've been struggling with trying to understand is how Proof of Stake works.

I'm gonna be explaining that in the next thread!

Awesome job!

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #5
(12-01-2017, 07:29 PM)Ender Wrote:
(12-01-2017, 07:27 PM)themakokid Wrote: Something I've been struggling with trying to understand is how Proof of Stake works.

I'm gonna be explaining that in the next thread!

Actually looking forward to reading that one. I know btc's primary operation is finding blocks with a specific number of 0's, but not a whole lot above that.

To the others:
a synonym for a block chain is a linked list. Yes, you can distribute that linked list all over the place, but it's useless unless it's completely assembled, in a central location.

[+] 1 user Likes phyrrus9's post
Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #6
Great thread, explains it extremely well! This shit is so interesting, trying my best to learn as much as possible on the topic. I made a prototype blockchain in Go where a Genesis Block is made and if more blocks are to be added a proof of work is required. No actual reward is given, like you said it's just searching for a nonce value currently but I am trying to create a mock transaction system.
{Ciisco}

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #7
(01-13-2018, 02:08 AM)Ciisco Wrote: Great thread, explains it extremely well! This shit is so interesting, trying my best to learn as much as possible on the topic. I made a prototype blockchain in Go where a Genesis Block is made and if more blocks are to be added a proof of work is required. No actual reward is given, like you said it's just searching for a nonce value currently but I am trying to create a mock transaction system.

I literally did just that today, for the next tutorial in the series. Same language too.


(11-02-2018, 02:51 AM)Skullmeat Wrote: Ok, there no real practical reason for doing this, but that's never stopped me.

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #8
This seems so interesting. I really want to wait until you release all the threads so I can read them back to back.
Edit: Thanks for the HQ thread man!
(This post was last modified: 01-13-2018, 02:36 AM by Synthx.)
[Image: ezgif_com_gif_maker.gif]
#yellowheartsforsarah

Reply

RE: How to make a cryptocurrency: Part 1, demystifying the Bitcoin blockchain #9
(01-13-2018, 02:29 AM)Ender Wrote:
(01-13-2018, 02:08 AM)Ciisco Wrote: Great thread, explains it extremely well! This shit is so interesting, trying my best to learn as much as possible on the topic. I made a prototype blockchain in Go where a Genesis Block is made and if more blocks are to be added a proof of work is required. No actual reward is given, like you said it's just searching for a nonce value currently but I am trying to create a mock transaction system.

I literally did just that today, for the next tutorial in the series. Same language too.

If you need some help you know where to find me Wink and sweet can't wait!
{Ciisco}

[+] 1 user Likes Ciisco's post
Reply