“Build your first smart contract on EOSIO” Webinar
Block.one’s second EOSIO webinar is over. The topic is “Build Your First Smart Contract on EOSIO”. And our amazing speaker is Rakesh “Bob” Ghatvisave. Bob is a Technical Writer on the Developer Relations team at Block.one. This webinar is an extension to the first webinar. It covered 7 parts. During this webinar, we can learn how to build our first EOSIO smart contract. If you missed it, you can always watch the webinar recording to catch up. I’ve selected some content that I am interested in sharing with you. So let’s get it started.
Introduction to Smart Contracts
EOSIO is one of the fastest, most scalable and user-friendly blockchain solutions. We have seen the massive adoption of the platform by developers and communities. To better understand EOSIO, we need to get the basic knowledge of a concept. It is called “Smart Contract”.
First, let’s start by understanding what smart contract is. Looking at the literal meaning, it’s not hard to guess that it’s about making contracts intelligent. The phrase and concept of “smart contracts” dates back to the early 1990s and was coined by interdisciplinary legal scholar Nick Szabo. He defined Smart Contract in his paper “Smart Contracts: Building Blocks For Digital Markets” which published in 1996. Quoted from his paper: “a set of promises, specified in digital form, including protocols within which the parties perform on these promises”.
It is actually what we’ve just guessed. Smart contracts are on computer systems where the terms of the contract are embedded in the hardware and software. A smart contract can be executed automatically when certain conditions are met.
This concept sounds great, right? Well, you may have more questions as well. Since this concept was proposed back in the 1990s, why the term “Smart Contract” is only gradually becoming known to the public in recent years? Why is there such a strong connection between “Smart Contracts” and blockchain technology? Great questions!
In response to the first why, I think one of the most important reasons is that the technology was lagging behind the theory at the time, and there was no mature digital financial system that could support programmable transactions. But now, with the rapid development of technology, this theory, which was very forward-looking at the time, has become viable.
In response to the second why I think it will be actually pretty easy to understand when I give some comparisons. In daily life, we write contract logic on paper and people sign and stamp it before it comes into effect. Smart contracts are implemented in a computer world where all the logic is encoded at the smart contract. Then there will be technical risks like: there is a high probability that the contract can be maliciously tampered with or hacked. It is because we choose to trust the third parties like banks and Alibaba, we use the services they provide. So our personal property and other information are stored in their computer systems. It is actually not safe. Blockchain technology represents decentralization, and because of its characteristics, we can enjoy a system that is immutable and highly secure. Blockchain-based smart contracts allow us to no longer rely on trusting an organization. It is because of the decentralized, trustless nature of the blockchain that smart contracts can make a real difference. You can check out our last episode, which talked about the characteristics of the blockchain.
We can see the difference clearly in Bob’s image above. Traditional server suffers from such shortcomings: opaque, risk of downtime/failure, and unreliable history. Smart contracts based on blockchain technology just compensate for such shortcomings. It is resilient, transparent and auditable, with an immutable history.
The EOSIO platform
Bob also introduced the EOSIO platform. EOSIO is widely recognized as the most performant blockchain platform which provides fast, cost-effective and secure solutions. As we can see there are many toolkits available for EOSIO Smart Contract development. In the previous episode, I gave a brief introduction to Nodes and Cleos. Today I will give you a brief introduction to EOSIO.CDT. It is EOSIO’s independent and fully functional toolset for smart contracts. EOSIO.CDT is a WebAssembly compilation toolchain based on the WASM platform. In addition to its role as a general WebAssembly toolchain, it also provides optimization for EOSIO. The basic EOSIO smart contract development lifecycle can be seen in the image below.
Accounts and permissions
For regular accounts, the individual’s password is stored on that company’s servers. It is prone to be hacked and there is no transparency. In our daily life, we can also see scandals like some third-party companies cooperate with the so-called “major clients” to secretly gain access to other people’s account information. The blockchain account can provide users with a higher level of security. A blockchain account has three important components: private key, public key, and address. Random number generates the private key, and a cryptographic algorithm generates the public key and address, a one-way irreversible process. We talked about “Cryptographic Hash Functions” in the last episode of Learning EOSIO with Lena. Feel free to check it out if you’re interested. In the image below, we can also get a clear picture of the process of users interacting with EOSIO smart contracts.
EOSIO Smart Contracts
Bob’s webinar also covered a programming practice. If you don’t want to install EOSIO binaries on your local machine, you still have the opportunity to try this simple little program in a web browser.
There is also a tutorial about how to create “Hello World” contract on Block.one’s EOSIO developer portal. Bob demonstrated in detail the whole process of outputting “Hello World”. You can choose to watch Bob’s webinar recording or follow the tutorial at EOSIO Developer Portal to get hands-on experience.
We are able to learn more about other great topics in detail with Bob’s guidance. There is also an interesting Q&A part at the end of the webinar. If you missed this webinar, you can always watch its recap.
Lena Wang is an EOS Nation intern that has been with us for almost 2 years now. In 2015, Lena began her university study in the faculty of computer science of Sichuan University. For now, she is studying for her master’s degree with a full scholarship at Sichuan University, located in Chengdu, China. Due to her major, she has a strong interest in blockchain and she’s honored to be a part of EOS Nation and make some contributions by writing and translating articles about EOSIO.