Tuesday 6 July 2021

Double hash of two TX

I'm looking to double hash two tx, in order to build merkle tree

This

const bsv = require("bsv");
var tx1 = '3a459eab5f0cf8394a21e04d2ed3b2beeaa59795912e20b9c680e9db74dfb18c';
var tx2 = 'be38f46f0eccba72416aed715851fd07b881ffb7928b7622847314588e06a6b7';

bsv.crypto.Hash.sha256sha256(Buffer.concat(
    [ tx1, tx2 ].map( v => Buffer.from(v, 'hex') )
)).toString('hex');

is giving me

215f8397a3090a0bc8f4a2e98609a10d55fc7b939fa1ecf9803df20b1ee089a2

but it should be

13a3595f2610c8e4d727130daade66c772fdec4bd2463d773fd0f85c20ced32d

How do I get the correct result?



from Double hash of two TX

No comments:

Post a Comment