Fundamentals Flashcards
What are the Bitcoin Puzzle Requirements?
- Complex to solve: A puzzle should be hard to solve but easy to verify.
- Adjustable difficulty: In Bitcoin, the difficulty is adjusted every two weeks. You need a solving rate proportional to computational power, meaning that the difficulty reflects
the amount of hashpower in the network. - Progress Free: A puzzle should be “progress free”, meaning that finding a hash does not make it easier
to find the next hash.Every solution is independent of the previous ones. - Pseudoramdomly: Bitcoin’s puzzle is described as a partial hash preimage puzzle. You don’t have to find the exact preimage of the hash, as long as you have the prerequisite number of leading zeros.
What is a Bitcoin Puzzle?
The puzzle is essentially a word (list of characters), call it A, which represents the machine’s output, in order to solve it your task is to find the the correct input (another word), call iti B, such that when you put B into the machine you will get A as an output.
Imagine that you are given a fingerprint sample and you are asked to discover the height, weight and overall look of the person to whom this fingerprint belongs. What would you do?
To make it a bit harder, assume that there is no correlation between fingerprints and other human features (like hair color) so the only way to test if this fingerprint came from your best friend is to take his fingerprint and compare it with the other one.
Your best choice, then, would be taking fingerprints from every person on Earth and then comparing it to the fingerprint in question, until you find a match and stop. In case you are unlucky, the right person would be the last one that you checked, which means that you’ll keep looking for him for the next 13,555 years, assuming you check one person per minute (and the Earth’s population is about 7.125 billion people). If you are lucky, though, you are expected to look for that person for only half of that time, hooray! Bad news ah?
Let’s go back to our hash puzzle. In a hash puzzle, the fingerprint that you are given is a list of characters (let’s call it a word), like “dog”, after which your task is to find the right person (in our case this is a word as well) that produced the fingerprint. To this end the only thing you can do is to try all possible combinations of digits (of some length), one by one.
Conceptually speaking, you have a machine that whenever you put some digits in it, it produces an output of some other combination of digits. You know completely nothing about this machine and it works like magic – you don’t see any correlation between the characters that you put in and the characters that it produces. The only rule that you have observed is that no matter how many characters you put in the machine, the produced output always has the same length.
In the bitcoin system, however, the hash puzzle is somewhat easier: Instead of chasing after a specific output, the miner needs to find an input that produces an output from a big set of allowed outputs. That is, a puzzle could be a list of characters such that its first 16 characters are ‘0’ while there is no limitation on the rest of the characters, they could be anything. Although this makes the puzzle a lot easier, it is a time and energy consuming problem to solve. In the figure above, the miner performs many trials in order to solve the puzzle, the only field that is permitted to be changed in each trial is the nonce. In every trial, the miner combines the nonce that it just chose, the list of transaction that it wished to add to the block-chain and the reference to the previous block all together, it then input it to the SHA1 machine. If the output of the SHA1 machine begins with 16 ‘0’ characters then it solved the puzzle and won the game.
BIPS
In Bitcoin, changes to the protocol come in the form of BIPs, or Bitcoin Improvement Proposals.
There are three types of BIPS: standard, informational, and process.
A standard BIP is an actual update or change to the protocol.
This is how the ecosystem changes, and what miners vote on.
Informational BIPs are more so guidelines on how people should do things in the future,
but it doesn’t change the protocol.
An example of an informational BIP would be a BIP talking about how to run a mining pool.
The last BIP, process BIPs, are specific things that should be done as well as best practices.
The first BIP was by Amit Taaki in 2011, and was actually a BIP to make BIPs.
Miners vote on BIPs by including a reference to that BIP in the block that they mine.
dApps
Descentralized Apps