4

I'm working to understand ERC-20 tokens. I believe that I'm confused on a detail based on a previous SO question. Please allow me to use the Basic Attention Token (BAT) as an example.

I have a Ledger Nano. On that Ledger Nano, I have $1.00 worth of Ether for the purpose of learning how this works. I know I can send and receive Ether via the Ether wallet app. I'm interested in converting that $1.00 of Ether to BAT.

To do, I thought I would use ShapeShift. My question is, where am I sending the Ether to? From my understanding of a previous SO question, you don't have a wallet address for ERC-20 tokens. In other words, someone doesn't formally have a BAT wallet. Instead, the BAT contract manages that for you. At this point, I don't know if I'm misunderstanding something about ERC-20 tokens / wallets, or if ShapeShift just has a confusing UI.

In ShapeShift, you choose what you want to convert from (ETH) and what you want to convert to (BAT). You then say how much (ETH) you want to convert. It then asks you for "your Basic Attention Token address" and "Your Ether Refund address". I was expecting that since I already selected BAT, that the contract address would already be selected. Then the "Ether Refund address" would just be my public Ethereum address.

Do I need to setup a new wallet via MyEtherWallet that is specific for my BAT tokens? I then assume I could use that wallet's public address as the "Basic Attention Token address" in ShapeShift. This seems correct. However, it seems like it contradicts how I thought tokens worked.

Thank you for helping me understand this.

2

You do not need to set up a BAT specific wallet. The key to a wallet is its ability to sign transactions in the ethereum database.

You can ruffly think of an ERC20 token as a "bank" that allows people to sign "checks" for, and thus transfer value in, that token.

Maybe this list will help explain.

  1. The etherum network can be thought of as a database.
  2. The private key owner and only the private key owner of a wallet can sign transactions for the wallets public address.
  3. Transactions are the only way to update the database.
  4. The most basic transaction is to send ether; a feature that is so fundamental to the database that you can think of the ether being stored "in the wallet."
  5. An ethereum contract is a set of rules that specifies how the database can be updated.
  6. ERC20 is a type of contract that follows a convention. Think about it like bank checks, they don't all look the same (some have pictures of flowers on them, some landmarks, some just lines), they don't all send the same kind of money, some send USD, some send CAD, Euros etc... but all have the name, value, account number, routing number etc.. in the same exact place. If you can read one check you can read them all no matter what currency. And most importantly they are not worth anything unless they are signed (Just like the signed transaction in etherum).

Thinking about it this way, you can think of each ERC20 token as a bank that allows for the transfer of a certain currency.

The bank doesn't actually store physical currency some where it just stores a number which denotes the total amount of currency it controls. In a bank that number is made valid by a central authority (e.g. a government) . In ethereum that number is stored and made valid by the database (e.g. on the blockchain).

You can go to the bank with USD and they will update the number of their total USD and the total USD that you have control over (its not like they keep the exact bills you give them to return to you later). That means when they see a check signed by you, as long as you have control of enough of their total USD then they will do the transfer for you.

Or you could trade something (lets say for 100USD) and someone could give you a check for 100USD written on the USD bank. You then take that 100USD signed check to the bank and just like if you transfered USD directly you now have control of 100USD more of that banks total value.

Shapeshift is more like selling something and someone giving you the ability to sign checks for BAT. You are saying "i am going to give you some ETH and in exchange i should be able to sign some BAT checks." Shapeshift then says "brilliant!, who do you want me to write this BAT check out to? You? Your company? Your dog? Oh and if i can't get the tokens where should i send the refund?"

Your wallet doesn't store the token. The ERC20 contract stores your wallet's signature's ability to transfer tokens.

Another alternative to shapeshift is etherdelta. Which might be easier to understand. https://etherdelta.com

1

From my understanding of a previous SO question, you don't have a wallet address for ERC-20 tokens. In other words, someone doesn't formally have a BAT wallet. Instead, the BAT contract manages that for you.

This is correct, you can see this in action on Etherscan; each transaction is just updating the respective balance in the BAT smart contract, ledger - move the number of tokens from one address to another.

In ShapeShift, ...You then say how much (ETH) you want to convert. It then asks you for "your Basic Attention Token address" and "Your Ether Refund address". I was expecting that since I already selected BAT, that the contract address would already be selected. Then the "Ether Refund address" would just be my public Ethereum address.

This probably is just a problem of the user experience not being properly thought about when the app was built. It sounds like they have exposed all of the functionality by default instead of thinking about what 99% of the users want to do and designing around that.

Since ShapeShift is embedded into so many other 3rd party services, it needs to be really flexible - in theory, you might not want to send your BAT tokens to the same address (perhaps you are buying them to someone else or worried about re-using the same address more than once).

Do I need to setup a new wallet via MyEtherWallet that is specific for my BAT tokens?

Nope, any Ethereum, wallet, address can 'hold' a token - as stated above, in reality, it's just an update in the token's smart contract.

If you have the private key for the address, e.g. it's not an exchange's address, then it seems to make sense to enter that as the destination for the BAT token and the returned ETH.

  • Thank you for your response. I'm still not clear though what goes in the "your Basic Attention Token address" and "Your Ether Refund address" fields. Was I correct in thinking that the BAT contract address should go in the first field and the public address of my Ether wallet goes in the second field? – Zach Templeton Nov 19 '17 at 12:46

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.