Logged Conversation (all times UTC)
[10:33] <stellar-slack> This is a bit of a long shot, but before I spend my saturday night with the stellard source, is it possible to recreate the tx hash from the binary result you can get from the websocket api?
[12:12] <stellar-slack> @dzham:
[12:12] <stellar-slack> Given a tx with binary value:
[12:12] <stellar-slack> ```1200002200000000240000005861D4838D7EA4C6800000000000000000000000000055534400000000005E7B112523F68D2F5E879DB4EAC51C6698A6930468400000000000000A69D4839696F3392000000000000000000000000000555344000000000050FCCA71E98DFA43305149F9F0C7897DE5A9D18C732102EAE5DAB54DD8E1C49641D848D5B97D1B29149106174322EDF98A1B2CCE5D7F8E744630440220791B6A3E036ECEFFE99E8D4957564E8C84D1548C8C3E80A87ED1AA646ECCFB16022037C5CAC97E34E3021EBB426479F
[12:12] <stellar-slack> 450FCCA71E98DFA43305149F9F0C7897DE5A9D18C83145E7B112523F68D2F5E879DB4EAC51C6698A69304011231550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E6FF318D3A0AEF277858BD4D9751ECECD16779C0CC86D000000000000000000000000055534400000000008D3A0AEF277858BD4D9751ECECD16779C0CC86D0317588B8DBDC8932DC410E8571045466C03F5A6B690000000000000000000000005553440000000000758
[12:12] <stellar-slack> 50FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E600```
[12:12] <stellar-slack> And knowing that the Transaction ID prefix is:
[12:12] <stellar-slack> ```54584E00```
[12:12] <stellar-slack> The Transaction ID (not hash as in ledger index) can be recreate with this command line snippet which demonstrates the SHA512Half process:
[12:12] <stellar-slack> ```$ echo
[12:12] <stellar-slack> "54584E001200002200000000240000005861D4838D7EA4C6800000000000000000000000000055534400000000005E7B112523F68D2F5E879DB4EAC51C6698A6930468400000000000000A69D4839696F3392000000000000000000000000000555344000000000050FCCA71E98DFA43305149F9F0C7897DE5A9D18C732102EAE5DAB54DD8E1C49641D848D5B97D1B29149106174322EDF98A1B2CCE5D7F8E744630440220791B6A3E036ECEFFE99E8D4957564E8C84D1548C8C3E80A87ED1AA646ECCFB16022037C5CAC97E34E3021EBB4
[12:12] <stellar-slack> AA0811450FCCA71E98DFA43305149F9F0C7897DE5A9D18C83145E7B112523F68D2F5E879DB4EAC51C6698A69304011231550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E6FF318D3A0AEF277858BD4D9751ECECD16779C0CC86D000000000000000000000000055534400000000008D3A0AEF277858BD4D9751ECECD16779C0CC86D0317588B8DBDC8932DC410E8571045466C03F5A6B690000000000000000000000005553440000000
[12:12] <stellar-slack> B6931550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000005553440000000000550FC62003E785DC231A1058A05E56E3F09CF4E600" | xxd -r -p | gsha512sum | cut -b-64
[12:12] <stellar-slack> e08d6e9754025ba2534a78707605e0601f03ace063687a0ca1bddacfcd1698c7```
[12:12] <stellar-slack> This might help understand:
[12:13] <stellar-slack> @donovan: Awesome! Yeah, the document is a bit lacking :simple_smile:
[12:13] <stellar-slack> So tx_blob only, I don't need to bother with meta?
[12:16] <stellar-slack> A Transaction ID uniquely identifies a transaction before it is submitted to the network and cannot change, no matter what outcomes it produces (i.e. the meta data). Once the transaction has been accepted into a ledger, the metadata is appended along with it's transaction ID into a leaf node in the SHAMap and committed to the nodestore. The hash of this value is used as the key in the tree. So the answer to
[12:17] <stellar-slack> Transaction ID (called hash in the JSONRPC and websockets API response fields) is that you only need the tx and not the meta.
[12:17] <stellar-slack> Plus the special prefix value: `54584E00`
[12:24] <stellar-slack> STX
[12:24] <stellar-slack> Ah, so it's the signing_hash
[12:27] <stellar-slack> ignore that
[12:27] <stellar-slack> No, that's `53545800` which gets prefixed before the transaction without a signature, and is used to create the signature. The Transaction Id, which is what everyone is used to, is created with `54584E00` (TXN) after the signature has been added :simple_smile:
[12:28] <stellar-slack> If you look at the binary of a transaction, the signature is the tail end.
[12:29] <stellar-slack> np :simple_smile:
[12:29] <stellar-slack> http://godoc.org/github.com/rubblelabs/ripple/data#pkg-constants
[12:30] <stellar-slack> With any luck, all of this will be a lot simpler in the new Stellar :simple_smile:
[12:30] <stellar-slack> Hopefully :simple_smile:
[12:44] <stellar-slack> Ah, 20 minutes later I realize my tx_blob was still in ascii
[12:44] <stellar-slack> Time to leave the keyboard for tonight :simple_smile:
[19:32] <stellar-slack> Guys, did you see that @bartek hid an easter egg somewhere in one of our API's? "It's a hidden data that has a special meaning. Where should you start searching for it? Check a communication between stellar client and our servers."
[23:38] <stellar-slack> on easter even!
About StellarVerse IRC Logger
StellarValue IRC Logger
is part of