In this type of consensus:
- A transaction is performed, i.e. someone buys something from someone
else.
The person who desires for this transaction to become a legitimate
block on the blockchain will send out a cryptographic hash.
The hash is a function which scrambles its inputs and creates an
output.
There is no easy way to solve for the original inputs so peers will
put random numbers into the function in an attempt to find the inputs that created the hash.
After enough of these peers have independently solved the problem
then the transaction is considered legitimate and the transaction
goes on the ledger.
In the bitcoin model, this means the bitcoins are immediately moved to the other party's account.
The number of peers needed to validate the transaction is often calculated by a Byzantine fault tolerance algorithm. You can read the full paper at the link below but it basically means that the system needs:
n = 2f + 1 peers to agree where n is the total number of peers
and f is the number of failing peers.
For example, if you have 4 peers then according to the algorithm three of them must agree before consensus can be achieved.
Here is the example with 4 peers:
n = 4
4 = 2f + 1
3 = 2f
1.5 = f
total failures can only be 1
n - 1 = 4 - 1 = 3 peers must agree
Included with the paper on the algorithm are another slideshow that may be helpful to understand it and a link to a video that should be helpful about the bitcoin model in general.
http://pmg.csail.mit.edu/papers/osdi99.pdf
http://www.cs.utah.edu/~stutsman/cs6963/public/pbft.pdf
https://www.youtube.com/watch?v=GMKgB3zZ1so