Trying to parsing from the Exodus address (and build a database).
The code below looks like a multi sig transaction. How can I get the public key ?
Sender
1MCHESTbJhJK27Ygqj4qKkx4Z4ZxhnP826 is the
Receipients
1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P
1MCHESTxYkPSLoJ57WBQot7vz3xkNahkcb
Are the address below the data?
1HiYAgHPd3F7Sr4nxpa8q8RyYPEzWinMQ3
13Zh6iGo3uRdL3ACgrj4mMkNtRF9Yoj4MR
{[
{
"n": 0,
"value": 9950000,
"addr": "1MCHESTbJhJK27Ygqj4qKkx4Z4ZxhnP826",
"tx_index": 94812526,
"type": 0
},
{
"n": 1,
"value": 6000,
"addr": "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P",
"tx_index": 94812526,
"type": 0
},
{
"n": 2,
"value": 6000,
"addr": "1MCHESTxYkPSLoJ57WBQot7vz3xkNahkcb",
"tx_index": 94812526,
"type": 0
},
{
"addr2": "1HiYAgHPd3F7Sr4nxpa8q8RyYPEzWinMQ3",
"n": 3,
"value": 12000,
"addr": "13Zh6iGo3uRdL3ACgrj4mMkNtRF9Yoj4MR",
"tx_index": 94812526,
"type": 1
}
]}
Hey Bitoy,
It looks like you're talking about transaction cca8984303daf2304845b72cfe3b797b391792db7fad28f38cb3d8cb3296908c here.
If you're using the masterchest library, you can parse (including decryption to cleartext and packet decoding) with a one-liner:
Dim txdetails As mastercointx = mlib.getmastercointransaction(bitcoin_connection, cca8984303daf2304845b72cfe3b797b391792db7fad28f38cb3d8cb3296908c, "send")
Then just simply check with something like
If Not IsNothing(txdetails) to make sure you have a mastercointx object and use the object properties as you need. Properties of a mastercointx object include fromadd, toadd, value, type, blocktime, blocknum, curtype etc.
This is what masterchest engine does, building up a database of all parsed transactions before running a second 'processing' function to work out balances & which transactions are valid (eg whether the sending address had funds etc).
If you're not using the library and doing your own implementation, my advice is to try not to think about data as addresses in a Class B like you would in Class A. The addresses in our multisigs don't matter, only the compressed public keys. So in your quote above where you have the addresses from the multisig, they're irrelevant - you'll need to take the compressed public keys from the multisig output and work with them.
{
"value" : 0.00012000,
"n" : 3,
"scriptPubKey" : {
"asm" : "1 021bfc32c40f01efd61535cae8b297257e536b140ee6c727f576698e70d24cf575 0270d93998cd9653541a6f1cfc50eddffafd936ab54495a5a8526abd08510fffd0 2 OP_CHECKMULTISIG",
"hex" : "5121021bfc32c40f01efd61535cae8b297257e536b140ee6c727f576698e70d24cf575210270d93998cd9653541a6f1cfc50eddffafd936ab54495a5a8526abd08510fffd052ae",
"reqSigs" : 1,
"type" : "multisig",
"addresses" : [
"13Zh6iGo3uRdL3ACgrj4mMkNtRF9Yoj4MR",
"1HiYAgHPd3F7Sr4nxpa8q8RyYPEzWinMQ3"
]
}
}
So here we can see we have the senders public key of 021bfc32c40f01efd61535cae8b297257e536b140ee6c727f576698e70d24cf575, this can be used to redeem the multisig output. We also have a data public key of 0270d93998cd9653541a6f1cfc50eddffafd936ab54495a5a8526abd08510fffd0.
We work out the sending address (our largest input - 1MCHESTbJhJK27Ygqj4qKkx4Z4ZxhnP826) and we can then do our SHA256 hashing and XORing (as has been discussed at length over the last few pages) to get the cleartext packet (010000000000000001000000002060BA100000000000000000000000000000) from our obfuscated public key.
Hope that helps, but please feel free to ask any more questions