dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

clean up bitcoin protocol technical debt which requires hardfork otherwise #17

Open scravy opened 6 years ago

scravy commented 6 years ago

Since we are starting a new chain we have the change to do protocol cleanup or implement BIPs which would require a hardfork if done to bitcoin. There is a list of such things at https://en.bitcoin.it/wiki/Hardfork_Wishlist

Should we apply some of these?

Gnappuraz commented 6 years ago

The list is a bit superficial I'm afraid. I have no clear understanding of the scope of most of those features. Maybe we can take in consideration some "quick win" if any of those is such.

scravy commented 6 years ago

Fair enough, here's some items extracted from that list that I find particularly interesting (I'll add some abbreviations to refer to them in later discussion):

BOC is in no way critical, but absolutely nice to have, as every developer coming to the bitcoin project first scratches her head about it (and while not targeting consensus it does require a hard fork as it affects hashes, versions, magic numbers)

MAL is something which is also targeted by SegWit but could be solved differently / more elegantly ( see for example: The right way to fix transaction malleability )

CMS is a super annoying bug which is well worth fixing but also requires a hard fork

PCB is something I completely agree with. Right now a lot of stuff which is not necessary for the execution of a script is put in the coin base transaction, such as the block height and in our case the kernel hash (and in case of segwit the witnesses hash). These could live in dedicated fields which do not need to be part of the block header.

P2SH++ Right now P2SH scripts are limited to somewhat about 512 bytes.

All of these issues have in common that these are things which actually work as of now but they were bolted on to bitcoin retroactively or are confusing as fudge and are especially sources of confusions for new comers to the project. Yet, since things already work, they do not pay off immediately (one could say most of these are what would classically be considered technical debt).

As we are starting a new chain we have a chance to clean them up, but it also takes time. Nevertheless, all of these affect the protocol and could not be altered once we went live.

mergeable[bot] commented 5 years ago

There has not been any activity in the past month. Is there anything to follow-up?

scravy commented 5 years ago

Thanks @mergeable.

Following up on the named items:

mergeable[bot] commented 5 years ago

There has not been any activity in the past month. Is there anything to follow-up?

Nizametdinov commented 5 years ago

P2SH++ Right now P2SH scripts are limited to somewhat about 512 bytes.

P2WSH allows for scripts up to 10,000 bytes. https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Witness_program

scravy commented 5 years ago

Good point. Back when we created this ticket we did not have a clear understanding and decision on segwit. As by default every P2SH would be P2WSH actually P2SH++ is a no brainer.

Was I right about the following?

CMS I will create a ticket for this one specifically, @Nizametdinov is interested in this I think.

Nizametdinov commented 5 years ago

Yeah, I want to fix that. I will work on it after remote staking.