[Ethereum] Wallet for ERC-20 Tokens

erc-20

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.

Best Answer

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

Related Topic