Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: wunderkrakon on December 16, 2018, 07:53:31 PM



Title: Move away from all zero bits prefix?
Post by: wunderkrakon on December 16, 2018, 07:53:31 PM
Hello,
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
Why not allow any 256-bit sequence?
For instance, suppose I want to create a blockchain just for mypersonaldomain.co. If I produce a SHA256 hash of that domain name and use that as the sequence of bits that the prefix must match, it would not conflict with the original Bitcoin blockchain and would be unique.
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix so that nodes know what prefix they are solving for, but once that is done, the world could benefit from 2^256 unique blockchains.
Cheers.


Title: Re: Move away from all zero bits prefix?
Post by: darosior on December 16, 2018, 08:58:22 PM
Quote
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
The PoW is the challenge to find a hash which represents a number inferior than the target. It happens that represented in hexadecimal the target has X leading 0 but it is not all about the challenge.

Quote
For instance, suppose I want to create a blockchain just for mypersonaldomain.co.
Do you mean a network similar to Bitcoin ?

Quote
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix
I don't think this is going to happen.

Quote
the world could benefit from 2^256 unique blockchains.
What do you mean ?


Title: Re: Move away from all zero bits prefix? Because of the KISS Principal
Post by: btc-room101 on December 17, 2018, 02:06:10 AM
Well it could be an all '1' prefix? What do you want?

The idea here is that if you flip a coin and say head's is zero, then say you flip 20 coins what's the odd's of how ALL coins in a batch of 20, all turn up with head's? That's a well known math problem in probability, the the exact number of +51% flips required is a known-known. Thus the POW can be estimated upfront, and let the machines do the calc's. If you want the leading 30 to be zero, same deal it takes a little longer, more tosses.

KISS principal say's "Keep it Simple Stupid", I think that's what Satoshi had in mind here for his proof-of-work, a simple well known algo, and given that each sha256() call is essentially 257 random coin tosses, you can easily figure how many call's you have to make.

You could make this POW really complicated, but the question begs to be asked?? WHY?

