On Github JustinTArthur / BitcoinForDistributedSystemsEnthusiasts
Justin Turner Arthur / @JustinTArthur / https://github.com/JustinTArthur
I’m a programmer and a bitcoin user. I’m fascinated by the science behind it. In my open source activities, I've contributed to bitcoin trading and mining software solutions.Bitcoin is a payment system.
Bitcoin is a peer-to-peer distributed system.
It maintains the state and history of what amounts of payable asset (Bitcoin) belong to the payable entities known to the system (addresses).
An append-only log of every transaction that has moved Bitcoin currency from one address to another in the Bitcoin system.
You're likely to hear ledger vs log.
We want to inject new coins in a way that rewards actors contributing to the system.
Consensus gives us a perfect opportunity for this.
We can reward actors that validate and commit transactions to the blockchain.
But in Raft, we would invite race-to-leader abuse when being a leader is reward-able.
And, our nodes aren't tied to a entity we could reward (address, person, etc.)
So instead of using something like Raft, we have mining.
A miner:
Asks a node for a block of uncommitted valid txs. Adds a reward-me tx of its own to the block. Performs proof-of-work that signs block as confirmed. If able to successfully confirm block, has node broadcast it as part of blockchain.while true:
block_hash = SHA256(SHA256(EndianFlipEvery32Bits(data + nonce)))
if block_hash < difficulty_target:
tell everyone about our new block in the blockchain
exit and try to generate/mine another block
else:
nonce = nonce + 1
Miners have started participating in mining pools, working together to generate confirmed blocks.