In this blog post, we will give you a brief introduction to Ethereum and Smart Contracts. We will explain what Ethereum is and how it works. We will also delve into smart contracts, how they work in Ethereum, and the benefits of using them. Finally, we will take a closer look at three token standards – Erc-20, Erc-721 Erc-1155 – and explain the differences between them.
Ethereum and How it Works
Ethereum is a blockchain-based platform that enables developers to build decentralized applications (dApps). What differentiates it from other platforms, at least until recently, is smart contracts. Smart contracts that run on Ethereum can be used to automate processes or create agreements between two or more parties.
Ethereum, as we know from our previous article, works on the Proof of Work consensus mechanism. It runs a network of nodes, each of which stores a copy of the Ethereum blockchain. When someone wants to run a smart contract on Ethereum, they first have to submit it to the network for approval. Once the contract is approved, it is stored on all the nodes in the network and can be executed by anyone who has permission to do so.
But what is a smart contract?
Smart Contracts
Smart contracts are pieces of code that can be deployed on the Ethereum blockchain where they can execute transactions automatically. They run when one or more preconditions have been satisfied.
Smart contracts in Ethereum are written in Solidity, a programming language that is specifically designed for this purpose. Solidity borrows much of its design from Javascript, C++ and Python, but it also has some features that make it better suited for writing smart contracts.
One of the benefits of using smart contracts is that they can help you to automate transactions. For example, if you wanted to sell a piece of digital art, you could use a smart contract to automatically transfer the ownership of the art to the buyer as soon as they make payment.
Another benefit of smart contracts is that they can help to reduce the risk of fraud. This is because all transactions that are executed by a smart contract are stored on the Ethereum blockchain, which is public and transparent. This means that someone can't change the terms of a smart contract after it has been deployed.
These smart contracts are the basis of the token standards we have right now. Three popular token standards are used on the Ethereum blockchain: Erc-20, Erc-1155, and Erc-725.
ERC-20
Erc-20 is the most popular token standard on Ethereum. It is used for tokens that represent a fungible asset, such as a currency or a commodity. This ensures any give token has the same value as any another token. Erc-20 tokens are widely adopted, easy to use, and compatible with Ethereum wallets.
The token standard defines a set of rules that tokens must follow in order to be compatible with the Ethereum ecosystem. These rules cover buying and selling, transferring, approving, and accessing data and balances.
ERC-20 tokens are easy to transfer and can be stored in any compatible Ethereum wallet such as Metamask. They also offer a wide range of data that is accessible to users, such as the total supply of tokens and transaction history.
The ERC-20 standard has been widely adopted by developers but, as is the case with many smart contracts, smart contracts have limitations and flaws.
Examples of ERC-20 tokens are Tether(USDT), Shiba INU(SHIB), Wrapped BTC(WBTC), Basic Attention Token(BAT), and many others.
ERC-721
ERC-721 is a non-fungible token standard on the Ethereum blockchain. It allows for the creation of unique tokens, which are often called "crypto-collectibles". Each ERC-721 token is unique and can be traded, sold, or exchanged like any other asset.
We have talked extensively about NFTs and the various NFT types in a previous article. ERC-721 smart contracts are what turns these assets (images, music clips, etc.) into non-fungible tokens. So, what does ERC-721 do to make them non-fungible?
This token standard covers the same ground as the token standards such as transfer and approval. The differentiator is its assignment of an ID to uniquely identify each token. This is what makes them well suited for representing digital assets that are unique, like artwork or collectible items.
ERC-1155
Erc-1155 is a new standard that covers NFTs. Like ERC-721, it is designed for tokens that represent non-fungible assets, such as digital art or collectibles. Its design was informed by ideas from ERC-20, ERC-721, and ERC-777, and as such, has borrowed functionality from these well tested fungible and non-fungible token standards.
This token standard represents multiple tokens via a single contract. An ERC-1155 token can represent multiple NFTs, and provide a count of the tokens in a collection. This is the primary enhancement that differentiates it from ERC-721.
This token standard also aims to save on gas fees for projects that require multiple tokens. Instead of deploying a new contract for each token, which quickly and unnecessarily ramps up gas fees, it will only deploy one contract for all tokens, greatly reducing the cost of minting all tokens.
We hope you found this brief overview of smart contracts, ERC token standards and how they operate within the Etherium ecosystem useful. In future posts, we'll take a more in-depth look at how to create and use ERC- NFTs. Stay tuned!
As always, we welcome comments and questions in the discussion area below.
コメント