Noobs Guide to Understanding ERC-20 vs ERC-721 Tokens

Confused by tokens? Don’t be. Here’s a handy-dandy guide. The goal here is to de-mystify blockchain tokens and stem some of the foolishness in the market.

How are tokens defined?

Before we go deeper, let’s be clear what tokens are on Ethereum. A custom token of any type in Ethereum is just part of a token “contract”.

Each token is it’s own mini-database of who owns what. The “token” is just an entry in the token contract, and who “owns” a token is recorded in the contract. A token is never in “your” wallet.

Instead, your token is just an entry in the token contract database that says something like:

0xYOURWALLET = 2000 tokens

So then what are ERC-20, ERC-721, etc?

These are contract INTERFACES. When someone says they have an “ERC-20” token that just means that the token contract responds to a common set of commands. That’s all. It means that the token can be transferred, requested, approved, etc in the same way as any other ERC-20 tokens. It does NOT mean the token has value. It does NOT mean the token actually does anything interesting. In fact, by itself it means almost nothing. So if someone is acting all smug they have an ERC-20 token… ignore them.

Here is the interface for ERC-20:

Even if you can’t code you can probably guess what some of these things do. So if that applies to you stop and actually look at the code above and read it.

As you can see the functionality is pretty limited. You can see how many of the token there are (totalSupply) and the balance that someone has, and finally a few ways to move the tokens around. That’s it. That is all.

An interface defines WHAT something does, not how it does it. ERC-20 is an interface. An ERC-20 token can have the interface and still do basically nothing. This can’t be said enough: Having an ERC-20 token is MEANINGLESS. If someone asks for money for their ERC-20 token and the best reason they can do is that they have an Eth token, ignore them.

More advanced Tokens

ERC-721 is a more advanced token that is “non-fungible”. Think of ERC-20 as the token type for things that are money (any $5 bill is worth the same as any other $5 bill, usually) and ERC-721 as the token type for collectibles (it’s the Ethereum equivalent of baseball cards).

In ERC-721, each token is completely unique and non-interchangeable with other tokens. Another example: Pets. Many people have dogs, but THAT dog is theirs and they will not accept some other dog as a substitute. You can use ERC-721 tokens to represent those dogs and dog ownership.

Makse sense? Great! If not, please put comments.

More about blockchain

If you really want to understand blockchain and what it means for the future of technology, check out my new book: Blockchain Quick Reference

Here’s the definition for ERC-721

Like ERC-20 this is an interface: what it can do, not how it does it. ERC-721 defines a set of behaviors and events that the token contract can do that involve the movment, ownership, and information about non-fungible items like baseball cards, pets, and other items where ownership of specific unique items is needed.

If you are making some sort of game on Ethereum, this is probably what you are looking for in 99% of cases. Weapons, cryptokitties, Magic The Gathering cards, whatever: this is how they would be represented in Ethereum.

O hai! My name is tokenId: 1CUTEKTY

Summary:

ERC-20: For money and money-like tokens.
ERC-721: For things and thing-like tokens.

In both cases, don’t be too impressed if someone says they have an ERC-20 or ERC-721 token. It’s about the ecosystem AROUND it.

Follow for more

Let me know if this clears things up. Feel free to follow and clap if you want more content like this.