Bitcoin Forum
May 27, 2024, 12:48:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Hash tree and hash algorithms: can a hash tree use multiple hash algorithms?  (Read 3480 times)
tacotime (OP)
Legendary
*
Offline Offline

Activity: 1484
Merit: 1005



View Profile
December 30, 2012, 07:22:40 PM
 #1

Hi,

I'm working on a bitcoin fork right now and I'm trying to figure out something related to data structures.

I want to develop a blockchain (hash tree) whose algorithm for hashing subsequent blocks is determined as a function of the nonce of the 0th, 0th + c, 0th + 2c, ... , etc block (leaf) where c is a constant.  I assume that the nonce values are pseudorandom and non-predictable, but I don't know if that's actually true.

Which leads to the question: Can I compose a hash tree like this?  What kind of problems do you think I'll run into, and are they impossible to overcome?  I want to see if anyone knows the answer to this before I begin trying.

I don't know if this kind of hash tree has a name or not either, or if it's been implemented before.  I guess it might be called a polymorphic hash tree.

Code:
XMR: 44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
December 30, 2012, 07:35:13 PM
 #2

I think PPC has multiple algorithms: PoW and PoS

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
December 30, 2012, 07:45:36 PM
 #3

Hi,

I'm working on a bitcoin fork right now and I'm trying to figure out something related to data structures.

I want to develop a blockchain (hash tree) whose algorithm for hashing subsequent blocks is determined as a function of the nonce of the 0th, 0th + c, 0th + 2c, ... , etc block (leaf) where c is a constant.  I assume that the nonce values are pseudorandom and non-predictable, but I don't know if that's actually true.

Which leads to the question: Can I compose a hash tree like this?  What kind of problems do you think I'll run into, and are they impossible to overcome?  I want to see if anyone knows the answer to this before I begin trying.

I don't know if this kind of hash tree has a name or not either, or if it's been implemented before.  I guess it might be called a polymorphic hash tree.
Nonce values may not necessarily be secure. Because the miner can selectively choose nonces without a significant impact on hash rate, intelligent miners will choose the most self-beneficial nonce values.

For example, I can write code to increase the nonce by 5 rather than simply incrementing it, to ensure that the nonce is divisible by 5. Nonce values are only non-predictable if there is no financial incentive to make them predictable.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
December 30, 2012, 08:16:10 PM
 #4

As dree12 pointed out you don't want to use nonces.  Super easy to game.  Would just require a miner program which skips certain undesirable nonces.

You could simply use the block hashes which if blocks are "difficult" to construct should be relatively psuedo-random.  It would be possible to game the output but that would require throwing away undesirable blocks.  Unlike nonces they have real value.

So you have a couple options.  The simplest would be to just use the x least significant digits of the various block hashes in the algorithm which determines the algorithm for the next block.
tacotime (OP)
Legendary
*
Offline Offline

Activity: 1484
Merit: 1005



View Profile
December 31, 2012, 06:08:05 AM
Last edit: December 31, 2012, 06:33:34 AM by tacotime
 #5

Right, I guess I can just use the block hashes themselves then.  Reading up on it, it doesn't seem like multiple hash algorithms should be a problem, although I don't think it's been implemented before (PPC uses only SHA256 as a hash function; the proof of stake blocks are just very low difficulty apparently).

Code:
XMR: 44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!