1

I am needing help with this. i queried the rows whose tx_id = 133903 from tx_out table from postgres.

select * from tx_out where tx_id = 133903;

and i got two rows having two different index 0 and 1. result is below in JSON format.

[
  {
    "id": 240155,
    "tx_id": 133903,
    "index": 0,
    "address": "DdzFFzCqrhskf5Bho1HFpjzFGcVG3avzBMBkP4DUHMJMuqaNmPrt5Cnf1GUxQ3gFxFrbZUHsrxgqUf3fkn5NxjHSDh67SfuKHGLcYYuV",
    "address_raw": "E'\\\\x82D818584283581C3490095835CC47B0D182A0DC054D49816D9782FA42D3D26EFF4F613EA101581E581C740E27451628BDD32329FC359C8FC1C1A48FE25B94908AB8ABB577A1001A7E3A51E8'",
    "payment_cred": null,
    "stake_address_id": null,
    "value": 2936699288244,
    "address_has_script": false,
    "data_hash": null
  },
  {
    "id": 240156,
    "tx_id": 133903,
    "index": 1,
    "address": "DdzFFzCqrht3JYLq1Cc9Y3EeyZvTwzwuu5QZCJqbmjFVMj23miQeSMESfJoSb4f1NNJL9ti1nJryGSB1VK7yFbzkRtcEjamaSvj6LP8k",
    "address_raw": "E'\\\\x82D818584283581CB3CC4806AB502B2EC4FFD82CDA50BF4E5465769B6BCB6C0692C6F797A101581E581CCA3E553C9C63C562EE05D443E8D3D451372D66B450379B9002540A9B001A88AF5021'",
    "payment_cred": null,
    "stake_address_id": null,
    "value": 100000000000,
    "address_has_script": false,
    "data_hash": null
  }
]

Correct me if i am wrong but the address field in the tx_out table basically is the receiver right?? I want to get the sender's address. How do i find out the sender of this transaction? I am having some hard time figuring this out. Basically i want to create a table that contains the address of sender and receiver and amount for all the transaction ever recorded in the postgres table.

0

I am not 100 % sure of this answer; The input is stored in tx_in table and the corresponding inputs addresses can be found by

select * from tx_out where tx_id in ( select tx_in_id from tx_in where tx_out_id =133903);

you are getting the address which are inputs to the transaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.