Sunday, September 22, 2024

uncooked transaction – NBitcoin: Get deal with out of uncooked block stream

OK, I’m positive that it is a actually dumb, rookie query, so sorry prematurely…
I’m making an attempt to learn by means of the blockchain and show the receiving deal with(es) for all transactions within the chain. (Similar to Blockchain-Explorer would do.) My library is NBitCoin in C#, so I’m not actually working by means of the uncooked knowledge right here. My place to begin is the the Hash that’s within the output transaction half (TxOut.ScriptPubKey.PaymentScript.Hash). I learn in one other publish that with the intention to convert that Base160 encoded hash to a BitCoin deal with I must add 00 in entrance after which do a Base58 encode of the ensuing array. So I did that:

Base58Encoding.Encode(ArrayHelpers.ConcatArrays(DoubleZero,TO.ScriptPubKey.PaymentScript.Hash.ToBytes()))

Then I took a pattern and in contrast it with the output blockexplorer.com had for a similar transaction, and sadly it did not match. (And sure, I checked the remark made on this query (Deriving the Bitcoin deal with from the uncooked block script), my check transaction has a Base160 encoding, so in response to my understanding it was despatched to an deal with.
The hash is: caf74d35ff967c946f99588cb03b774350d83331
My generated output is: 13q1EyUVtUfvpixnYkDRoZUsi5ZVi
Blockexplorer.com reveals: 16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom

Only for the sake of it I attempted utilizing all the opposite hashes in that ScriptPubKey block as properly, however none yielded the consequence blockexplorer.com had.
What am I lacking right here?
thx

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles