17

In Ethereum-Mist_wallet, Under accounts, I see:

Accounts can't display incoming transactions, but hold and send ether. To see incoming transactions create a wallet contract to store ether.

What does this exactly means? On my private network I am able to see transactions of specific account under Latest Transactions. So what this is for?

7
+50

Th ere are two types of accounts in Ethereum:

  1. Externally Owned Accounts,controlled by private keys
  2. Contract Accounts, controlled by their contract code

Accounts can't display incoming transactions, but hold and send ether

Here accounts refer to EOAs. EOAs are able to hold and transfer ethers but they can't display the incoming transactions.However, they can display the transactions send from account, like transferring ethers or contract execution.
For eg, If you transfer some ethers from etherbase(Account1) to other account, say Account2. Account 1 will show the transaction details but account will not show anything under Latest Transactions Tab.

Account1 Latest Transaction Tab

To see incoming transactions create a wallet contract to store ether.

However if you have to keep track of incoming transactions to an account you have to create a wallet contract.
Now if you transfer ethers from Account1 to your walletContract(say it be WalletContract1), both Account1 and WalletContract1 will show the transactions.
So, Wallet Contracts also keep a list of incoming transactions whereas EOAs don't.


There are differen types of wallet contracts like :

  • Single Owner Account
  • MultiSignature Wallet Contract

which offer a lot better features than normal EOAs. But creating a wallet contract requires transaction fee (gas). Read full description here.


Read the difference between EOAs and Wallet Contracts here.

0

You can get transactions that do nothing else besides move ether from account A to account B, signed by account A; by simply listening to new blocks and filtering tx with to === B. But to catch "internal transactions", that is, smart contracts sending ether to account B, you'd have to go through execution traces and pick out the opcodes that do ether sending. Alternatively, you can check the account B balance after each tx and notice changes.

With ERC20 tokens, however, you can simply subscribe to Transfer event, even automatically filter it by the recipient:

const filter = myToken.events.Transfer({ filter: { to: B } })
filter.on("data", event => {
    console.log(`Received ${event.returnValues.tokens} tokens!`)
})

// later...
filter.unsubscribe()

This method will be available in Ethereum 2.0 for Ether as well, if the plans go ahead to make it an ERC20 token that lives in a fixed address such as 0x00. For now, tracking ether is easiest done by invoking eth.getBalance(B) after each block.

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.