RGB 魔法:比特币上的客户端合约

PanewsPublished on 2022-11-30Last updated on 2022-11-30

Abstract

“智能合约” 这个术语的历史比区块链和比特币还更久。

“智能合约” 这个术语的历史比区块链和比特币还更久。它第一次出现是在Nick Szabo 于 1994 年出版的文章里,该文将智能合约定义为一种 “计算机化的交易协议,可以执行合约的条款”。虽然从定义上来说,得益于比特币的脚本功能,比特币从一开始就支持智能合约,但这个词是因为以太坊的支持者才火起来的,他们调整了智能合约原本的定义,成了 “可以被一个全局共识网络的所有节点冗余式执行的代码”。

虽然将代码的执行委托给一个全局共识网络有其优势(例如,易于部署无主合约(unowed contracts);这样的合约的一个例子是热门的自动化做市商(AMM)),但这样的设计也有一个重大缺陷:缺乏可扩展性(以及隐私性)。如果网络中的每个节点都必须冗余式地运行同一段代码,可以运行的代码数量就只能保持较低水平,否则会过度地提高运行节点的成本(因此阻碍去中心化)。

那么,我们是否可以设计出一种系统,其合约的条款仅由参与方执行和验证,而不是由所有的网络成员了验证呢?我们设想一家希望发行股票的公司的例子。与其将发行合约公开放在一个全球账本上、使用这个账本来跟踪这些股份在未来的所有权转移情况,我可以直接私密地发行股份并将进一步转让的权利传递给买方。然后,转让所有权的权利可以传递给每一个新的所有权人,就像修改最初的发行合约一样。如此一来,每一个所有权人都可以独立地验证自己收到的股票是真实的,办法就是阅读最初的合约并验证转移股份的所有操作都遵循了合约中的规则。

这不是什么新鲜玩意儿,在政府的登记处流行之前,人们正是用这种办法来转移地产的。举个例子,在英国,直到上世纪 90 年代开始,地产所有权的转移才强制注册。也就是说,英格兰和威尔士至今仍有 15% 的土地是没有注册的。如果你要购买一块没有注册的土地,你不是去登记处查证卖方是不是真正的所有权人,而是要验证至少 15 年内的所有权转移链条没有缺漏(这个时长足以假设卖方拥有充足的所有权)。这样做的时候,你需要确保每一次所有权转移都是正确执行的,并且用于之前交易的所有抵押贷款都已经还清了。这种模式的优势是提高了所有权的隐私性,而且你不必依赖于政府土地登记处的维护者。另一方面,对买方来说,这让验证卖方所有权的工作复杂很多很多。

-图片来源:未登记的不动产权的确认书 -

那么,如何优化这种未登记的地产的转让呢?首先,要把它电子化。如果用计算机可以运行的代码来验证所有权转移的全部历史都符合最初的合约规则,买卖就会变得快捷和便宜许多。

其次,为了避免卖方一房多卖,必须实现一套发布证明系统。举个例子,我们可以实现一条规则:每一次所有权的转移都必须在一份知名报纸的一个特定位置刊登(例如:将所有权转移操作的哈希值放在纽约时报的头版右上角)。因为你没法在同一个地方重复刊登相同的哈希值,自然也就不能重复花费。但是,使用著名的大报纸也有不利之处:

为了验证,你必须购买一大捆的报纸。这不太实际。

每一个合约都需要在报纸上有一个专属的位置。这不便于扩大吞吐量。

报纸的编辑很容易就可以审查你,甚至在你的位置放置随机的哈希值来模拟重复花费,让潜在的买家都认为你的资产已经卖掉了,从而阻止他们购买你的资产。你必须信任报纸的编辑。

因为这些原因,我们需要找到更适合发布所有权转移证据的地方。那么,还有什么地方比比特币区块链 —— 一个业已建立的可信任的公开账本、带有保持抗审查性和去中心化的强大激励 —— 更合适呢?

