Blockchain & Cryptocurrency #10: Incentives and Proof-of-Work

In the previous posts we have seen a lot of concepts regarding Bitcoin. Now let's make a quick recap and draw some conclusions on mining and bitcoin network.

Is mining profitable?


It's quite expensive for miners to be in operation, because finding a single block takes computing about 1040 hashes. We’ve also seen that at the same time the block reward is about 12.5 Bitcoins, which is quite a lot of money.

We can write down a simple equation that represents if mining is profitable. The mining reward consist of the block reward and transaction fees. To be profitable it should be bigger than the miner total expenditure: sum of hardware and electricity cost. In fact, Bitcoin mining is really expensive in terms of electricity and that becomes a significant portion of the cost compared to the hardware.

There are some complications to this simple equation:

  • hardware cost is a fixed initial cost, whereas the electricity cost is variable and incurred over time.
  • the power of the miner’s hardware is a ratio of the power of the total network, so also variable.
  • the costs that the miners incur are in FIAT currency, but they’re rewarded in terms of Bitcoins. So the equation depends on Bitcoin’s exchange value.
  • so far we have assumed that the miner is interested in honestly following the protocol, and this equation doesn’t capture all the nuances of the different strategies that the miner can employ
bitcoin_equation

At the end, it is a complicated game theory problem and we don't have simple answers to that.

Recap


Identities

As we have said there are no real-world identities required to participate in the Bitcoin protocol. Any user can create a pseudonymous key pair at any moment, any number of them. If Alice wants to know what address Bob wants to get paid at, that's not part of the Bitcoin protocol. That needs to be managed by some other process, for example, on Bob the merchant's website.
Transactions

Given these pseudonymous key pairs as identities, transactions are basically messages that are broadcasted to the Bitcoin peer-to-peer network. They are instructions to transfer a coin from one address to another. And a coin is just a chain of transactions to the extent that we can call anything in Bitcoin an actual coin.
Peer-to-peer network and blockchain

The goal of the peer-to-peer network is to propagate all new transactions and new blocks to all the Bitcoin peer nodes. The underlying assumption is that the network is quite unreliable. Instead, the security comes from the blockchain and the consensus protocol. A transaction to be in the blockchain must achieve a lot of confirmations. The more blocks extend the block that contains a transaction, the more certain we can be that the transaction is part of the consensus chain.

Often there are orphan blocks, that could represent an invalid transaction or a double spending attempt. It could simply represent the fact that there is latency in the network, and two miners competing to solve this proof of work puzzle ended up finding new blocks within just a few seconds of each other. And, so both of these blocks were broadcast nearly simultaneously containing common transactions.

Proof-of-work

Suppose that Alice and Bob are two miners, and Alice has 100 times as much computing power as Bob. This doesn’tmean that Alice will always win the race against Bob to find the next block. But instead that Alice and Bob have a probability ratio of finding the next block in the proportion 100 to 1. So in the long term Bob will find, on average, 1% of the blocks that Alice does.

Consensus types in Bitcoin


There a three types of consesuns in Bitcoin:

  1. currency value: there must be consensus on the current value of Bitcoin. This type of consesus is not valid only for Bitcoin, but also for FIAT currencies
  2. bitcoin state: this is accomplished by the blockchain that records the valid transactions and keep track of every transaction that ever occurred. Ownership of Bitcoins is nothing more than other nodes thinking that someone owns a certain number of Bitcoins.
  3. protocol rules: there must be consensus on the rules of the system and sometimes they need to change.

Bitcoin is Bootstrapped

bitcoin_bootstrap

Let's start from the security of the blockchain. It must be secure for Bitcoin to be a viable currency. But, what is necessary for the blockchain to be secure? What this means is that an adversary shouldn't be able to overwhelm the consensus process. So he shouldn't be able to create a lot of nodes and take over 50% or more of the new block creation. A prerequisite for that is having a healthy mining ecosystem made up of largely honest protocol following nodes.

But, when can we be sure that a lot of miners will put a lot of computing power into participating in this hash puzzle solving competition? They're only gonna do that if the exchange rate of Bitcoin is high. This because they receive rewards in Bitcoins, whereas their expenditure is in dollars. So the more the value of the currency goes up, the more incentivized these miners are going to be.

But what ensures a high and stable value of the currency? That can only happen if, users have trust in the security of the blockchain. Because if they believe that the network could be overwhelmed at any moment by an attacker, then Bitcoin is not going to have a lot of value as a currency.

Bitcoin development

