theQRL / QRL

Quantum Resistant Ledger
https://theqrl.org/
MIT License
417 stars 109 forks source link

Cannot determine from-address for a transaction with the API #1690

Closed som-dev closed 4 years ago

som-dev commented 4 years ago

Using testnet with v0.2.0.

Calling qrl_pb2.GetBlockByNumberReq() for 12703, in the list of transactions, I cannot determine the from-address for transaction 05f0859e14cd10357661e92d7c3d5a358c04bb0155af0daf47620db6eef65136.

If I call qrl_pb2.GetTransactionReq() for this transaction, I also cannot determine the from-address.

The block explorer does display the from address so I feel like I am doing something wrong?

The odd part is that the to-address is a multisig address. Seems like non-multisig transactions will have a from-address or master-address populated. Not sure if I am using old API or misinterpreting the results.

Here is my output: $ ./qrl-query.py 12703 INFO:root:Connected to 127.0.0.1:19009 INFO:root:Query of block number detected INFO:root::{ "block": { "genesis_balance": [], "header": { "block_number": "12703", "extra_nonce": "15176262144", "hash_header": "ia/8mbyDaQYF81i89zxoXhZDm6ZiRtOx809CosMAAAA=", "hash_header_prev": "6yxC+ym5DdyRqFcw3kk58LUUFY40eAxPMCHF0w8EAAA=", "merkle_root": "YAhKt2b2qDF17t/3CLyfDgCGtX1Qz00p+GwRN+wClfI=", "mining_nonce": 1356663296, "reward_block": "6642294635", "reward_fee": "1000000", "timestamp_seconds": "1583710173" }, "transactions": [ { "coinbase": { "addr_to": "AQYAxhDiJBN6W+at3VgtlX4XU/e+BAK9YZ6wN3ra4P4Y4kcesk8o", "amount": "6643294635" }, "fee": "0", "master_addr": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", "nonce": "12704", "public_key": "", "signature": "", "transaction_hash": "dVBPqk33OUSUhwDWZDwsF/vP2hZeJW3sHch+O67VHjE=" }, { "fee": "1000000", "master_addr": "", "nonce": "2", "public_key": "AQUAr+2YPRCCH9g8pnIIo/Lgp19TpW7aBJyX5ZNdVqkg9r/wENoGBFl1wry6Yi50DXGqIbnSOevFCiN6KYKhIFzEVA==", "signature": "AAAAAYfjKIfG0qPlz5wCSQRqhfAv4zR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FvoYypQc8l/Ps9i2sBErEYr9L6bIBaOv4KeS7UDVP33/fI1ncN2/M6/EtsgwQYANgUyE4w==", "transaction_hash": "BfCFnhTNEDV2YektfD1aNYwEuwFVrw2vR2INtu72UTY=", "transfer": { "addrs_to": [ "EQAAXozQ2cU9J/FKTBP0mMIwYfd0j8yOfxrQoB05fIt4oBhwux7H" ], "amounts": [ "200000000000" ], "message_data": "" } } ] } }

$ ./qrl-query.py 05f0859e14cd10357661e92d7c3d5a358c04bb0155af0daf47620db6eef65136 INFO:root:Connected to 127.0.0.1:19009 INFO:root:Query of tx detected INFO:root::{ "addr_from": "", "block_header_hash": "ia/8mbyDaQYF81i89zxoXhZDm6ZiRtOx809CosMAAAA=", "block_number": "12703", "confirmations": "15031", "timestamp": "0", "tx": { "fee": "1000000", "master_addr": "", "nonce": "2", "public_key": "AQUAr+2YPRCCH9g8pnIIo/Lgp19TpW7aBJyX5ZNdVqkg9r/wENoGBFl1wry6Yi50DXGqIbnSOevFCiN6KYKhIFzEVA==", "signature": "AAAAAYfjKIfG0qPlz5wCSQRqhfAv4zRlpMimRxuhBqg2JVUcIyTiSLEIJzI3fadnUix6ojGb6Aciupi4cW92Y+pEP8PYogBsS12mYA1y2fOfxVQhAi/ZgPenC76LZGgnUinpl8aOJDTwCo1NfG1n7C3QutvpaPCOnqwSwqQ2cqijf6KC0fIytkWAiAoEIjt6J7IB3f+QFsI9K0L+5oOddZHrLoQknIkNqO/dhLCG7yIUuT0HFnJi4f7U5nGxbUrk1jvtKH6YNei0tB2Fh6KEl49QOWA1owvRJjM64L9ZLsKZkFHOVQOYJAIlI8jMICs1qzPqsVTef0x/wywRnfPXo3eNsQQlUkkm8xRRC0dJWczruQ5vSz3OP4JUXSZwcToJ34anVP4hDYTyAMORQsiFzIOHHA4dAb50wmcpSYpsPc4PY6gcrqQA4+3qWLpOXp4CsTexXyC3o7Yhyzj1jA5ZbsREIYYDFPSUWl+s5jmbhYSXt+PMor5oFfCD3qliJ/KBkPBJ2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KnrxJ2CjCUmg5tAfJwsu3nOe1O1tqW5Zo8Ld6ZbBC/QVaEfaqYQTYoBGgUVecev6xdnfcdXxbumpUKscEPuwpb/8OYCT9vq1IHgryw8Ok+ewVx0NZnJ/ZgiQGKvboRFIAY3EgATa3sDOm5SpRJhEj8Qg2Gv6qvI8IZ6Le+CofQ5zm0ftN9LDsNtuXPOHN5WbmFJPEw4+pSyQzqJkf/GmFRaFUE/S4m4UG77sb2YeDek7NUI3r9UW2760lBYkzYzj1E4Scf/+kAauAqeyXIDXlfbvtaFu3tFVksHzApiItmFAhl5GnAYPBF586YmdWd4oCCvZYCdv2YNugwlHbO16Y3YPf/YgW0qSt5n3V/IP0hRtpMwc/lNJLARZxEi7p29whJngPTXdTdg4Rk43DrCSYlBpQFB+LFLbGl4XNqgKGxcBKFmqfnhBocGrrK5sIUk8eooUj3/WVIkjrMQ6KjfnIOZaI3dQghPmvgWjJGIPHZ7eZMNxVXMLki/AjcOrNZTjwU8U9uqMPeA75k6vKtfVyln7eX4c+9QnBziyYCD3n3YO4InKl7zcz6ptviSaPPlaIX9FvoYypQc8l/Ps9i2sBErEYr9L6bIBaOv4KeS7UDVP33/fI1ncN2/M6/EtsgwQYANgUyE4w==", "transaction_hash": "BfCFnhTNEDV2YektfD1aNYwEuwFVrw2vR2INtu72UTY=", "transfer": { "addrs_to": [ "EQAAXozQ2cU9J/FKTBP0mMIwYfd0j8yOfxrQoB05fIt4oBhwux7H" ], "amounts": [ "200000000000" ], "message_data": "" } } }

cyyber commented 4 years ago

The addr_from is not provided by the API, neither the field addr_from exists in the QRL transaction. addr_from is derived from the public_key if master_addr is empty. If master_addr exists then addr_from is the master_addr and the address derived from the public_key is the address that signed the transaction for master_addr due to Slave relationship.

som-dev commented 4 years ago

Thanks for the explanation, I figured I was interpreting something wrong.