paint-brush
Script technology, Smart Contract, and Readable DeFi Contract — Where is Bitcoin Headed?by@kenyou
176 reads

Script technology, Smart Contract, and Readable DeFi Contract — Where is Bitcoin Headed?

by Ken YouSeptember 8th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Evaluating three key contract technologies in the Bitcoin ecosystem: Script Technology, Smart Contracts, and Readable DeFi Contracts.
featured image - Script technology, Smart Contract, and Readable DeFi Contract — Where is Bitcoin Headed?
Ken You HackerNoon profile picture

The scalability of Bitcoin can be broadly categorized into two main directions: on-chain and sidechain. On-chain, as the name suggests, involves upgrading the original Bitcoin blockchain or scaling its capabilities through on-chain technologies.


Sidechain solutions, on the other hand, require the transfer of Bitcoin to another blockchain, either one-way transfer/peg or two-way peg, to scale Bitcoin's capabilities.


Whether it's on-chain or sidechain, contract technology is one of the core aspects of Bitcoin's scalability. In the current Bitcoin ecosystem, there are three primary directions for Bitcoin contracts: Script technology, Smart Contract, and Readable DeFi Contract.

Script Technology

The current Bitcoin mainnet has achieved scalability through two primary methods: Lightning Network and Ordinals. However, both of these solutions are ultimately built after the Segregated Witness (SegWit) upgrade. SegWit is essentially a patch technology that addresses some of Bitcoin's previous shortcomings by segregating digital signatures from transactions and storing them separately.


A Timeline of Bitcoin Updates and Ordinals


From the perspective of Bitcoin's historical development, the growth of the Lightning Network played a significant role in driving the adoption of the SegWit upgrade. This is because the Lightning Network relies on timelocks, which require the use of Bitcoin's script technology.


The essence of Ordinals is similar; after the Taproot upgrade, Bitcoin can execute more complex transactions using scripts, and Ordinals leverages this scripting capability. The advantage of script technology is that it operates on the Bitcoin mainnet, which provides a high level of security.


However, script technology has severe limitations in terms of programmability, and it is entirely incomprehensible to the average user. Furthermore, Ordinals and Lightning Network each focus on different use cases—NFTs and payments, respectively—and they do not adhere to a unified standard.


Additionally, the byte data generated by Ordinals essentially amounts to invalid data for the Bitcoin mainnet. Speculative and congestion-causing activities may harm Bitcoin's decentralization in the long run.

Smart Contract

Since Bitcoin's script technology is limited, why not adopt Ethereum's smart contracts directly?


This takes us back to the UTXO model of Bitcoin, which cannot directly support Turing-complete smart contracts. Therefore, the primary approach currently is to transfer Bitcoin to a sidechain to leverage another network's support for smart contracts to scale Bitcoin's capabilities.


However, two-way peg introduces the problem of centralized management of BTC. Even with one-way transfers of Bitcoin, smart contracts themselves carry security risks. This is also why Bitcoin has been hesitant to adopt smart contract technology for a long time.


The DAO


In the past, the Ethereum community experienced The DAO incident, which resulted in a fork and a rollback, serving as a typical example of security vulnerabilities in smart contract.


With the development of DeFi on Ethereum, it becomes evident that smart contract security incidents are recurring in the crypto space. If similar events were to occur in a country's financial system, it would be catastrophic and unacceptable. The crypto industry, as an emerging field, has been more forgiving of Ethereum's smart contract shortcomings, allowing it to survive.


Therefore, even if smart contract is adopted on both the Bitcoin on-chain and sidechain solutions, the security issues surrounding Bitcoin's scalability remain unsolved. Bitcoin, as the digital gold and benchmark of the crypto industry, cannot tolerate such vulnerabilities.


Ethereum supports Turing-complete smart contracts and excels in technical scalability. However, besides security concerns, there are also usability issues, as they often require the assistance of professional programmers, making them challenging for ordinary users to use directly.


Readable DeFi Contracts

Hacash has pioneered the concept of readable DeFi contracts, a technology that excels in security, user-friendliness, and financial flexibility. The key characteristic of these contracts is that they focus on monetary and financial requirements, do not possess Turing-complete programmability, and require Bitcoin to be one-way transferred to Hacash for use.


Readable DeFi contracts adhere to a unified set of financial contract standards. Once created and verified for accuracy, a DeFi contract is uploaded to the Hacash mainnet and can be repeatedly used by users.


Different DeFi contracts based on this standard can be combined freely. Due to the security and standardization of each contract, there are no security issues associated with their combinations, unlike the challenges seen in DeFi Lego-like combinations of smart contracts.


Additionally, this standard is designed to be comprehensible even for users with no coding experience, allowing ordinary users to create readable DeFi contracts by simply checking options and filling in basic values, similar to how they would operate traditional financial contracts.


Hacash readable DeFi contract data transaction struct


One significant feature of readable DeFi contracts is that their validity can occur off-chain. Multiple contracts related to assets can be signed, and some of these contracts can include mutually exclusive clauses serving as arbitration guarantees. This means that not all of these transactions need to be fully submitted to the mainnet to guarantee certain financial payments, saving block state space.

In conclusion

For the Bitcoin mainnet, both script technology and readable DeFi contracts require very few bytes, while script technology may introduce a significant amount of meaningless external protocol data, as seen with the Ordinals. In contrast, smart contract often requires deploying an entire codebase, resulting in a larger space requirement.


Furthermore, both script technology and readable DeFi contracts typically involve fewer transactions compared to smart contracts, resulting in lower gas fees.


When considering the impact of contracts on Bitcoin, script technology, smart contract, and readable DeFi contracts make trade-offs in four dimensions: security, cost, scalability, and ease of use in Bitcoin transactions.


Script technology and readable DeFi contract excel in security and cost compared to smart contract, but smart contract offers the best scalability due to its Turing completeness. Readable DeFi contract focuses on contract scalability for monetary and financial use cases while sacrificing other forms of scalability.


In terms of ease of use, readable DeFi contracts allow individuals without programming experience to freely combine and use them, whereas smart contracts and script technology require programming expertise.


The ideal direction for Bitcoin contracts would be to achieve absolute security, low costs, complete scalability, and contracts that can be understood and used by ordinary users without the need to understand the underlying code.


As can be seen, both script technology and readable DeFi contracts have been making strides in terms of scalability. Ordinals in script technology has introduced recursive inscription, improving the scalability of specific protocols.


Readable DeFi contract, on the other hand, has introduced a multi-chain infrastructure based on Hacash to improve scalability beyond financial use cases. Smart contract, in contrast, has introduced the Move language to enhance security. If Bitcoin one-way transfers gain mainstream attention, readable DeFi contracts could potentially become the primary solution for scaling Bitcoin's contract technology.