如果我们使用比特币,我们不应该使用区块的固定位置(比如区块中的第一笔交易,即 coinbase 交易)作为发布所有权转移承诺的地方,因为,就像纽约时报的编辑(可以决定报纸的内容),矿工也可以操纵它。更好的办法是在一笔预定义的比特币交易中放置承诺,更具体来说,是使用关联着已发行的资产的所有权的 UTXO 来发起的一笔交易。一项资产与一个比特币 UTXO 的联系,既可以通过发行资产的合约来建立,也可以在所有权的后续流转中建立 —— 每次流转都可以指定某个 UTXO 作为被转移的资产的容器。这样一来,我们就清晰地定义了所有权转移的义务应该放在哪里(即,放在源自特定 UTXO 的比特币交易中)。任何运行比特币节点的人都可以独立地验证这个承诺,而且没有矿工和其它实体能够审查或阻止这种资产转移方式。

因为在比特币区块链上我们只发布了所有权转移的承诺,不包括转移的内容本身,所以卖方需要一条专门的信息通道,向买方提供证明其产权真实性的所有证明。这可以用许多方式来实现,甚至可以打印出证明、用信鸽来传送,虽然有点不实际,但也算能够胜任。但是,要避免审查和隐私性降级,最好的选择莫过于建立一条直接的点对点加密信道;与信鸽相比,还有易于跟验证证据的软件集成的优势。

上述基于客户端验证的合约和所有权转移模式,正是 RGB 协议所实现的东西。有了 RGB,你可以创建一套合约,定义资产的权利、将资产分配给一个乃至多个 UTXO 并指定这些资产的所有权可以如何转移。合约可以从一套模板(叫做 “方案(schema)”)开始创建,合约的创建者只需调整参数和所有者权利,就像传统的法律合约做的那样。当前,RGB 协议有两类方案:一种用于发行同质化代币(RGB20),另一种用于发行收藏品(RGB21);但在未来,人们无需更改协议层,就能以免信任的方式开发出更多方案。

举一个更加现实的例子,一种同质化资产(例如公司股票、稳定币,等等)的发行者可以使用 RGB20 模板,创建一个定义了发行多少代币、资产的名称并携带额外的元数据的合约。然后,它可以定义哪些比特币 UTXO 有权转移被创建的代币的所有权,并分配其它权利给其它 UTXO(例如增发权和重命名资产的权利)。每一个收到由此合约创建的代币的客户端,都可以验证创始合约的内容,并验证自己收到的代币在历史上的每一次所有权转移都遵守了创始合约的规则。

那么,今天我们能拿 RGB 来干什么呢?首先,也是最重要的,它可以用于发行和转移代币化的资产,而且相比现在其它所有方案,其可扩展性和隐私性都要更好。在隐私性上,RGB 得益于所有转让相关数据都保存在客户端的做法,区块链的观察者无法从区块链上抽取出关于用户的金融活动的任何信息(甚至无法区分包含了 RGB 承诺的交易和普通的比特币交易);此外,资产的接收方可以仅跟发送方分享盲化的 UXTO(即 TA 希望用以承接资产的 UTXO 拼接一个随机数后的哈希值),而不是 UTXO 本身,所以转让者也无法监控接收方在未来的金融活动。为了进一步提高用户的隐私性,RGB 还使用了 bulletproof 密码学机制来隐藏历史上的资产转让数额,如此一来,未来的资产所有权人对以往所有权人的金融活动也只能形成模糊的认识。

至于可扩展性,RGB 也有优势。首先,绝大部分数据都在链下保存,区块链仅用于保存承诺,这就减少了需要支付的手续费,同时也意味着每个客户端都只验证跟自己相关的转让历史,而无需验证一个全局网络的所有活动。因为 RGB 转账依然需要发起比特币交易,所以能够节约的手续费看起来很少,但当你引入交易批处理技术后,这部分节约很快会变得非常可观。实际上,你可以在一笔比特币交易中放置一个承诺,将一个 UTXO 相关的所有代币(更广义来说是 “权利”)转移给任意数量的接收者。假设你是一个服务提供商,需要同时支付给多名客户;有了 RGB,你就可以在一笔比特币交易中承诺对几千名要求不同资产的客户的几千笔转账,让每一笔支付的边际成本都变得微不足道。

