Lisk-sdk: How to reproduce payload hash for Betanet genesis block?

Created on 20 May 2018  路  6Comments  路  Source: LiskHQ/lisk-sdk

I tried to validate the Betanet genesis block but get a different payload hash than the expected "ef3844327d1fd0fc5785291806150c937797bdb34a748c9cd932b7e859e9ca0c" from https://github.com/LiskHQ/lisk/blob/v1.0.0-beta.6/genesis_block.json

What works in my custom tooling:

  • I can validate all blocks on Betanet other than the genesis block
  • I get the exact same list of transaction IDs as in genesis_block.json
  • In the genesis block, I get the same payload length as expected (19619 bytes)

Thus I believe my transaction serialization and payload serialization is good. However, my payload hash is e90c18008e1ab5bdd9721cf45770bab644a67e116ee03b45b44b8d486aea4346.

Could you share the tooling you used to generate the payload hash of the genesis block. I'd love to compare the serialized payloads.

My payload serialization of 12584524832111619342 is this genesis_serialized.txt (hex encoded).

framewornode

Most helpful comment

@webmaster128 When Lisk was created, I wrote my own tool to generate the genesis block which has also been used since then for new testnets, etc.

Note: We are intending to clean up the source code and release this functionality as part of the SDK.

With regard to the payload hash difference. @MaciejBaj should be able to help with that.

All 6 comments

@webmaster128 When Lisk was created, I wrote my own tool to generate the genesis block which has also been used since then for new testnets, etc.

Note: We are intending to clean up the source code and release this functionality as part of the SDK.

With regard to the payload hash difference. @MaciejBaj should be able to help with that.

@webmaster128 I was using the same tools but updated to use the recent code dependencies and libraries.

Payload hash of Betanet Genesis Block was generated as a sum of getBytes results of every genesis transaction.

@MaciejBaj thanks. Are those "same tools" available? I still can't validate the first block of Mainnet and Testnet using the same code that works for every other block.

As @karmacoma said:

Note: We are intending to clean up the source code and release this functionality as part of the SDK.

Feel free to contact me privately on Lisk.Chat so we can try to debug your problem.

I was able to validate the transaction signatures of the genesis block. One special rule must be applied: every transaction is signed by the following pubkeys instead of the sender

73ec4adbd8f99f0d46794aeda3c3d86b245bd9d27be2b282cdd38ad21988556b (testnet)
d121d3abf5425fdc0f161d9ddb32f89b7750b4bdb0bff7d18b191d4b4bafa6d4 (mainnet)

However, I cannot validate the block itself because the payload hash is different. Could you please share the payload of the genesis block of testnet that results in the payload hash/nethash da3ed6a45429278bac2666961289ca17ad86595d33b31037615d4b8e8f158bba?

Since I get the same length (19619 bytes) in my own payload serialization I have the feeling the order of transactions is different. But that is just a guess.

This is no longer valid as we closed the [email protected].
If you still have problem, please contact us in our gitter https://gitter.im/LiskHQ/lisk-sdk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diego-G picture diego-G  路  3Comments

yatki picture yatki  路  3Comments

willclarktech picture willclarktech  路  4Comments

karek314 picture karek314  路  3Comments

slaweet picture slaweet  路  3Comments