0

I'm unsure how to get the UTXOs that a transaction is spending.

Here's what I have so far. I get transaction details from txhash

web3.eth.getTransaction("0x97df3cd87f87bb6f04e643b66f495e993e9c128632549c539c76caf1ca8d1e2a").then(function(receipt){
  console.log(receipt);
});

It provides

blockHash:"0x13c008fbe05e6a181cdecdc434d1a0dd089918cd71861650131e00a69997dbe9"
blockNumber:6810576
from:"0xF092966e7bcc2b5646e0F0c20A715584DB37cd4B"
gas:600000
gasPrice:"20000000000"
hash:"0x97df3cd87f87bb6f04e643b66f495e993e9c128632549c539c76caf1ca8d1e2a"
input:"0x"
nonce:1135
r:"0x47397afae235efb00910e69da29ff30177ecf227619c09cdb50af880d24c20ea"
s:"0x7df404ca4bec847e45ec3934e5b8047136a9a5207d9801795d5d05673105a7c6"
to:"0xb60fdD0914b966b38EcFeFB9cb98C86F920EC7f6"
transactionIndex:4
v:"0x1c"
value:"3000000000000000"

This has the from address and the value, but what are the UTXOs that the value is coming from?

  • It is not very clear what you are asking. Can you give an explicit example of what you are trying to do? – Shawn Tabrizi Dec 4 '18 at 5:57
  • @ShawnTabrizi , i updated my question – Sammu Sundar Dec 4 '18 at 6:13
3

In Ethereum, there is nothing like inputs or outputs as in Bitcoin. It doesn't work on the concept of UTXO. To know the address from which amount is deducted, check the from field of a transaction. In that particular transaction, you cannot know that the Ether that you are spending, is received from where. But as a whole you can know about all of your incoming and outgoing transactions.

See explorer: https://etherscan.io/

For more, see this: What are the pros and cons of Ethereum balances vs. UTXOs?

  • A.K you mean we not able to get the transactions of how current transaction amount came to our account. Am i correct ? is my understanding correct ? – Sammu Sundar Dec 4 '18 at 6:39
  • the field from tells you from which account the ether is coming. – Jaime Dec 4 '18 at 6:44
  • @SammuSundar i have updated the answer – Aniket Dec 4 '18 at 6:49
  • Thanks @A.K. Now i understand the transaction in ethereum. Is it possible to get recent input transaction of the account – Sammu Sundar Dec 4 '18 at 9:28
  • Yes, you can get the list of all transactions and filter the input transaction. Also if it answers your question, mark it correct answer – Aniket Dec 4 '18 at 10:02

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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