低价值资产的发行者可使用的另一种节约手续费的机制是,在 RGB 中,发行资产并不需要支付手续费。因为创建一个代币发行合约并不需要在区块链上承诺。一个合约只是定义了新发行的资产要分配给哪些已经存在的 UTXO。所以,如果你是一名艺术家,希望创建一些收藏品代币,你可以免费发行任意数量的代币,仅在买方出现并请求把代币转移给他们的 UTXO 时才需要支付比特币手续费。

此外,因为 RGB 是建立在比特币交易上的,它也跟闪电网络兼容。虽然在撰文之时还尚未实现,但创建资产专属的闪电通道和路由系统,是可以做到的,就类似于正常的闪电交易运作的方式。

结论

RGB 是一个突破性的创新,使用全新的范式开启了新的应用场景。但是,现在我们有什么工具可用呢?如果你想要实验这项技术的核心,你应该直接尝试RGB 节点。如果你希望在 RGB 上开发应用,有不想深入协议的复杂性,你可以使用rgb-lib 库,它为开发者提供了一个简单的接口。如果你想尝试发行和转移资产,你可以试用Iris Wallet(Android),这款钱包的代码也是开源的。如果你想学习 RGB,你可以看看这份资源列表。

Trending Cryptos

Related Reads

TechFlow Intelligence Bureau: Anthropic IPO Odds Exceed 80%, Iran Closes Strait of Hormuz Again, Triggering Oil Price Volatility

**Market Digest** **AI & Tech:** Anthropic is widely expected to announce an IPO before November 2026, raising questions about balancing its trillion-dollar valuation ambitions with its core "AI safety" mission. Brands are increasingly adopting AI-generated virtual influencers for marketing. Cloudflare introduced temporary accounts for AI agents to ease automation workflows. **Infrastructure & Hardware:** Google's IPv6 traffic surpassed 50%, marking a major internet milestone. Goldman Sachs warned that massive projected AI capital expenditure ($5.3T) is approaching credit saturation limits, potentially curbing the "AI arms race." **Space & Robotics:** SpaceX's IPO saw a historic $370M retail buying frenzy in three days. Hyundai Motor Group plans to acquire full ownership of Boston Dynamics. Elon Musk speculated about future "septillion-dollar" investments in antimatter for interstellar travel. **Energy & Geopolitics:** Iran's military announced another closure of the strategic Strait of Hormuz, accusing Israel of violating a ceasefire, causing oil market volatility. However, ship-tracking data indicated some traffic continued. Concurrently, Iran resumed crude loadings at Kharg Island, potentially releasing up to 20 million barrels to the market. **Finance & Macro:** A European CLO (collateralized loan obligation) experienced its first post-2008-crisis-era equity tranche default, raising alarms in credit markets. Nomura warned that new Federal Reserve Chair Wash's perceived hawkish debut speech could signal a significant policy shift. **The Undercurrent:** Seemingly disparate events—the Strait of Hormuz tension, the European CLO default, and warnings on AI spending—point to a tightening of global liquidity and rising marginal costs across energy, credit, and tech investment. Meanwhile, capital continues chasing grand narratives like space exploration and advanced AI, highlighting a divergence where old-world leverage frays as new-world stories grow more ambitious.

marsbit12h ago

TechFlow Intelligence Bureau: Anthropic IPO Odds Exceed 80%, Iran Closes Strait of Hormuz Again, Triggering Oil Price Volatility

marsbit12h ago

Trading

Spot
Futures

Hot Articles

What is $BITCOIN