So there's this interlocking interdependence between these three things. The existence of each of these is predicated on the existence of another. At the beginning of Bitcoin there were no miners other then the creators so the blockchain was insecure and Bitcoin had no value. How did it go from there, not having any of these three properties to having all three of them? All these three properties increased and are still increasing alltogether while the system is expanding.

That's the interesting bootstrapping feature of Bitcoin, and every new Alt Coin that wants to succeed, also has to somehow solve this problem of pulling itself up by its bootstraps.

Consensus failure consequences


What could happen if consensus failed and there were someone who controls 51% or more of the mining power in the Bitcoin network?
Steal coins from existing address

Can the attacker steal coins from existing address? No, because stealing from an existing address is not possible. In fact it's not enough to subvert the consensus process, it would also be necessry to subvert cryptography.

Let's say that this 51% attacker creates an invalid block that contains an invalid transaction. That represents stealing Bitcoins from an existing address that the attacker doesn't control and transferring them to his own address. This attacker can pretend that that's a valid transaction and that the block containing it is valid. He can keep building upon this block and even succeed in making that the longest branch.

But the other honest nodes are simply not going to accept this invalid block, and are going to keep mining based on the last valid block creating a fork in the chain. This attacker won't be able to spend these stoles coins let's say giving them to some merchant Bob. In fact Bob will presumably be running a Bitcoin node himself and an honest one. And he won't accept the transaction even if it is in the logest branch, because it contains a transaction without valid digital signature.

Suppress transaction

Can the attacker suppress some transactions? No. Let's say there are some user, say Carol, whom the attacker really doesn't like. The attacker knows some of Carols addresses and wants to make sure that no coins belonging to any of those address can possibly be spent.

The attacker can refuse to create any new blocks that contain transactions from one of Carol's address. He can also refuse to build upon blocks that contain such transactions. However the attacker cannot prevent that these transaction are sent to the other honest nodes in the network. So he is not able to totally stop these transactions, they can still reach the peer-to-peer network.

Change block reward

Can the attacker change the block reward? No, this corresponds to changing the rules of the system. Because of a reasoning similar to what we applied for stealing Bitcoins from an existing address, this is also not possible. In fact the attacker doesn't control the copies of the Bitcoin software that all of the honest nodes are running.
Destroy confidence in Bitcoin

Can the attacker destroy confidence in Bitcoin? Yes. In fact, let's imagine what would happen. If there were a variety of double speding attempts, and behaviour of not extending the longest valid branch and other such attempted attacks, then people are going to decide that Bitcoin is no longer acting as a decentralized ledger that they can trust. So people will simply loose confidence in the currency and we might expect that the exchange rate of Bitcoin is lowering. This last one is the main practical threat if a 51% attack would happen.

bitcoin_attacks

Sort:  

Really interesting post! I'm learning everyday new thinks about blockchains and cryptocurrencies thanks to your posts! Thank you for sharing your course on Steemit!

@OriginalWorks
@Steem-untalented

The @OriginalWorks bot has determined this post by @rosargia to be original material and upvoted it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Hello @rosargia
We have given you our still tinnie-winnie upvote!
You have been determined by a human @foodart to be possessing of special gem. Do join the #untalented family!

Abolishing the conditioning attached to IQ tests e.g smart, dull, bum, average and you suddenly give every human a chance to shine!

So e.g if Bill Gates did Microsoft and i can do Macro-hard, arent we both genius? Oh, we both are! Showcase your talents regardless of its nature freely with us in #untalented. Relegate all reservations as flaws are allowed and we sift even the so-called nonsense to find sense therein.

#untalented is an ongoing historical curriculum with initiatives/contests, where each participant wins something. No losers! It is also a core branch of #steemgigs, so please join the SteemGigs community on discord already containing around 700 gifted steemian family members. See this URL for more info

https://steemit.com/steemit/@surpassinggoogle/steemit-s-untalented-is-in-beta-participate-freely-because-every-participant-in-this-contest-will-win-something-no-losers

and also this URL for the discord community

https://discord.gg/CGuPyyT

If you want to vote a witness, you can vote steemgigs too. Simply go to

https://steemit.com/~witnesses

and type steemgigs into the first search box. Stay awesome!

Just incase you find any level or form of gifts, talents, attempts at out-of-the-boxness, or any steemian low in confidence about their abilities, worth, etc; please don't let it slip emptily by.

Kindly call on me! Simply reply to any such post and add @steem-untalented or #untalented to your reply and i will be there to upvote, acknowledge, strengthen and encourage them.

Coin Marketplace

STEEM 0.20
TRX 0.26
JST 0.039
BTC 100693.54
ETH 3647.21
USDT 1.00
SBD 3.13