# Concrete examples / tutorials of how blockchain/bitcoin works

I want to understand the crypto details behind the blockchain (at least in the form that bitcoin implements it).

Can you point me to some page or documents that show the details with examples?

I read the Wikipedia page on Blockchain, and it's sort of: I understand everything that I read, but at the end, I'm clueless about how it actually works. (I understand the characteristics of the blockchain/bitcoin mechanism, and I can see how the hashes and the PoW and the Merkle tree are related to accomplishing those characteristics, but no more than that)

I read the Original paper by Nakamoto, and for the most part, I perfectly understand each of the things it says (however, see below). Yet, at the end I'm back to being clueless about how does it actually work.

I think what I need is to see some concrete examples showing the actual detailed structure of things, and also some examples of concrete attacks that would be possible if a particular feature was missing.

Some of the concrete doubts/questions I have are:

• What is the nonce and how do we generate them? (maybe rephrasing: does the nonce represent something specific?)
• How does the individual node prove its work? I perfectly understand everything that §4 of Nakamoto's paper says --- the problem is that it does not say (at least not that I can see/understand) how those principles are incorporated in bitcoin.

§4 talks about incrementing a nonce until meeting the constraint (e.g., the hash starting with a given number of zeros). Is that the same nonce shown in the diagram? If so, how does one know that that nonce was generated honestly and not reused (maybe not reusing the exact same value, but perhaps a value derived from some past value that speeds-up the PoW)?

• I guess I'm not too clear on the notion of the "accumulated work" in a chain --- is it just that each block by itself represents a certain amount of work $$w$$, and a chain of $$N$$ nodes simply represents $$N\times w$$ work?
• Using a separate key pair for each transaction; though I can see how that addresses the issue of linking different transactions to a same user, if you just randomly generate a different key-pair for each transaction, then what's the point of signing a transaction? What are you proving by it? (the usual notion of digital signatures is that you publicize a verification key along with its associated identity --- even if the identity is given by a pseudonym). I guess for that matter, I'm not too clear on what the role of the digital signature is in the blocks; the idea is anonymous transactions, and the "chained hashing" provides authenticity and tamper-proof (thus, non-repudiation).
• I have to say that this seems off-topic. Bitcoin.SE seems to be the right place. I suggest you take the Princeton's bitcoin class on Coursera. – Shan Chen Mar 2 '19 at 21:34
• Study the actual open source implementation of a crypto currency like Bitcoin. Go through it line by line. That should make it nice and concrete. – Henno Brandsma Mar 2 '19 at 22:24
• @ShanChen -- strange; before posting, I actually went to bitcoin.stckxch, and I thought my question was off-topic there. That community looked to me more like about using bitcoin, and if anything, understanding how it works at the conceptual level (same way as you would explain public-key crypto to someone with little or no knowledge of mathematics), but not about how the crypto behind the blockchain principle works. I guess I'll look into this Coursera class you mention. – Cal-linux Mar 3 '19 at 0:04
• The nonce only represents a random guess. It's iterated until the hash value of the block candidate finally matches the target value. This is also how work is proven, the target value means that the hash must start with a certain number of zeroes - nobody knows how to achieve that faster than random guessing, so X zeroes represents an average of 2^X guesses. – Natanael Mar 3 '19 at 1:46
• Every key / address is it's own "identity", you give them out one at a time when receiving coins, and when you send coins you split existing ones between the receiving address and a new random one of your own. The proofs of identity, when necessary, happens during each individual transaction. Each individual address has its own coins, and you use their respective keys to sign transactions involving coins assigned to them. – Natanael Mar 3 '19 at 1:48