OK, I am sure that this is a really dumb, rookie question, so sorry in advance... I am trying to read through the blockchain and display the receiving address(es) for all transactions in the chain. (Just like Blockchain-Explorer would do.) My library is NBitCoin in C#, so I am not really working through the raw data here. My starting point is the the Hash that is in the output transaction part (TxOut.ScriptPubKey.PaymentScript.Hash). I read in another post that in order to convert that Base160 encoded hash to a BitCoin address I would have to add 00 in front and then do a Base58 encode of the resulting array. So I did that:
Base58Encoding.Encode(ArrayHelpers.ConcatArrays(DoubleZero,TO.ScriptPubKey.PaymentScript.Hash.ToBytes()))
Then I took a sample and compared it with the output blockexplorer.com had for the same transaction, and unfortunately it didn't match. (And yes, I checked the comment made in this question (Deriving the Bitcoin address from the raw block script), my test transaction has a Base160 encoding, so according to my understanding it was sent to an address. The hash is: caf74d35ff967c946f99588cb03b774350d83331 My generated output is: 13q1EyUVtUfvpixnYkDRoZUsi5ZVi Blockexplorer.com shows: 16va6NxJrMGe5d2LP6wUzuVnzBBoKQZKom
Just for the sake of it I tried using all the other hashes in that ScriptPubKey block as well, but none yielded the result blockexplorer.com had. What am I missing here? thx