减法协议中的函数和资产

币圈资讯 阅读:35 2024-04-22 10:13:33 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

作者:0xKJ | PoW 2.0 来源:X,@kernel1983

减法理论给我们带来了区块链认知上的极大提升,如果说智能合约是给比特币做加法,那么铭文空间就是给比特币做减法。对交易做排序和共识是所有区块链的必备功课,所以 减法理论 可以适用于所有公链,铭文空间天然具有跨链的特性。

当我们开始思考减法协议,它给我们带来了极大的设计空间,也让我们有机会重新思考 EVM CALLDATA 的不足以及安全隐患。首先,铭文,比如 BRC20,实际上是“明文”,而 CALLDATA 的可阅读性则差了很多。铭文协议的设计应该遵循这一原则,从协议层面让用户知道自己在做什么。

UsgSTx3jjImu7cGkvrgCkalA0NZonoVHUWgi0eEq.png

铭文 vs CALLDATA

我们思考的第二点,是智能合约的范式。智能合约让每个区块链应用,拥有自己的一亩三分地,用来定义数据和代码。用户资产就是数据,代码可以操作数据,比如转账,mint 和 approve。对于那些常用的合约,比如 USDT,实际上代码经过了长时间以及无数双眼睛的验证。然而区块链上有上千种资产,即使大部分资产都遵循 ERC20 标准,但是标准实现并不是强制的。早期,很多合约因为重大安全问题直接报废。随着工程师们经验的增长,重大安全问题越来越少见,但是用户依然不可能靠自己的力量审计所有智能合约。思考这一现象背后的本质,实际上是因为智能合约允许发布者自定义合约的所有代码,很少直接重用现有代码(复用也是通过复制粘贴),造成了链上安全实际上的黑暗森林。

减法协议的设计,尝试修复这一点,我们把编程语言中的基本元素,函数 function,和区块链中的基本元素 资产 asset 概念独立出来。在智能合约中,合约代码处理合约资产,而在减法协议中,函数具有操作某个资产的权限。比如 transfer 具有操作所有资产的权限,这使得人们无需为每个资产重新编写所有代码。对于 mint 方法,则需要更高的定义自由,meme 资产的mint 逻辑与 USDT 资产的方式逻辑必然不同,需要编写特定的 [asset]_mint 函数。

另外,函数还有一个 require 属性,更加静态的指定了函数依赖的其他函数,并且在调用过程中,对调用函数可以操作的资产类型做更细致的限定,以提升安全性。

第三点,我们一直很喜欢 ERC6551 的思路,但是由于 6551 的出现晚于 ERC20,所以所有的 ERC20 都无法让资产绑定在一个 NFT 上,只能由以太坊地址来持有。地址就像公钥,和私钥是一对一绑定的。假设我怀疑自己的私钥已经不安全了,当尝试更换私钥,就意味着必须同时更换地址(用户名)。在以太坊上更换地址,用户需要将所有资产转移到新地址,这需要花费一笔不小的 gas 费用。所以我们认为,用户更换私钥的安全代价会很高。

在减法协议中,我们可以从协议设计上改进,我们允许资产被一个“名字”持有,“名字”可以绑定地址。所以,更换私钥无需更换“名字”,以降低经常更换私钥的成本。

我们正在设计和实现 减法协议,它是一个在 减法理论 指导下的跨链铭文空间。我们的进度非常乐观,从 Minus Theory 到 Minus Protocol demo 运行只花了一周时间。

近期有望在测试完运行!敬请期待。


The author's source subtraction theory has brought us a great improvement in blockchain cognition. If the smart contract is to add bitcoin, then the inscription space is to subtract bitcoin, and sorting and consensus of transactions is a necessary homework for all blockchain. Therefore, the subtraction theory can be applied to all public chain inscription spaces, which naturally has the characteristics of cross-chain. When we start to think about the subtraction protocol, it brings us great design space and gives us an opportunity to rethink the shortcomings and security risks. For example, the text is actually plain text, but the readability is poor. The design of many inscriptions should follow this principle to let users know what they are doing from the protocol level. The second point we think is the paradigm of smart contracts. Smart contracts allow each blockchain application to have its own acre of land to define data and codes. User assets are data codes, which can manipulate data such as transfers, and for those commonly used contracts, such as the fact that the codes have gone through a long time and countless pairs of eyes. Verification However, there are thousands of assets in the blockchain, even though most of them follow the standards, but the standard implementation is not mandatory. In the early days, many contracts were directly scrapped because of major security issues. With the growth of engineers' experience, major security issues became less and less common, but it is still impossible for users to audit all smart contracts on their own. Thinking about the essence behind this phenomenon is actually because smart contracts allow publishers to customize all the codes of the contracts, and it is rare to reuse existing codes directly. By copying and pasting, the chain is safe. In fact, the design of the dark forest subtraction protocol tries to repair this. We separate the basic element function in the programming language from the basic element asset concept in the blockchain. In the intelligent contract, the contract code handles the contract asset, while in the subtraction protocol, the function has the authority to operate an asset, such as the authority to operate all assets, which makes it unnecessary for people to rewrite all the codes for each asset, but requires a higher definition freedom for the method. The logic of assets is necessarily different from the way logic of assets, so it is necessary to write a specific function. In addition, the function also has an attribute that specifies other functions that the function depends on more statically, and makes more detailed restrictions on the types of assets that can be operated by the calling function to improve security. Third, we have always liked the idea, but because it appeared later, all assets cannot be bound to one address, just like the public key and the private key are one-to-one. Assumption of binding: I suspect that my private key is unsafe. When trying to change the private key, it means that the address must be changed at the same time. The user needs to transfer all assets to the new address, which will cost a lot of money. Therefore, we think that the security cost of changing the private key will be high. In the subtraction protocol, we can improve the protocol design. We allow assets to be held by one name and can bind the address, so changing the private key does not require changing the name to reduce the cost. We are designing and implementing the subtraction protocol, which is a cross-chain inscription space under the guidance of subtraction theory. Our progress is very optimistic, and it took only one week from running to testing, so please look forward to it in the near future. 比特币今日价格行情网_okx交易所app_永续合约_比特币怎么买卖交易_虚拟币交易所平台

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明 网址:https://netpsp.com/?id=61172

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
关注我们

若遇到问题,加微信客服---清歌

搜索
排行榜
扫一扫,加我为微信好友加我为微信好友