Title: [technical] How read prev block hash from binary Post by: Frodek on June 13, 2018, 06:52:10 PM I have hex dump beginning:
https://i.imgur.com/n9QKyrL.png Records beginnings are: 0, 0x120, 0x1ff,.. I read record 0: prev: 0000000000000000000000000000000000000000000000000000000000000000 compute hash: 0000050c34a64b415b6b15b37f2216634b5b1669cb9a2e38d76f7213b0671e00 seems to ok, (begin with 00000) I read record 0: compute hash: 00000bf2367a38c55d68c4145f9e12788b755f702ced1d2ed34c722bb75652c0 prev: 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2 ??? https://live.blockcypher.com/ltc/block/12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2/ (https://live.blockcypher.com/ltc/block/12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2/) Two problems: 1. I use Code: scrypt_1024_1_1_256((const char*)(&header), (char*)charBlockHash); I must next hash this value? (which function? sha256?) 2.Records One has 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2 as PREVIOUS, but blockcypher says that is Litecoin Block 1 (!!!!) no 0. 00000ab604b006c53366cc373e895690dc4d2ea60d1263948cd1f958e77a4735 4bddcbae91541afa4d01bb94cabd39c21886bfd139a4df7e1dfd983ebca541c8 00000d108e311f832249d9c9f0bafb2668970015497d3d364ebedfc08c421916 80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f 0000045b11ebeeecd2857bb79556a2673f86196c589b6d67e20a0ca596ab2278 bd48bb791b61de487e3235820c8ae578d9d6e335ccd651e05e6059dc096a5ba4 00000edd633effebb3480807fed299b5cd1d7f5cfdd58653abb6516d7562b724 13957807cdd1d02f993909fa59510e318763f99a506c4c426e3b254af09f40d7 Title: Re: [technical] How read prev block hash from binary Post by: Frodek on June 13, 2018, 07:34:50 PM Already I know: this hashes are computed by simply Bitcoin double sha256, and I have:
Code: MAINNET but I see TWO interleaved blockchains, it is true? Title: Re: [technical] How read prev block hash from binary Post by: Frodek on June 13, 2018, 07:41:38 PM It is ok: bd48bb791b61de487e3235820c8ae578d9d6e335ccd651e05e6059dc096a5ba4 is 17,
simply blocks are not sorted and this is OK. |