One reason I think the POW could be made more complicated is to obsolete all the ASIC miners, say you wanted the 'lead' to be random sentence from the bible, now that would obsolete all asic boxes, but return mining to the cpus. Sort of the 1M monkey problem, if you put 1000Million monkeys on typewriters eventually one of them will write moby-dick ( well at least I'm Ishmael )


Quote
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
The PoW is the challenge to find a hash which represents a number inferior than the target. It happens that represented in hexadecimal the target has X leading 0 but it is not all about the challenge.

Quote
For instance, suppose I want to create a blockchain just for mypersonaldomain.co.
Do you mean a network similar to Bitcoin ?

Quote
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix
I don't think this is going to happen.

Quote
the world could benefit from 2^256 unique blockchains.
What do you mean ?


Title: Re: Move away from all zero bits prefix?
Post by: HeRetiK on December 17, 2018, 10:28:01 AM
Hello,
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
Why not allow any 256-bit sequence?
For instance, suppose I want to create a blockchain just for mypersonaldomain.co. If I produce a SHA256 hash of that domain name and use that as the sequence of bits that the prefix must match, it would not conflict with the original Bitcoin blockchain and would be unique.
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix so that nodes know what prefix they are solving for, but once that is done, the world could benefit from 2^256 unique blockchains.
Cheers.

Why should Bitcoin's PoW scheme be relevant for another blockchain? Or the other way round, why should Bitcoin's PoW scheme take an unrelated blockchain into account?

I'm not sure what you are trying to do, but maybe sidechains and / or merged mining are of interest for you. Namecoin [1] comes to mind, especially given the example you provided.

[1] https://namecoin.org/


Title: Re: Move away from all zero bits prefix?
Post by: KingZee on December 17, 2018, 10:56:18 AM
Hello,
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
Why not allow any 256-bit sequence?
For instance, suppose I want to create a blockchain just for mypersonaldomain.co. If I produce a SHA256 hash of that domain name and use that as the sequence of bits that the prefix must match, it would not conflict with the original Bitcoin blockchain and would be unique.
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix so that nodes know what prefix they are solving for, but once that is done, the world could benefit from 2^256 unique blockchains.
Cheers.

Why should Bitcoin's PoW scheme be relevant for another blockchain? Or the other way round, why should Bitcoin's PoW scheme take an unrelated blockchain into account?

I'm not sure what you are trying to do, but maybe sidechains and / or merged mining are of interest for you. Namecoin [1] comes to mind, especially given the example you provided.

[1] https://namecoin.org/

From what I understood, I think he means that instead of trying to find blocks that hash to a hex of 64 zeroes (ex, '000000000000000000237951976062fcfbd0da69e369a912667214ef01213605' and counting), he wants to mine for a specific sequence. Say some satanic summoning ritual written in hex or his neighbor's wifi password...

It's a valid question but only if you figure out the reason why you want such a thing. Miners don't just try to hash random strings and generate your hash, they have to include tx signatures, previous block hash, and only have control over the nonce which they try to increment. So if I want to think that you want to somehow make a blockchain that will try to reverse a specific hash for you, it's impossible to implement in practice because you have no control over the data being hashed.. tl;dr : blockchain isn't a hash cracking tool.

It is a very nice question though, it does raise thought over the question "CAN blockchain be used to reverse hashes?".. Just a few variables that need to be changed maybe..


Title: Re: Move away from all zero bits prefix?
Post by: odolvlobo on December 25, 2018, 04:24:14 PM
Is there a good reason any longer for the rule that the success of a Bitcoin proof of work has to be that there is an all-zero bits prefix?
Why not allow any 256-bit sequence?
For instance, suppose I want to create a blockchain just for mypersonaldomain.co. If I produce a SHA256 hash of that domain name and use that as the sequence of bits that the prefix must match, it would not conflict with the original Bitcoin blockchain and would be unique.
The Bitcoin block format would have to be revised to include my blockchain's 256-bit prefix so that nodes know what prefix they are solving for, but once that is done, the world could benefit from 2^256 unique blockchains.
Cheers.

There is no rule for an all-zero prefix. Controlling the difficulty with the number of leading 0 bits in a block's hash was outlined in the white paper, but that is not how it was implemented. As it is currently implemented, the hash must be less than a target value, so that is why you see zeroes.

Anyway, there is no reason why you couldn't add a blockchain identifier to every block and it would not need to be part of the block hash. On the other hand, every blockchain is unique, so is it really necessary?


Title: Re: Move away from all zero bits prefix?
Post by: wunderkrakon on December 29, 2018, 07:32:19 PM
Anyway, there is no reason why you couldn't add a blockchain identifier to every block and it would not need to be part of the block hash. On the other hand, every blockchain is unique, so is it really necessary?

My idea is that adding a blockchain identifier to the block would allow miners to mine any of a myriad of Bitcoin-like coins on the same ASIC hardware and know which is which in the block. It would make the miners agnostic about the different blockchains of this type.


Title: Re: Move away from all zero bits prefix?
Post by: darosior on December 30, 2018, 12:52:53 PM
Anyway, there is no reason why you couldn't add a blockchain identifier to every block and it would not need to be part of the block hash. On the other hand, every blockchain is unique, so is it really necessary?

My idea is that adding a blockchain identifier to the block would allow miners to mine any of a myriad of Bitcoin-like coins on the same ASIC hardware and know which is which in the block. It would make the miners agnostic about the different blockchains of this type.

https://en.bitcoin.it/wiki/Merged_mining_specification
https://github.com/namecoin/wiki/blob/master/Merged-Mining.mediawiki
 ;)


Title: Re: Move away from all zero bits prefix?
Post by: wunderkrakon on December 31, 2018, 09:10:15 PM
https://en.bitcoin.it/wiki/Merged_mining_specification

I'm not talking about merged mining, but rather more like timesharing or multitasking.
A given miner might spend the day mining 20 different blockchains, all of the independent from one another.