DIGITAL GOLD ($BITCOIN): A Comprehensive Analysis Introduction to DIGITAL GOLD ($BITCOIN) DIGITAL GOLD ($BITCOIN) is a blockchain-based project operating on the Solana network, which aims to combine the characteristics of traditional precious metals with the innovation of decentralized technologies. While it shares a name with Bitcoin, often referred to as “digital gold” due to its perception as a store of value, DIGITAL GOLD is a separate token designed to create a unique ecosystem within the Web3 landscape. Its goal is to position itself as a viable alternative digital asset, although specifics regarding its applications and functionalities are still developing. What is DIGITAL GOLD ($BITCOIN)? DIGITAL GOLD ($BITCOIN) is a cryptocurrency token explicitly designed for use on the Solana blockchain. In contrast to Bitcoin, which provides a widely recognized value storage role, this token appears to focus on broader applications and characteristics. Notable aspects include: Blockchain Infrastructure: The token is built on the Solana blockchain, known for its capacity to handle high-speed and low-cost transactions. Supply Dynamics: DIGITAL GOLD has a maximum supply capped at 100 quadrillion tokens (100P $BITCOIN), although details regarding its circulating supply are currently undisclosed. Utility: While precise functionalities are not explicitly outlined, there are indications that the token could be utilized for various applications, potentially involving decentralized applications (dApps) or asset tokenization strategies. Who is the Creator of DIGITAL GOLD ($BITCOIN)? At present, the identity of the creators and development team behind DIGITAL GOLD ($BITCOIN) remains unknown. This situation is typical among many innovative projects within the blockchain space, particularly those aligning with decentralized finance and meme coin phenomena. While such anonymity may foster a community-driven culture, it intensifies concerns about governance and accountability. Who are the Investors of DIGITAL GOLD ($BITCOIN)? The available information indicates that DIGITAL GOLD ($BITCOIN) does not have any known institutional backers or prominent venture capital investments. The project seems to operate on a peer-to-peer model focused on community support and adoption rather than traditional funding routes. Its activity and liquidity are primarily situated on decentralized exchanges (DEXs), such as PumpSwap, rather than established centralized trading platforms, further highlighting its grassroots approach. How DIGITAL GOLD ($BITCOIN) Works The operational mechanics of DIGITAL GOLD ($BITCOIN) can be elaborated on based on its blockchain design and network attributes: Consensus Mechanism: By leveraging Solana’s unique proof-of-history (PoH) combined with a proof-of-stake (PoS) model, the project ensures efficient transaction validation contributing to the network's high performance. Tokenomics: While specific deflationary mechanisms have not been extensively detailed, the vast maximum token supply implies that it may cater to microtransactions or niche use cases that are still to be defined. Interoperability: There exists the potential for integration with Solana’s broader ecosystem, including various decentralized finance (DeFi) platforms. However, the details regarding specific integrations remain unspecified. Timeline of Key Events Here is a timeline that highlights significant milestones concerning DIGITAL GOLD ($BITCOIN): 2023: The initial deployment of the token occurs on the Solana blockchain, marked by its contract address. 2024: DIGITAL GOLD gains visibility as it becomes available for trading on decentralized exchanges like PumpSwap, allowing users to trade it against SOL. 2025: The project witnesses sporadic trading activity and potential interest in community-led engagements, although no noteworthy partnerships or technical advancements have been documented as of yet. Critical Analysis Strengths Scalability: The underlying Solana infrastructure supports high transaction volumes, which could enhance the utility of $BITCOIN in various transaction scenarios. Accessibility: The potential low trading price per token could attract retail investors, facilitating wider participation due to fractional ownership opportunities. Risks Lack of Transparency: The absence of publicly known backers, developers, or an audit process may yield skepticism regarding the project's sustainability and trustworthiness. Market Volatility: The trading activity is heavily reliant on speculative behavior, which can result in significant price volatility and uncertainty for investors. Conclusion DIGITAL GOLD ($BITCOIN) emerges as an intriguing yet ambiguous project within the rapidly evolving Solana ecosystem. While it attempts to leverage the “digital gold” narrative, its departure from Bitcoin's established role as a store of value underscores the need for a clearer differentiation of its intended utility and governance structure. Future acceptance and adoption will likely depend on addressing the current opacity and defining its operational and economic strategies more explicitly. Note: This report encompasses synthesised information available as of October 2023, and developments may have transpired beyond the research period.

414 Total ViewsPublished 2025.05.13Updated 2025.05.13

What is $BITCOIN

Discussions

Welcome to the HTX Community. Here, you can stay informed about the latest platform developments and gain access to professional market insights. Users' opinions on the price of BTC (BTC) are presented below.

活动图片