Introduction to Blockchain | Advanced Understanding of Smart Contracts-Implementation

On July 30, 2015, the first block of Ethereum was dug out, and Ethereum officially entered the stage of history. As a result, smart contracts have also become popular. We can see from Google Trends that smart contracts are related to Ethereum.

The concept of smart contracts was introduced by Nick Saab in 1995. At that time, there was no Bitcoin, no blockchain, and no Ethereum.

Nowadays, the mainstream cognition is binding smart contracts with Ethereum (or Ethereum-like projects). Ethereum is a smart contract platform. Anyone can publish code that defines certain contract attributes on Ethereum and entrust it to the Ethereum network to run.

Just as Jack Ma developed the Taobao platform, people can open online stores on Taobao. Running an online store does not require the store to deploy its own servers. The back-end of the online store runs entirely on Taobao.

At present, smart contract instances with high influence are basically running on Ethereum. The most widely used ones are token issuance, DeFi, and decentralized gambling.

Regarding the application direction of smart contracts, the mainstream information now has more consensus on smart contracts to transform traditional contracts into smart contracts. Traditional contracts use social customs and laws to define the rights and obligations of participants. Customs and laws are the source of binding force behind contracts. Smart contract transformation is expected to take the source of binding force in the code.

This is why smart contracts are tied together by Ethereum and Ethereum-like projects. Because Ethereum provides a binding code execution platform. Ethereum is designed as a world computer that allows programs to run independently of specific centralized servers.

Bitcoin enthusiasts are very dissatisfied with the brilliant performance of Ethereum on smart contracts, and they also think of a lot of ways for the Bitcoin network to undertake smart contract business.

The Bitcoin system has a built-in script engine to complete the programmability of the ledger. Ethereum uses a virtual machine. The latter is Turing-complete and can be used to run very complex programs. Coupled with Bitcoin's UTXO design, Ethereum is an account design. The former can only design stateless contracts. This means that the contract code on Bitcoin cannot use its intermediate state generated by itself. Bitcoin script programs are one-time, only valid for this transaction, and cannot be referenced by other transactions. Bitcoin's script code can't read data either, you can't write a program to order a certain transaction of Bitcoin to get specific parameters. There are very few exceptions, such as the block CSV instruction, which allows Bitcoin scripts to rely on block height to respond. Correspondingly, Ethereum's virtual machine does not have these obstacles.

However, the Bitcoin network can still accept specific smart contracts. The P2SH transaction format allows code to be embedded in scripts and can be used to implement specific application scenarios. Core developers working on Merkel's Abstract Syntax Tree (MAST) are expected to build Bitcoin scripts into more complex code.

BCH has implemented opcodes such as OP_CHECKSIGVERIFY. The script can verify external data (Oracle) and can be used to build decentralized arbitrated asset transactions. For example, local.bitcoin.com released by Bitcoin.com is a decentralized asset trading platform. This opcode can also be used to build decentralized betting.

But whether it is using Ethereum's smart contract platform or the Bitcoin script engine to implement smart contracts, it is the idea of ​​transforming traditional contract smart contracts. The idea is obviously to have a hammer in your hand, to see everything is a nail. Now that there is a smart contract platform, it is like having a hammer. You have to hammer all the traditional contracts with this hammer. In fact, the traditional contract does not need to be transformed in most cases.

This idea is a dwarf of smart contracts.

As described in the previous article "Preliminarily Clear Understanding of Smart Contracts", Bitcoin mining is a perfect smart contract. Mining is a brand-new creation of a business paradigm, an intelligent business paradigm.

This is an idea for the development of smart contracts, creating a new business paradigm.

Any chain, whether it is PoW or PoS, is actually a similar business paradigm case. In the PoW chain, miners deliver proof of work, help users package transactions, and issue Coinbase rewards. In the PoS chain, nodes deliver proof of coin age, help users verify transactions, and issue coin rewards.

In a decentralized exchange, the two parties involved in the transaction are point-to-point, and both parties control their own assets before closing. During the transaction, there is no third party involvement. The decentralized exchange is also a self-operating, open and transparent smart contract that does not require authorization.

Similar to Openbazaar, it is a decentralized Taobao, and participants are also self-running commercial platforms that do not require registration. It should be noted that Openbazaar does not record all commercial transactions.

Perhaps, when designing a blockchain project, we first want to understand how to design a smart contract with self-consistent business logic.

When Nick Saab proposed the concept of smart contracts, Bitcoin and Ethereum were not born. An automated program that limits smart contracts to a certain smart contract platform is a dwarfing of the concept of smart contracts. Return to the original intention of smart contracts, reduce business costs, reduce default risks, and expand business scope.

Author: Huang Shiliang

Welcome to WeChat public account: Lightning HSL, H13116885

Welcome to BTM: bm1qefc720au672awrgazgw5c3kx7etr5kejju02p7

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Opinion

Caroline Ellison testified in court Acting on the instructions of SBF, embezzlement of approximately $14 billion in FTX client funds.

The Manhattan courtroom was crowded on Tuesday as Caroline Ellison, the former girlfriend of SBF and former CEO of Al...

Blockchain

Getting Started | What is an aggregate transaction? What are the operating principles and advantages?

Recently, the concept of aggregate transactions has been repeatedly mentioned, how is aggregated trading realized? Wh...

Blockchain

Babbitt column | Case study: Exchange "downtime", does the holder lose any compensation?

Source of this article: Xiao Sa Author: Tan Hao Guo Xiao Sa The currency circle trading platform advertises that &quo...

Blockchain

Interpreting FTX's preliminary restructuring plan Cash compensation is adopted, excluding FTT holders.

At present, the restructuring plan of FTX is still in its early stages. The team will submit a revised plan and discl...

Blockchain

"Black Horse" Exchange FTX Receives Liquid Value to Participate in Round B Investment, The Next Crypto Unicorn Is Coming Soon

The Hong Kong-based FTX exchange appears to be the latest unicorn cryptocurrency company with a valuation of $ 1 bill...

Policy

Crypto Exchange FTX to Sell Trust Assets: Debtors Making a Desperate Cash Grab!

The debtors have suggested forming a pricing committee that includes representation from all stakeholders in addition...