How are changes made to Bitcoin ? Understanding Bitcoin Implementation Proposals ! | Hacks and Security

Sunny Nehra
7 min readNov 5, 2019

--

Well bitcoin doesn’t have any owner or centralised system. Its an open source. Anyone can become a node to facilitate its functioning ( the aim of its blockchain is to store transactions done by users and to validate the data of transactions and store them in blocks is purpose of miners).

Most of full nodes in bitcoin are miners ( rarely someone will become a node just to let data pass through it and suffer the load without making any profit).

Now the question rises who will make changes to bitcoin and why will those changes be accepted by others and what about those who are not following the change ?

Lets first understand Bitcoin and its network. See there are users and nodes. Users are holding the private keys of their accounts and use that to transfer bitcoin from their account to others. Lets consider a node ( who is a miner ) who is running a code ( say present bitcoin code or code A ) which it uses to check if the data it got it valid to be kept in the blocks of bitcoin blockchain. Now suppose it mines a block ( lets say its lucky enough) it will keep data of several transactions and all that data was validated as per the bitcoin rules ( code A rules ) . There will be several nodes across the world running code A to validate data.

Now questions rises what if some people propose a code B which is different from code A . There are many possibilities like : The nodes that are supporting code A may support code B as well but not the opposite. I mean say mathematically if blocksize is less than 1 mb than block size will be less than 2 mb also and the opposite is not true ( because something less than 2 mb could be greater than 1 mb). It could happen that nodes supporting code B may support code A but not the opposite. It could happen that node supporting code A can’t support the Code B and vice versa. Say some nodes are mining blocks of size less than 1 mb while some are mining blocks of size 1 mb to 2 mb. It also could be that nodes that support code A are supporting code B ( it all depends on what change is made).

Simply speaking there is no owner so who will decide if Code B should now be called bitcoin ? And why should code A users move to it ?

Now a simple line : bitcoin is what public want as bitcoin. What i mean is see most of us use wallets for bitcoin accessing. We are common users and want only data related to our addresses and not complete blockchain so we use wallets ( wallets are in a way SPV clients that are connected to some full node and keep update of one or more addresses) as complete blockchain is huge in size ( and it will give unnecessary load to common users as a common user want to know only about his wallet address not about entire blockchain). There are several companies which are providing these wallets. Now these wallet integrators play a huge role here. See you have 1 bitcoin in say coinbase. How do you know you have 1 bitcoin ? just because its showing in coinbase wallet ? Well what if i just make an application , make your account there , put a bitcoin symbol and show you that you have one bitcoin in the wallet i made ? You will obviously say why should you trust me as its my wallet i can change anything there. Well to be clear your coinbase wallet is connected to a node that is following code A ( and the world calls it bitcoin) and is updating your address from that node. But all that is happening is in background , you are just using a graphical interface made by coinbase (powered by coinbase) and you will not get to know even if coinbase makes some changes in background. What i mean is these wallet companies are deciding a lot : these companies should agree for the change so that public can follow the change. If there is a split in bitcoin and all wallet integrators and makers don’t agree for the new code the public will still be following the old code ( they are still using Code A).

Another important thing here is suppose bitcoin blockchain splits say from block height 500000 into two parts. For both the parts the blockchain upto 500000 blocks is common.

Means suppose if you had 1 bitcoin and bitcoin chain got split. Say bitcoin got split in two branches branch A and branch B . Whichever of the two may be called bitcoin won’t matter you will have your 1 bitcoin because the transaction that contains the fact that your address got 1 bitcoin is common to both. In a way you will have two coins now of same amount and one of it will be regarded as bitcoin by the world.

Again the same question rises which code will be called bitcoin ? Well see all to avoid any kind of such confusion and prevent loss of miners ( what if even after split miners kept mining old code while the new code became bitcoin) a proper system was to be needed.

To say there is a contribution page for making contributions to bitcoin : bitcoin/bitcoin . Anyone can make a contribution. If community feels like its a good change for betterment it will be supported and implemented. But that is just to say ( at the present day).

There were several issues in past regarding the same topic : accepting change in bitcoin. As i said these wallet companies do need to agree to what bitcoin is. Bitcoin for public is what these companies agree as what bitcoin is. Earlier there used to be majority methods.

What if these companies simply wanted for any change to be made at least 51% hashing power should support the change ( means at least 51% hashing power should move to the new code) . Well i m a miner and all i want is my reward if i mine a block. Suppose i started mining the new code ( code B ) and many others are mining too and now all we got is total of say 40% hashing power ( of entire network means code A and code B combined). We continued efforts but realised that more than 40% hashpower we can’t get as more miners join us. Now the companies will carry on with code A as the bitcoin code. But wait , what about the hashpower i spent on mining these new blocks ? It could be reverse also means i could have continued with code A and later code B could have been accepted as the new bitcoin ( in case code B would get more hashing power).

So to avoid such losses , to let forking in a better way , in fact to avoid splits as much as possible, to let miners understand easily what is the possibility of the new code to be accepted as main bitcoin , to make things systematic like we have in democratic elections and for other reasons we started Bitcoin Improvement Proposals​.

bitcoin/bips is the page that mentions all proposed BIPs and their results.

Also note that backward compatibility remains one of main aspects there. Means that the change we are making should be backward compatible ( that is quite important nowadays). For understanding that better raise another question on compatibility. For understanding most common used BIP and how they work again raise another question ( all BIP are different).

Let me still give you a brief idea : See say we have BIP 9 and want to implement segwit using it.What BIP 9 requires is that 95% of the total blocks that are mined in any signaling period should signal for the change. There are 26 periods and each period here stands for 2016 blocks ( as approx 1 block takes 10 minutes time so say 14 days ). Now if you see carefully 14*26 days means nearly 1 year ( it was meant for making one year time). Now note here that blocks that are signaling for change and those note signaling for change are same except their signal ( say those signaling for change have set bit 1 in its nVersion field) . Now there are 26 tries in a way ! Means if in any of these 26 periods there is any period with 95% blocked mines signaling for change that is >=1916 blocks (95% of 2016) than the segwit will move in LOCKED_IN ( i mean segwit implementation will be locked in as a part of bitcoin code). After 2016 blocks of that time when that period( the period which got 95% signaling) we will have segwit implemented. So simply speaking there is a period of 14 days if signaling not reached to 95% then period starts again and keeps going on till 26 times (1 year). Blocks that are having signal to implement segwit or those not having it are same technically ( no split occurs bitcoin of signals ) its done just to show to world if some change really has capability and its chances ( and to avoid sudden losses that could occur). So a time frame of 14 days or 2016 blocks where signaling for change was more than 95% leads to the locking of change.

Originally published at https://hacksandsecurity.org.

--

--

Sunny Nehra

Founder Secure Your Hacks | Ethical Hacker | Trainer | Malware Analyst | R&D on Security Breaches || Digital Forensics | CyberSecurity | Blockchain | OSINT | AI