Chainlink:去中心化的预言机网络

Chainlink 2.0: Next Steps in the Evolution of Decentralized Oracle Networks

Oleh Steve Ellis, Ari Juels and Sergey Nazarov · 2017

Abstract

Abstract

In this whitepaper, we articulate a vision for the evolution of Chainlink beyond its initial conception in the original Chainlink whitepaper. We foresee an increasingly expansive role for oracle networks, one in which they complement and enhance existing and new blockchains by providing fast, reliable, and confidentiality-preserving universal connectivity and off-chain computation for smart contracts. The foundation of our plan is what we call Decentralized Oracle Networks, or DONs for short. A DON is a network maintained by a committee of Chainlink nodes. It supports any of an unlimited range of oracle functions chosen for deployment by the committee. A DON thus acts as a powerful abstraction layer, offering interfaces for smart contracts to extensive off-chain resources and highly efficient yet decentralized off-chain computing resources within the DON itself. With DONs as a springboard, Chainlink plans to focus on advances in seven key areas: • Hybrid smart contracts: Offering a powerful, general framework for augmenting existing smart contract capabilities by securely composing on-chain and off-chain computing resources into what we call hybrid smart contracts. • Abstracting away complexity: Presenting developers and users with simple functionality eliminates the need for familiarity with complex underlying protocols and system boundaries. • Scaling: Ensuring that oracle services achieve the latencies and throughputs demanded by high-performance decentralized systems. • Confidentiality: Enabling next-generation systems that combine blockchains’ innate transparency with strong new confidentiality protections for sensitive data. • Order-fairness for transactions: Supporting transaction sequencing in ways that are fair for end users and prevent front-running and other attacks by bots and exploitative miners. • Trust-minimization: Creating a highly trustworthy layer of support for smart contracts and other oracle-dependent systems by means of decentralization, strong anchoring in high-security blockchains, cryptographic techniques, and cryptoeconomic guarantees. • Incentive-based (cryptoeconomic) security: Rigorously designing and robustly deploying mechanisms that ensure nodes in DONs have strong economic incentives to behave reliably and correctly, even in the face of wellresourced adversaries. We present preliminary and ongoing innovations by the Chainlink community in each of these areas, providing a picture of the broadening and increasingly powerful capabilities planned for the Chainlink network.

摘要

在本白皮书中,我们阐述了 Chainlink 的演变愿景,超越了原始 Chainlink 白皮书中的最初构想。 我们预见 oracle 网络的作用日益扩大,通过提供快速、可靠和可靠的服务来补充和增强现有和新的 blockchain 保密性通用连接和链外计算 smart contracts。 我们计划的基础是我们所说的去中心化预言机网络,或者 简称 DONs。 DON 是由 Chainlink 委员会维护的网络 节点。 它支持任何无限范围的 oracle 函数选择 由委员会部署。因此 DON 充当强大的抽象层, 为 smart contract 提供广泛的链下资源和高度的接口 DON 本身内高效且去中心化的链外计算资源。 以 DONs 作为跳板,Chainlink 计划重点关注七个方面的进展 关键领域: • 混合smart contracts:提供一个强大的通用框架,通过安全地在链上组合来增强现有的smart contract功能 和链下计算资源进入我们所说的混合smart contract。 • 抽象化复杂性:向开发人员和用户提供简单的 功能消除了熟悉复杂底层的需要 协议和系统边界。 • 扩展:确保oracle 服务实现延迟和吞吐量 高性能去中心化系统的需求。 • 保密性:支持结合blockchains’的下一代系统 与生俱来的透明度,为敏感信息提供强大的新保密保护 数据。 • 交易的顺序公平性:以多种方式支持交易排序 这对最终用户来说是公平的,并防止抢先交易和其他攻击 机器人和剥削性矿工。 • 信任最小化:创建高度值得信赖的支持层 smart contracts 和其他 oracle 依赖系统,通过去中心化、强锚定于高安全性 blockchains、加密 技术和加密经济保证。 • 基于激励的(加密经济)安全性:严格设计和稳健部署机制,确保 DON 中的节点具有强大的经济激励,即使面对资源充足的对手,也能可靠、正确地行事。 我们展示 Chainlink 社区的初步和持续创新 在每个领域,提供了一幅不断扩大和日益增长的图景 为 Chainlink 网络规划的强大功能。

Introduction

Introduction

Blockchain oracles are often viewed today as decentralized services with one objective: to forward data from off-chain resources onto blockchains. It’s a short step, though, from forwarding data to computing on it, storing it, or transmitting it bidirectionally. This observation justifies a much broader notion of oracles’ functionality. So too do the growing service requirements of smart contracts and increasingly multifaceted technologies that rely on oracle networks. In short, an oracle can and will need to be a general-purpose, bidirectional, compute-enabled interface between and among onchain and off-chain systems. Oracles’ role in the blockchain ecosystem is to enhance the performance, functionality, and interoperability of smart contracts so that they can bring new trust models and transparency to a multiplicity of industries. This transformation will come about through broadening use of hybrid smart contracts, which fuse blockchains’ special properties with the unique capabilities of off-chain systems such as oracle networks and thereby achieve far greater reach and power than on-chain systems in isolation. In this whitepaper, we articulate a vision for what we call Chainlink 2.0, an evolution of Chainlink beyond its initial conception in the original Chainlink whitepaper [98]. We foresee an increasingly expansive role for oracle networks, one in which they complement and enhance existing and new blockchains by providing fast, reliable, and confidentiality-preserving universal connectivity and computation for hybrid smart contracts. We believe that oracle networks will even evolve to become utilities for exporting high-integrity blockchain-grade data to systems beyond the blockchain ecosystem. Today, Chainlink nodes run by a diverse set of entities come together in oracle networks to relay data to smart contracts in what are known as reports. We can view such oracle nodes as a committee similar to that in a classical-consensus blockchain [72], but with the goal of supporting existing blockchains, rather than providing freestanding functionality. With verifiable random functions (VRF) and Off-Chain Reporting (OCR), Chainlink is already evolving toward a general-purpose framework and infrastructure for providing the computational resources that smart contracts require for advanced functionality. The foundation of our plan for Chainlink 2.0 is what we call Decentralized Oracle Networks, or DONs for short. Since we introduced the term “oracle network” in the original Chainlink whitepaper [98], oracles have developed ever richer functionality and breadth of application. In this paper, we offer a fresh definition of the term according to our future vision for the Chainlink ecosystem. In this view, a DON is a network maintained by a committee of Chainlink nodes. Rooted in a consensus protocol, it supports any of an unlimited range of oracle functions chosen for deployment by the committee. A DON thus acts as a blockchain abstraction layer, providing interfaces to off-chain resources for both smart contracts and other systems. It also provides access to highly efficient yet decentralized off-chain computing resources. In general, a DON supports operations on a main chain. Its goal is to enable secure and flexi-

ble hybrid smart contracts, which combine on-chain and off-chain computation with connection to external resources. We emphasize that even with the use of committees in DONs, Chainlink itself remains inherently permissionless. DONs act as the foundation of a permissionless framework in which nodes can come together to implement custom oracle networks with their own regimes for node inclusion, which may be permissioned or permissionless. With DONs as a foundation, we plan to focus in Chainlink 2.0 on advances in seven key areas: hybrid smart contracts, abstracting away complexity, scaling, confidentiality, order-fairness for transactions, trust minimization, and incentive-based (cryptoeconomic) security. In this paper introduction, we present an overview of Decentralized Oracle Networks in Section 1.1 and then our seven key areas of innovation in Section 1.2. We describe the organization of the rest of this paper in Section 1.3. 1.1 Decentralized Oracle Networks Decentralized Oracle Networks are designed to enhance and extend the capabilities of smart contracts on a target blockchain or main chain through functions that are not available natively. They do so by providing the three basic resources found in computing systems: networking, storage, and computation. A DON aims to offer these resources with strong confidentiality, integrity, and availability properties,1 as well as accountability. DONs are formed by committees of oracle nodes that cooperate to fulfill a specific job or choose to establish a long-lived relationship in order to provide persistent services to clients. DONs are designed in a blockchain-agnostic way. They promise to serve as a powerful and flexible tool for application developers to create off-chain support for their smart contracts on any supported main chain. Two types of functionalities realize the capabilities of a DON: executables and adapters. Executables are programs that run continuously and in a decentralized manner on the DON. While they do not directly store main-chain assets, they have important benefits, including high performance and the ability to perform confidential computation. Executables run autonomously on a DON and perform deterministic operations. They work in hand with adapters that link the DON to external resources and may be called by executables. Adapters, as we envision them for DONs, are a generalization of the external adapters in Chainlink today. While existing adapters typically only fetch data from data sources, adapters may operate bidirectionally; in DONs, they may additionally leverage joint computation by DON nodes to achieve additional features, such as encrypting reports for privacy-preserving consumption by an executable. To provide a sense of a DON’s basic operation, Fig. 1 shows conceptually how a DON might be used to send reports to a blockchain and thus achieve traditional, existing oracle functionality. DONs can provide many additional features, however, beyond 1The “CIA triad” of information security [123, p. 26, §2.3.5].

Conceptual figure showing how a Decentralized Oracle Network can realize basic oracle functionality by relaying off-chain data to a contract

Chainlink’s existing networks. For example, within the general structure of Fig. 1, the executable could record fetched asset-price data on the DON, using such data to compute, e.g., a trailing average for its reports. Figure 1: Conceptual figure showing as an example how a Decentralized Oracle Network can realize basic oracle functionality, i.e., relay off-chain data to a contract. An executable uses adapters to fetch off-chain data, which it computes on, sending output over another adapter to a target blockchain. (Adapters are initiated by code in the DON, represented by small blue boxes; arrows show the direction of data flow for this particular example.) The executable can additionally read and write to local DON storage to keep state and/or communicate with other executables. Flexible networking, computation, and storage in DONs, all represented here, enable a host of novel applications. A major benefit of DONs is their ability to bootstrap new blockchain services. DONs are a vehicle by which existing oracle networks can quickly stand up service applications that would today require the creation of purpose-built networks. We give a number of examples of such applications in Section 4. In Section 3, we provide more details on DONs, describing their capabilities in terms of the interface they present to developers and users. 1.2 Seven Key Design Goals Here we briefly review the seven key focuses enumerated above for the evolution of Chainlink, namely:

Hybrid smart contracts: Central to our vision for Chainlink is the idea of securely combining on-chain and off-chain components in smart contracts. We refer to contracts realizing this idea as hybrid smart contracts or hybrid contracts.2 Blockchains are and will continue to play two critical roles in decentralized-service ecosystems: They are both the loci where cryptocurrency ownership is represented and robust anchors for decentralized services. Smart contracts must therefore be represented or executed on chain, but their on-chain capabilities are severely limited. Purely on-chain contract code is slow, expensive, and insular, unable to benefit from real-world data and a variety of functionalities that are inherently unachievable on chain, including various forms of confidential computation, generation of (pseudo)randomness secure against miner / validator manipulation, etc. For smart contracts to realize their full potential therefore requires smart contracts to be architected with two parts: an on-chain part (which we typically denote by SC) and an off-chain part, an executable running on a DON (which we typically denote by exec). The goal is to achieve a secure composition of on-chain functionality with the multiplicity of off-chain services that DONs aim to provide. Together, the two parts make up a hybrid contract. We present the idea conceptually in Fig. 2. Already today, Chainlink services3 such as data feeds and VRFs are enabling otherwise unachievable smart contract applications, ranging from DeFi to fairly generated NFTs to decentralized insurance, as first steps toward a more general framework. As Chainlink services expand and grow more performant according to our vision in this whitepaper, so too will the power of smart contract systems across all blockchains. Our other six key focuses in this whitepaper may be viewed as acting in the service of the first, overarching one of hybrid contracts. These focuses involve removing visible complexity from hybrid contracts, creating additional off-chain services that enable the construction of ever more capable hybrid contracts, and, in the case of trust minimization, bolstering the security properties achieved by hybrid contracts. We leave the idea of hybrid contracts implicit throughout much of the paper, but any combination of MAINCHAIN logic with a DON may be viewed as a hybrid contract. Abstracting away complexity: DONs are designed to make use of decentralized systems easy for developers and users by abstracting away the often complex machinery behind DONs’ powerful and flexible array of services. Existing Chainlink services already have this feature. For example, data feeds in Chainlink today present onchain interfaces that do not require developers to concern themselves with protocollevel details, such as the means by which OCR enforces consensus reporting among a 2The idea of on-chain / off-chain contract composition has arisen previously in various constrained forms, e.g., layer-2 systems, TEE-based blockchains [80], etc. Our goal is to support and generalize these approaches and ensure that they can encompass off-chain data access and other key oracle services. 3Chainlink services comprise a variety of decentralized services and functionality available through the network. They are offered by the numerous node operators composed into various oracle networks across the ecosystem.

Conceptual figure depicting on-chain and off-chain contract composition in a hybrid smart contract architecture

Figure 2: Conceptual figure depicting on-chain / off-chain contract composition. A hybrid smart contract 3⃝consists of two complementary components: an on-chain component SC 1⃝, resident on a blockchain, and an off-chain component exec 2⃝that executes on a DON. The DON serves as a bridge between the two components as well as connecting the hybrid contract with off-chain resources such as web services, other blockchains, decentralized storage, etc. decentralized set of nodes. DONs go a step further in the sense that they expand the range of services for which Chainlink can offer developers an abstraction layer with accompanying streamlined interfaces for high-level services. We present several application examples in Section 4 that highlight this approach. We envision enterprises, for instance, using DONs as a form of secure middleware to connect their legacy systems to blockchains. (See Section 4.2.) This use of DONs abstracts away the complexity of general blockchain dynamics (fees, reorgs, etc.). It also abstracts away the features of specific blockchains, thereby enabling enterprises to connect their existing systems to an ever-broadening array of blockchain systems without a need for specialized expertise in these systems or, more generally, in decentralizedsystems development. Ultimately, our ambition is to push the degree of abstraction achieved by Chainlink to the point of implementing what we refer to as a decentralized metalayer. Such a layer would abstract away the on-chain / off-chain distinction for all classes of developers and users of DApps, allowing seamless creation and use of decentralized services.

To simplify the development process, developers could specify DApp functionality in the metalayer as a virtual application in a unified machine model. They could then use a decentralized-metalayer compiler to instantiate the DApp automatically as a set of interoperating decentralized functionalities spanning blockchains, DONs, and external services. (One of these external services could be an enterprise system, making the metalayer useful for applications involving legacy enterprise systems.) Such compilation is akin to how modern compilers and software-development kits (SDKs) support generalist programmers in using the full potential of heterogeneous hardware architectures consisting of a general-purpose CPU and specialized hardware like GPUs, machine-learning accelerators, or trusted enclaves. Fig. 3 presents this idea at a conceptual level. Hybrid smart contracts are a first step along the way to this vision and to a concept we call meta contracts. Meta contracts are applications coded on a decentralized metalayer and implicitly encompass on-chain logic (smart contracts), as well as offchain computation and connectivity among various blockchains and existing off-chain services. Given the need for language and compiler support, new security models, and conceptual and technical harmonization of disparate technologies, however, realization of a true decentralized metalayer is an ambitious goal to which we aspire over a long time horizon. It is nonetheless a helpful ideal model to keep in mind while reading this paper, not detailed here, but something we plan to focus on in our future work on Chainlink. Scaling: A goal of preeminent importance in our evolving designs is enabling the Chainlink network to meet the growing scaling needs of the blockchain ecosystem. With network congestion becoming a recurring problem in existing permissionless blockchains [86], new and more performant blockchain designs are coming into use, e.g., [103, 120, 203], as well as complementary layer-2 scaling technologies, e.g., [5, 12, 121, 141, 169, 186, 187]. Oracle services must achieve latencies and throughputs that meet the performance demands of these systems while minimizing on-chain fees (e.g., gas costs) for contract operators and ordinary users alike. With DONs, Chainlink functionality aims to go further and deliver performance high enough for purely webbased systems. DONs derive much of their performance gain from their use of fast, committeebased or permissionless consensus protocols, which they combine with the blockchains they support. We expect many DONs with different configurations to run in parallel; different DApps and users can navigate tradeoffs in underlying consensus choices according to their application requirements. DONs may be viewed in effect as layer-2 technologies. We expect that among other services, DONs will support the Transaction Execution Framework (TEF), which facilitates efficient integration of DONs and thus oracles with other high-performance layer-2 systems—e.g., rollups, systems which bundle transactions offchain to achieve performance improvements. We introduce the TEF in Section 6.

Conceptual figure showing ideal realization of a decentralized metalayer that abstracts blockchain and DON complexity

Figure 3: Conceptual figure showing ideal realization of a decentralized metalayer. For ease of development, a developer specifies a DApp, highlighted in pink, as a virtual application in a unified machine model. A decentralized-metalayer compiler automatically generates corresponding interoperating functionalities: smart contracts (denoted by SC), logic (denoted by exec) on DONs, adapters connecting to target external services, and so forth, as indicated in yellow highlight. Fig. 4 shows conceptually how DONs improve blockchain (smart contract) scaling by concentrating transaction and oracle-report processing offchain, rather than on chain. This shift in the main locus of computation reduces transaction latency and fees while boosting transaction throughput. Confidentiality: Blockchains provide unprecedented transparency for smart contracts and the applications they realize. But there is a basic tension between transparency and confidentiality. Today, for example, users’ decentralized exchange trans-

Conceptual figure showing how DONs improve blockchain smart contract scaling by moving computation off-chain

Figure 4: Conceptual figure showing how Decentralized Oracle Networks improve the scaling of blockchain-enabled smart contracts. Figure A ⃝shows a conventional oracle architecture. Transactions are sent directly to the blockchain, as are oracle reports. Thus the blockchain, highlighted in yellow, is the main locus for transaction processing. Figure B⃝shows use of a DON to support contracts on the blockchain. A DON executable processes transactions along with data from external systems and forwards results—e.g., bundled transactions or contract state changes resulting from the transactions’ effects—to the blockchain. The DON, highlighted in yellow, is thus the main locus for transaction processing. actions are recorded on chain, making it easy to monitor exchange behavior, but also making users’ financial transactions publicly visible. Similarly, data relayed to smart contracts remains on chain. This makes such data conveniently auditable, but acts as a disincentive for data providers wishing to furnish smart contracts with sensitive or proprietary data. We believe that oracle networks will play a pivotal role in catalyzing next-generation systems that combine blockchains’ innate transparency with new confidentiality protections. In this paper, we show how they will do so using three main approaches: • Confidentiality-preserving adapters: Two technologies with planned deployment in Chainlink’s networks, DECO [234] and Town Crier [233], enable oracle nodes to retrieve data from off-chain systems in ways that protect user privacy and data confidentiality. They will play a key role in the design of adapters for DONs. (See Section 3.6.2 for details on these two technologies.) • Confidential computation: DONs can simply conceal their computation from relying blockchains. Using secure multi-party computation and/or trusted execution environments, stronger confidentiality is also possible in which DON nodes compute over data into which they themselves do not have visibility.

Conceptual diagram of confidentiality-preserving operations in a DON processing sensitive data through adapters

• Support for confidential layer-2 systems: The TEF is designed to support a variety of layer-2 systems, many of which use zero-knowledge proofs to provide various forms of transaction confidentiality. We discuss these approaches in Section 3 (with additional details in Section 6, Appendix B.1, and Appendix B.2). Fig. 5 presents a conceptual view of how sensitive data might flow from external sources to a smart contract by means of confidentiality-preserving adapters and confidential computation in a DON. Figure 5: Conceptual diagram of confidentiality-preserving operations in a DON on sensitive data (highlighted in yellow). Sensitive source data (black circles) in web servers is extracted to the DON using confidentiality-preserving adapters (blue, doublearrowed lines). The DON receives derived data (hollow circles) from these adapters— the result of applying either a function or, e.g., secret-sharing, to the sensitive source data. An executable on the DON may apply confidential computation to derived data to construct a report (double circle), which it sends over an adapter to the blockchain. We believe that powerful tools for handling confidential data will open up a whole range of applications. Among these are private decentralized (and centralized) finance, decentralized identity, credit-based on-chain lending, and more efficient and user-friendly know-your-customer and accreditation protocols, as we discuss in Section 4. Order-fairness for transactions: Today’s blockchain designs have a dirty little open secret: They are ephemerally centralized. Miners and validators can order trans-

Example comparing standard mining with Fair Sequencing Services showing how FSS prevents transaction reordering

actions however they choose. Transaction order can also be manipulated by users as a function of the network fees they pay (e.g., gas prices in Ethereum) and to some extent by taking advantage of fast network connections. Such manipulation can, for example, take the form of front-running, in which a strategic actor such as a miner observes a user’s transaction and inserts its own exploitative transaction into an earlier position in the same block—effectively stealing money from the user by leveraging advance knowledge of the user’s transaction. For example, a bot may place a buy order before a user’s. It can then take advantage of the asset price increase induced by the user’s trade. Front-running by some bots that harms ordinary users—analogous to high-frequency trading on Wall Street—is already prevalent and well documented [90], as are related attacks such as back-running [159] and automated transaction mimicking [195]. Proposals to systematize order exploitation by miners have even surfaced recently [110]. Layer-2 technologies such as rollups don’t solve the problem, but merely re-centralize ordering, placing it in the hands of the entity that creates a rollup. One of our goals is to introduce into Chainlink a service called Fair Sequencing Services (FSS) [137]. FSS helps smart contract designers ensure fair ordering for their transactions and avoid front-running, back-running, and related attacks on user transactions as well as other types of transactions, such as oracle report transmission. FSS enables a DON to implement ideas such as the rigorous, temporal notion of orderfairness introduced in [144]. As an incidental benefit, FSS can also lower users’ network fees (e.g., gas costs). Briefly, in FSS, transactions pass through the DON, rather than propagating directly to a target smart contract. The DON orders the transactions and then forwards them to the contract. Figure 6: Example of how FSS is beneficial. Fig. A ⃝shows how a miner, exploiting its centralized power to order transactions, may swap a pair of transactions: transaction 1⃝ arrives before 2⃝, but the miner instead sequences it after 2⃝. In contrast, Fig. B⃝shows how a DON decentralizes the ordering process among DON nodes. If a quorum of honest nodes receive 1⃝before 2⃝, the FSS causes 1⃝to appear before 2⃝on chain— preventing miner reordering by attaching contract-enforceable sequence numbers. Fig. 6 compares standard mining with FSS. It shows how in standard mining,

the process of transaction ordering is centralized with the miner and thus subject to manipulation, such as reordering a pair of transactions with respect to their arrival times. In contrast, in FSS, the process is decentralized among DON nodes. Assuming a quorum of honest nodes, FSS helps enforce policies such as temporal ordering of transactions, reducing opportunities for manipulation by miners and other entities. Additionally, since users need not compete for preferential ordering based on gas price, they can pay relatively low gas prices (while transactions from the DON can be batched for gas savings). Trust minimization: Our general aim in the design of DONs is to facilitate a highly trustworthy layer of support for smart contracts and other oracle-dependent systems by means of decentralization, cryptographic tools, and cryptoeconomic guarantees. A DON itself is decentralized, and users can choose from any available DON that supports the main chain on which they wish to operate or spawn additional DONs with committees of nodes they trust. For some applications, however, particularly smart contracts, Chainlink users may favor a trust model that treats the main chain supported by a DON as more trustworthy than the DON itself. For such users, we already have or plan to incorporate into the architecture of the Chainlink network a number of mechanisms that enable contracts on a main chain to strengthen the security assurances provided by DONs, while at the same time also enforcing protections against the possibility of corrupted data sources such as the web servers from which the DON obtains data. We describe these mechanisms in Section 7. They fall under five main headings: • Data-source authentication: Tools that enable data providers to digitally sign their data and thereby strengthen the chain of custody between the origin and relying contract. • DON minority reports: Flags issued by a minority subset of DON nodes that observes majority malfeasance in the DON. • Guard rails: Logic on a main chain that detects anomalous conditions and pauses or halts contract execution (or invokes other remediations). • Trust-minimized governance: Use of gradual-release updates to facilitate community inspection, as well as decentralized emergency interventions for rapid response to system failures. • Decentralized entity authentication: Use of public-key infrastructure (PKI) to identify entities in the Chainlink network. Fig. 7 presents a conceptual schematic of our trust-minimization goals. Incentive-based (cryptoeconomic) security: Decentralization of report generation across oracle nodes helps ensure security even when some nodes are corrupted.

Conceptual depiction of Chainlink trust-minimization goal showing DON and data source trust loci

Figure 7: Conceptual depiction of Chainlink’s trust-minimization goal, which is to minimize users’ need for correct behavior of the DON and data sources such as web servers. Yellow highlights in the figure indicate trust-minimization loci: the DON and individual or minority sets of web servers. Pink highlights indicate system components that are highly trustworthy by assumption: contracts on the blockchain and a majority of web servers, i.e., web servers in the aggregate. Equally important, though, is ensuring that nodes have a financial incentive to behave correctly. Staking, i.e., requiring nodes to provide deposits of LINK and slashing (confiscating) these deposits in case of misbehavior, will play a key role in Chainlink. It is an important incentive design already used in a number of blockchains, e.g., [81, 103, 120, 204]. Staking in Chainlink, however, looks very different from staking in standalone blockchains. Staking in blockchains aims to prevent attacks on consensus. It has a different goal in Chainlink: to ensure timely delivery of correct oracle reports. A welldesigned staking system for an oracle network should render attacks such as bribery unprofitable for an adversary, even when the target is a smart contract with high monetary value. In this paper, we present a general approach to staking in Chainlink with three key innovations:

Conceptual diagram depicting super-linear scaling in Chainlink staking where briber cost grows faster than combined node deposits

  1. A powerful adversarial model that encompasses attacks overlooked in existing approaches. One example is what we call prospective bribery. This is a form of bribery that determines which nodes receive bribes on a conditional basis, e.g., offers guaranteed bribes in advance to nodes that a staking mechanism selects at random for particular roles (such as triggering report adjudication).
  2. Super-linear staking impact, meaning informally that to be successful, an adversary must have a budget $B greater than the combined deposits of all oracle nodes. More precisely, we mean that as a function of n, \(B(n) ≫\)dn in a network of n oracle nodes each with a fixed deposit amount $d (more formally, \(B(n) is asymptotically larger in n than \)dn). Fig. 8 gives a conceptual view of this property.
  3. The Implicit-Incentive Framework (IIF), an incentive model we have devised to encompass empirically measurable incentives beyond explicit deposited staking funds, including nodes’ future fee opportunities. The IIF extends the notion of stake beyond explicit node deposits. Figure 8: Conceptual diagram depicting super-linear scaling in Chainlink staking. The bribe $B(n) required by an adversary grows faster in n than the combined deposits $dn of all oracle nodes. We show how the IIF and super-linear staking impact together induce what we call a virtuous cycle of economic security for oracle networks. When new users enter

the system, increasing potential future earnings from running Chainlink nodes, the marginal cost of economic security drops for current and future users. In a regime of elastic demand, this diminished cost incentivizes additional users to make use of the network, continuously perpetuating adoption in an ongoing virtuous cycle. Note: While this whitepaper outlines important elements of our vision for the evolution of Chainlink, it is informal and includes few detailed technical specifics. We plan to release focused technical papers on additional features and approaches as they evolve. Furthermore, it is important to emphasize that many elements of the vision presented here (scaling improvements, confidentiality technologies, FSS, etc.) can and will be deployed in preliminary form even before advanced DONs become a basic feature of Chainlink. 1.3 Organization of this Paper We present our security model and notation in Section 2 and outline the Decentralized Oracle Network API in Section 3. In Section 4, we present a number of examples of applications for which DONs provide an appealing deployment platform. Readers can learn most of the key concepts of the paper by reading up to this point. The remainder of the paper contains further details. We describe Fair Sequencing Services (FSS) in Section 5 and the Transaction-Execution Framework (TEF) in Section 6. We describe our approach to trust minimization in Section 7. We consider some important DON deployment requirements, namely incremental rollout of features, dynamic ledger membership, and accountability in Section 8. Finally, in Section 9, we give an overview of our developing approach to incentive design. We conclude in Section 10. To help readers who have limited familiarity with the concepts in this paper, we provide a glossary in Appendix A. We present further detail on the DON interface and functionality in Appendix B and present some example adapters in Appendix C. In Appendix D, we describe a cryptographic primitive for trust-minimized data-source authentication called functional signatures and introduce a new variant called discretized functional signatures. We discuss some considerations bearing on committee selection for DONs in Appendix F.

介绍

Conceptual figure showing how a Decentralized Oracle Network can realize basic oracle functionality by relaying off-chain data to a contract

Conceptual figure depicting on-chain and off-chain contract composition in a hybrid smart contract architecture

如今,区块链 oracle 通常被视为具有一个目标的去中心化服务: 将数据从链下资源转发到 blockchains。虽然这只是一小步, 从转发数据到计算、存储或双向传输。这一观察结果证实了 oracles 功能的更广泛概念。也是如此 满足 smart contract 不断增长的服务需求并且日益多元化 依赖 oracle 网络的技术。简而言之,oracle 可以而且需要 成为链上和链下系统之间的通用、双向、支持计算的接口。预言机在 blockchain 生态系统中的作用是增强 smart contract 的性能、功能和互操作性,以便它们能够 为多个行业带来新的信任模式和透明度。这种转变将通过扩大混合 smart contract 的使用来实现,它融合了 blockchains 的特殊属性以及链下系统的独特功能,例如 oracle 网络,从而实现比链上系统更大的覆盖范围和能力 处于孤立状态。 在本白皮书中,我们阐述了 Chainlink 2.0 的愿景,这是 Chainlink 的演变,超越了原始 Chainlink 白皮书 [98] 中的最初构想。我们预见 oracle 网络的作用将日益扩大,其中 它们通过为混合动力提供快速、可靠且保密的通用连接和计算来补充和增强现有和新的 blockchain smart contracts。我们相信 oracle 网络甚至会发展成为公用事业 用于将高完整性 blockchain 级数据导出到 blockchain 之外的系统 生态系统。 如今,由不同实体集运行的 Chainlink 节点聚集在 oracle 网络中,将数据转发到 smart contract,即所谓的报告。我们可以查看这样的 oracle 节点作为类似于经典共识 blockchain [72] 中的委员会, 但目标是支持现有的 blockchain,而不是提供独立的功能。具有可验证的随机函数(VRF)和链外报告 (OCR),Chainlink 已经向通用框架和基础设施发展,以提供 smart contracts 所需的计算资源 先进的功能。 我们的 Chainlink 2.0 计划的基础是我们所说的去中心化预言机 网络,简称 DONs。由于我们在 中引入了术语“oracle 网络” 原始 Chainlink 白皮书 [98]、oracle 开发了更丰富的功能和 应用范围。在本文中,我们根据 我们对 Chainlink 生态系统的未来愿景。在此视图中,DON 是一个网络 由 Chainlink 节点委员会维护。植根于共识协议,它 支持任何无限范围的 oracle 选择用于部署的功能 委员会。因此,DON 充当 blockchain 抽象层,提供接口 smart contract 和其他系统的链外资源。它还提供 访问高效且去中心化的链下计算资源。一般来说, a DON 支持主链上的操作。其目标是实现安全和灵活ble Hybrid smart contracts,将链上和链外计算与 与外部资源的连接。 我们强调,即使在 DONs 中使用委员会,Chainlink 本身 本质上仍然是未经许可的。 DONs 充当无需许可的基础 框架,其中节点可以聚集在一起实现自定义 oracle 网络 他们自己的节点包含制度,可能是经过许可的,也可能是未经许可的。 以 DONs 为基础,我们计划在 Chainlink 2.0 中重点关注七个方面的进展 关键领域:混合 smart contracts、抽象复杂性、扩展性、保密性、交易秩序公平性、信任最小化和基于激励的(加密经济)安全性。在本文的介绍中,我们概述了去中心化 第 1.1 节介绍了 Oracle 网络,然后第 1.2 节介绍了我们的七个关键创新领域。我们在 1.3 节中描述了本文其余部分的组织。 1.1 去中心化预言机网络 去中心化预言机网络旨在增强和扩展功能 目标 blockchain 或主链上的 smart contract 通过以下函数 本地不可用。他们通过提供以下三种基本资源来做到这一点: 计算系统:网络、存储和计算。 DON 旨在提供 这些资源具有很强的保密性、完整性和可用性,1 以及问责制。 DON 由 oracle 节点组成的委员会组成,这些节点合作完成特定的任务 工作或选择建立长期关系以提供持久的服务 给客户。 DON 以与 blockchain 无关的方式设计。他们承诺将作为 一个强大而灵活的工具,供应用程序开发人员创建链下支持 他们在任何受支持的主链上的 smart contract。 有两种类型的功能实现 DON 的功能:可执行文件和 适配器。可执行文件是在 DON 上以分散方式连续运行的程序。虽然它们不直接存储主链资产,但它们具有重要的好处,包括高性能和执行机密的能力 计算。可执行文件在 DON 上自主运行并执行确定性 操作。它们与将 DON 连接到外部资源的适配器协同工作 并且可以由可执行文件调用。正如我们为 DON 设想的那样,适配器是一个 今天 Chainlink 中外部适配器的通用化。虽然现有适配器 通常仅从数据源获取数据,适配器可以双向操作;在 DONs,它们还可以利用 DON 节点的联合计算来实现 附加功能,例如加密报告以保护隐私 一个可执行文件。 为了让您了解 DON 的基本操作,图 1 从概念上展示了 DON 是如何 DON 可用于将报告发送到 blockchain,从而实现传统的现有 oracle 功能。然而,DONs 可以提供许多附加功能 1信息安全的“中央情报局三合会”[123,第 14 页] 26,第 2.3.5 节]。Chainlink 的现有网络。例如,在图1的总体结构中, 可执行文件可以在 DON 上记录获取的资产价格数据,使用这些数据 计算例如其报告的追踪平均值。 图 1:概念图,以示例显示去中心化预言机网络如何实现基本的 oracle 功能,即将链外数据中继到合约。安 可执行文件使用适配器来获取链外数据,并对其进行计算,发送输出 通过另一个适配器连接到目标 blockchain。 (适配器由以下代码启动 DON,用小蓝框表示;箭头表示数据流的方向 特定示例。)可执行文件还可以读取和写入本地 DON 用于保持状态和/或与其他可执行文件通信的存储。 DONs 中灵活的网络、计算和存储,全部都在这里展示,使许多新颖的 应用程序。 DON 的一个主要好处是它们能够引导新的 blockchain 服务。 DONs 是现有oracle网络可以快速建立服务应用程序的工具 今天,这需要创建专门的网络。我们给出了一些 第 4 节中此类应用的示例。 在第 3 节中,我们提供了有关 DON 的更多详细信息,描述了它们的功能 他们向开发人员和用户呈现的界面术语。 1.2 七个关键设计目标 在这里,我们简要回顾一下上面列举的七个关键点: Chainlink,即:混合 smart contracts: 我们 Chainlink 愿景的核心是安全的理念 在 smart contracts 中组合链上和链下组件。我们参考合同 通过混合 smart contract 或混合合约来实现这一想法。2 区块链现在并将继续在去中心化服务中发挥两个关键作用 生态系统:它们都是代表加密货币所有权的场所 以及去中心化服务的强大锚点。因此,智能合约必须在链上表示或执行,但其链上功能受到严重限制。纯粹地 链上合约代码缓慢、昂贵且孤立,无法从现实世界中受益 数据和各种在链上本质上无法实现的功能,包括各种形式的机密计算、(伪)随机性安全的生成 反对矿工/validator操纵等。 因此,为了让smart contracts充分发挥其潜力,需要smart contracts 由两部分组成:链上部分(我们通常用 SC 表示) 以及链下部分,即在 DON 上运行的可执行文件(我们通常用 执行)。目标是实现链上功能的安全组合 DONs 旨在提供多种链下服务。两部分放在一起 制定混合合同。我们在图 2 中概念性地提出了这个想法。今天, Chainlink 服务3(例如数据馈送和 VRF)正在实现原本无法实现的目标 smart contract 应用程序,范围从 DeFi 到公平生成的 NFT 到去中心化保险,作为迈向更通用框架的第一步。作为 Chainlink 服务 根据我们在本白皮书中的愿景,扩大并提高绩效,也是如此 smart contract 系统在所有 blockchain 上的能力。 我们在本白皮书中的其他六个重点可能被视为服务中的行为 第一个是混合合同的总体内容。这些焦点涉及消除可见的 混合合约的复杂性,创建额外的链下服务,使 构建能力更强的混合合约,并且在信任最小化的情况下,增强混合合约所实现的安全属性。我们留下想法 混合合约隐含在本文的大部分内容中,但任何组合 具有 DON 的主链逻辑可以被视为混合合约。 抽象掉复杂性: DONs 旨在利用去中心化的 通过抽象出通常复杂的机制,为开发人员和用户提供方便的系统 DONs 强大而灵活的一系列服务的背后。 现有 Chainlink 服务 已经有这个功能了。 例如,Chainlink 中的数据馈送现在提供了链上接口,这些接口不需要开发人员关心协议级别的细节,例如 OCR 强制执行共识报告的方式。 2链上/链下合约组合的想法之前已经在各种受限环境中出现过 形式,例如,第 2 层系统、基于 TEE 的 blockchains [80] 等。我们的目标是支持和泛化 这些方法并确保它们可以包含链外数据访问和其他关键 oracle 服务。 3Chainlink 服务包括各种可通过以下方式获得的去中心化服务和功能: 网络。它们由组成各种 oracle 网络的众多节点运营商提供 整个生态系统。图 2:描述链上/链下合约构成的概念图。一个 混合 smart contract 3⃝由两个互补的组件组成:一个链上组件 组件 SC 1⃝,驻留在 blockchain 上,以及链外组件 exec 2⃝ 在 DON 上执行。 DON 也充当两个组件之间的桥梁 将混合合约与链下资源(例如网络服务、其他资源)连接起来 blockchains、去中心化存储等 分散的节点集。 DONs 更进一步,因为它们扩展了 Chainlink 可以为开发人员提供抽象层的一系列服务 伴随高级服务的简化界面。 我们在第 4 节中介绍了几个应用示例来强调这种方法。 例如,我们设想企业使用 DONs 作为一种安全中间件形式 将他们的旧系统连接到 blockchains。 (参见第 4.2 节。)DON 的这种使用抽象了一般 blockchain 动态的复杂性(费用、重组等)。它还 抽象出特定 blockchain 的功能,从而使企业能够将其现有系统连接到不断扩大的 blockchain 系统,而无需 需要这些系统或更广泛的分散系统开发方面的专业知识。 最终,我们的目标是推动 Chainlink 实现的抽象程度 到了实现我们所说的去中心化元层的程度。这样的一层 将为所有类别的开发人员抽象出链上/链下的区别 和 DApp 的用户,允许无缝创建和使用去中心化服务。为了简化开发过程,开发人员可以将元层中的 DApp 功能指定为统一机器模型中的虚拟应用程序。他们可以 然后使用去中心化元层编译器自动将 DApp 实例化为 一组互操作的分散功能,涵盖 blockchains、DONs 和 外部服务。 (这些外部服务之一可以是企业系统,使得元层对于涉及遗留企业系统的应用程序非常有用。) 编译类似于现代编译器和软件开发工具包 (SDK) 支持通才程序员充分发挥异构硬件的潜力 由通用 CPU 和 GPU 等专用硬件组成的架构, 机器学习加速器或可信飞地。图 3 在概念层面上展示了这一想法。 混合 smart contract 是实现这一愿景和我们称为元合约的概念的第一步。元合约是在去中心化平台上编码的应用程序 元层并隐式包含链上逻辑 (smart contracts),以及各种 blockchains 和现有链下之间的链下计算和连接 服务。考虑到对语言和编译器支持、新安全模型的需求,以及 然而,不同技术的概念和技术协调 真正的去中心化元层是一个雄心勃勃的目标,我们长期以来一直渴望实现这一目标 时间范围。尽管如此,它仍然是一个在阅读时牢记的有用的理想模型 这篇论文,这里没有详细介绍,但我们计划在未来的工作中重点关注 Chainlink。 缩放比例: 在我们不断发展的设计中,一个极其重要的目标是使 Chainlink 网络,以满足 blockchain 生态系统不断增长的扩展需求。 随着网络拥塞成为现有无许可环境中反复出现的问题 blockchains [86],新的、性能更高的 blockchain 设计正在投入使用, 例如,[103,120,203],以及补充的第 2 层扩展技术,例如[5, 12、121、141、169、186、187]。 Oracle 服务必须实现延迟和吞吐量 满足这些系统的性能需求,同时最大限度地减少链上费用 (例如,天然气成本)对于合同运营商和普通用户来说都是如此。与 DONs、Chainlink 功能旨在更进一步,为纯粹基于网络的系统提供足够高的性能。 DONs 的大部分性能提升来自于使用快速、基于委员会或无需许可的共识协议,并将其与 blockchains 相结合 他们支持。我们期望许多具有不同配置的 DON 并行运行;不同的 DApp 和用户可以在底层共识选择中进行权衡 根据他们的应用要求。 DONs 实际上可以被视为第 2 层技术。 我们期望其中 其他服务,DONs 将支持事务执行框架 (TEF),该框架 促进 DONs 以及 oracles 与其他高性能的有效集成 第 2 层系统——例如 rollups,将链下交易捆绑在一起以实现 性能改进。我们在第 6 节中介绍了 TEF。

Conceptual figure showing ideal realization of a decentralized metalayer that abstracts blockchain and DON complexity

图 3:概念图显示了去中心化元层的理想实现。对于 为了便于开发,开发人员指定一个 DApp(以粉色突出显示)作为虚拟的 统一机器模型中的应用。去中心化元层编译器自动生成相应的互操作功能:smart contracts(表示为 由 SC 表示)、DON 上的逻辑(由 exec 表示)、连接到目标外部服务的适配器等等,如黄色突出显示所示。 图 4 从概念上展示了 DONs 如何改进 blockchain (smart contract) 缩放 通过集中交易和oracle-报告处理在链外,而不是在链上 链。计算主要位置的这种转变减少了交易延迟并 费用,同时提高交易吞吐量。 保密性: 区块链为 smart contract 及其实现的应用程序提供了前所未有的透明度。但透明度和保密性之间存在着基本的紧张关系。例如,今天,用户的去中心化交易所交易图 4:概念图显示去中心化预言机网络如何改进 blockchain 启用的 smart contracts 的缩放。图A ⃝显示传统的oracle 架构。交易直接发送至 blockchain,oracle 报告也是如此。 因此,以黄色突出显示的 blockchain 是事务处理的主要位置。图 B⃝显示了使用 DON 来支持 blockchain 上的合约。 DON 可执行文件处理交易以及来自外部系统的数据并转发 结果(例如,由于交易影响而导致的捆绑交易或合约状态更改)发送至 blockchain。因此,以黄色突出显示的 DON 是主要的 交易处理的场所。 行为记录在链上,方便监控交易所行为,同时也 使用户的金融交易公开可见。同样,数据转发到智能 合约仍然在链上。这使得此类数据可以方便地进行审计,但充当 对于希望向 smart contracts 提供敏感或敏感信息的数据提供商来说,这是一种抑制因素 专有数据。 我们相信 oracle 网络将在催化下一代方面发挥关键作用 将 blockchains 固有的透明度与新的保密保护相结合的系统。在本文中,我们展示了他们如何使用三种主要方法来做到这一点: • 保密适配器:计划部署的两种技术 在 Chainlink 的网络中,DECO [234] 和 Town Crier [233],启用 oracle 节点 以保护用户隐私和数据的方式从链下系统检索数据 保密性。它们将在 DON 的适配器设计中发挥关键作用。 (有关这两种技术的详细信息,请参见第 3.6.2 节。) • 机密计算:DONs 可以简单地向依赖blockchains 隐藏其计算。使用安全的多方计算和/或可信执行环境,还可以实现更强的保密性,其中 DON 节点 对他们本身不可见的数据进行计算。

Example comparing standard mining with Fair Sequencing Services showing how FSS prevents transaction reordering

Conceptual diagram of confidentiality-preserving operations in a DON processing sensitive data through adapters

• 支持机密第 2 层系统:TEF 旨在支持各种第 2 层系统,其中许多系统使用零知识证明来提供 各种形式的交易保密性。 我们在第 3 节中讨论这些方法(更多详细信息请参见第 6 节、附录 B.1 和附录 B.2)。 图 5 展示了敏感数据如何通过保密适配器从外部源流向 smart contract 的概念视图 DON 中的机密计算。 图 5:DON 上的保密操作的概念图 敏感数据(以黄色突出显示)。 网络中的敏感源数据(黑圈) 使用保密适配器(蓝色双箭头线)将服务器提取到 DON。 DON 从这些适配器接收派生数据(空心圆圈)— 将函数或秘密共享等应用到敏感源的结果 数据。 DON 上的可执行文件可以对派生数据应用机密计算 构建报告(双圆圈),通过适配器将其发送到 blockchain。 我们相信,处理机密数据的强大工具将打开一个完整的领域。 应用范围。 其中包括私人去中心化(和中心化)金融、去中心化身份、基于信用的链上借贷以及更高效、更高效的金融服务。 用户友好的了解你的客户和认证协议,正如我们在第 4 节中讨论的那样。 交易的顺序公平性: 今天的 blockchain 设计有点肮脏 公开的秘密:它们是暂时集中的。矿工和 validators 可以订购交易无论他们选择什么行动。用户也可以操纵交易顺序 他们支付的网络费用的函数(例如 Ethereum 中的汽油价格)以及某些 利用快速网络连接的优势。这种操纵可以,对于 例如,采取抢先交易的形式,其中战略参与者(例如矿工) 观察用户的交易并将其自己的可利用交易插入到较早的交易中 在同一个区块中的位置——利用对用户交易的预先了解,有效地从用户那里窃取资金。例如,机器人可能会下买单 在用户之前。然后,它可以利用由资产价格上涨引起的资产价格上涨。 用户的交易。 一些机器人抢先交易,损害普通用户——类似于高频 华尔街交易已经很普遍并且有据可查 [90],如相关 诸如后台运行 [159] 和自动交易模仿 [195] 等攻击。最近甚至出现了将矿工的订单利用系统化的提议[110]。 rollups 等第 2 层技术并不能解决问题,而只是重新集中化 排序,将其置于创建 rollup 的实体手中。 我们的目标之一是向 Chainlink 引入一项名为“公平排序”的服务 服务 (FSS) [137]。 FSS 帮助 smart contract 设计师确保其产品的公平订购 避免对用户交易以及其他类型的交易(例如 oracle 报告传输)进行前置、后台和相关攻击。 FSS 使 DON 能够实现 [144] 中引入的严格的、暂时的秩序公平概念等想法。作为一个附带的好处,FSS 还可以降低用户的网络 费用(例如燃气费)。 简而言之,在 FSS 中,交易通过 DON,而不是直接传播到目标 smart contract。 DON 对交易进行排序,然后转发 他们签订合同。 图 6:FSS 如何发挥作用的示例。图A ⃝展示了矿工如何利用其 集中权力来排序交易,可以交换一对交易:交易1⃝ 在 2⃝ 之前到达,但矿工将其排序在 2⃝ 之后。相比之下,图B⃝显示 DON 如何在 DON 节点之间分散排序过程。如果法定人数为 诚实节点在 2⃝ 之前收到 1⃝,FSS 导致 1⃝ 在链上出现在 2⃝ 之前 — 通过附加合同可执行的序列号来防止矿工重新排序。 图 6 比较了标准挖矿与 FSS。它展示了如何在标准挖矿中,交易排序过程由矿工集中处理,因此受制于 操纵,例如对一对交易的到达进行重新排序 次。相比之下,在 FSS 中,该过程分散在 DON 节点之间。假设 诚实节点的法定数量,FSS 有助于执行策略,例如时间排序 交易,减少矿工和其他实体操纵的机会。 此外,由于用户无需根据Gas价格来争夺优先订购权, 他们可以支付相对较低的汽油价格(而来自 DON 的交易可以批量进行 以节省燃气)。 信任最小化: 我们设计 DONs 的总体目标是促进高度 对 smart contract 和其他 oracle 依赖系统的值得信赖的支持层 通过去中心化、加密工具和加密经济保证。 DON 本身是去中心化的,用户可以从任何可用的 DON 中进行选择 支持他们希望在其上操作或产生额外 DON 的主链 与他们信任的节点委员会。 然而,对于某些应用程序,特别是 smart contracts,Chainlink 用户可能会 支持将 DON 支持的主链视为更值得信赖的信任模型 比 DON 本身。对于此类用户,我们已经或计划将其纳入 Chainlink 网络的架构 一些支持合约的机制 在主链上,以加强 DONs 提供的安全保证,同时在 同时还加强保护,防止数据源损坏的可能性 例如 DON 从中获取数据的 Web 服务器。 我们在第 7 节中描述了这些机制。它们分为五个主要标题: • 数据源身份验证:支持数据提供者进行数字签名的工具 他们的数据,从而加强原产地和 依赖合同。 • DON 少数报告:由 DON 节点的少数子集发出的标志 观察到 DON 中存在多数渎职行为。 • 护栏:主链上的逻辑,用于检测异常情况并暂停 或停止合同执行(或调用其他补救措施)。 • 信任最小化治理:利用逐步发布的更新来促进社区检查,以及分散的紧急干预措施以实现快速 对系统故障的响应。 • 去中心化实体身份验证:使用公钥基础设施 (PKI) 识别 Chainlink 网络中的实体。 图 7 展示了我们的信任最小化目标的概念示意图。 基于激励(加密经济)的安全性: 跨 oracle 节点分散生成报告有助于确保安全,即使某些节点损坏也是如此。

Conceptual diagram depicting super-linear scaling in Chainlink staking where briber cost grows faster than combined node deposits

Conceptual depiction of Chainlink trust-minimization goal showing DON and data source trust loci

图 7:Chainlink 信任最小化目标的概念描述,即 最大限度地减少用户对 DON 和数据源(例如网络)正确行为的需求 服务器。图中的黄色突出显示表示信任最小化位点:DON 和 单个或少数网络服务器组。粉色高亮显示系统组件 假设高度可信:blockchain 上的合同和大多数 Web 服务器的数量,即 Web 服务器的总数。 然而,同样重要的是确保节点有正确行为的经济激励。质押,即要求节点提供 LINK 押金和削减 如果出现不当行为,(没收)这些存款将在 Chainlink 中发挥关键作用。这是一个重要的激励设计,已在许多 blockchain 中使用, 例如,[81、103、120、204]。 然而,在 Chainlink 中的质押看起来与独立的 staking 有很大不同 blockchains。质押 blockchains 的目的是防止对共识的攻击。它有一个 Chainlink 中的不同目标:确保及时交付正确的 oracle 报告。用于 oracle 网络的精心设计的 staking 系统应该会引发诸如贿赂之类的攻击 即使目标是具有高值的 smart contract,对对手来说也是无利可图的 货币价值。 在本文中,我们提出了 Chainlink 中 staking 的通用方法,具有三个关键 创新点:1. 强大的对抗模型,涵盖现有技术中被忽视的攻击 接近。一个例子就是我们所说的潜在贿赂。这是一种形式 贿赂,确定哪些节点有条件地接受贿赂,例如, 提前向 staking 机制选择的节点提供有保证的贿赂 对于特定角色是随机的(例如触发报告裁决)。 2. 超线性 staking 影响,非正式地意味着要成功,对手的预算 B 美元必须大于所有 oracle 存款的总和 节点。 更准确地说,我们的意思是,作为 n 的函数, \(B(n) ≫\)dn 在 由 n 个 oracle 节点组成的网络,每个节点都有固定的存款金额 $d(更正式地说, \(B(n) is asymptotically larger in n than \)dn)。图8给出了概念图 此属性。 3. 隐性激励框架(IIF),我们设计的激励模型 除了明确存入staking之外,还包括根据经验可衡量的激励措施 资金,包括节点未来的费用机会。 IIF 扩展了以下概念: 超出明确节点存款的权益。 图 8:描述 Chainlink staking 中超线性缩放的概念图。的 对手所需的贿赂 $B(n) 在 n 中的增长速度快于存款总额的增长速度 所有 oracle 节点的 $dn。 我们展示了 IIF 和超线性 staking 共同影响如何导致我们 称之为 oracle 网络经济安全的良性循环。当新用户进入时

系统,增加运行 Chainlink 节点的未来潜在收入, 当前和未来用户的经济安全边际成本下降。在一个政权 需求弹性,成本的降低会激励更多用户使用 网络,在持续的良性循环中持续不断地采用。 注意:虽然本白皮书概述了我们对 Chainlink 发展愿景的重要元素,但它是非正式的,并且包含一些详细的技术细节。我们计划 随着其他功能和方法的发展,发布重点技术论文。 此外,必须强调的是,所提出的愿景的许多要素 这里(扩展改进、保密技术、FSS 等)可以而且将会 甚至在高级 DON 成为基本功能之前就以初步形式部署 Chainlink。 1.3 本文的组织 我们在第 2 节中介绍了我们的安全模型和符号,并概述了去中心化 Oracle Network API 在第 3 节中。在第 4 节中,我们提供了一些示例 DONs 为其提供有吸引力的部署平台的应用程序。读者可以 通过阅读到目前为止,您可以了解本文的大部分关键概念。 本文的其余部分包含更多详细信息。我们描述公平排序 第 5 节中的服务 (FSS) 和第 6 节中的事务执行框架 (TEF)。我们在第 7 节中描述了我们的信任最小化方法。我们考虑了一些 重要的 DON 部署要求,即第 8 节中的功能增量推出、动态账本成员资格和问责制。最后,在第 9 节中,我们给出 我们正在开发的激励设计方法的概述。我们在第 10 节中得出结论。 为了帮助对本文概念了解有限的读者,我们 附录 A 中提供了术语表。我们提供了有关 DON 接口的更多详细信息 和功能见附录 B,并在附录 C 中介绍一些示例适配器。 在附录 D 中,我们描述了信任最小化数据源的加密原语 身份验证称为功能签名,并引入一种称为离散功能签名的新变体。我们讨论与委员会有关的一些考虑因素 附录 F 中 DONs 的选择。

Conceptual figure showing how DONs improve blockchain smart contract scaling by moving computation off-chain

Security Model and Goals

Security Model and Goals

A Decentralized Oracle Network is a distinct distributed system that we expect will initially be implemented typically—although not necessarily—by a committee-based consensus protocol and run by a set of oracle nodes. A DON is designed primarily to augment the capabilities of a smart contract on a main chain with oracle reports and other services, but it can provide those same supporting services to other nonblockchain systems, and thus need not be associated with a particular main chain.

The model and properties we consider are therefore largely independent of the use of the particular applications of a DON. 2.1 Current Architectural Model It is important to emphasize that Chainlink today is not a monolithic service, but rather a permissionless framework within which it is possible to launch distinct, independent networks of oracle nodes [77]. Networks have heterogeneous sets of node operators and designs. They may also differ in terms of the types of services they provide, which can include, e.g., data feeds, Proof of Reserves, verifiable randomness, and so forth. Other differences can include the degree of decentralization, size of the network in terms of locked value it supports, and various service-level parameters, such as data frequency and accuracy. Chainlink’s permissionless model encourages the growth of an ecosystem in which providers specialize in the services they are best able to furnish to the community. This model is likely to result in lower costs to users and higher service quality than a model that requires all nodes and networks to provide a full range of services, an approach that can easily devolve into system-wide adoption of the services representing the least common denominator of resources available to nodes. As Chainlink evolves toward DON-based designs in Chainlink 2.0, we continue to support the model of a permissionless, open framework, keeping in view the goal of providing users with a range of service choices that globally result in the best match with particular application requirements. 2.2 Consensus Assumptions We use the term Decentralized Oracle Network to encompass the full functionality of the oracle system we describe: both the data structure that oracle nodes maintain and the core API layered on top of it. We use the term ledger (lower case), denoted by L, to mean the underlying data structure maintained by a DON and used to support the particular services it provides. We emphasize that our DON framework does not treat L as a freestanding system like a blockchain: Its purpose is to support blockchains and other systems. Blockchains are, of course, one way of realizing a trustworthy ledger, but there are others. We expect DONs in many cases to realize their underlying ledgers using Byzantine Fault Tolerant (BFT) systems, which considerably predate blockchains such as Bitcoin [174]. We use BFT-type notation and properties throughout the paper for convenience, although we emphasize that DONs can be realized using permissionless consensus protocols. Conceptually, a ledger L is a bulletin board on which data is linearly ordered. We view a ledger generally as having a few key properties commonly ascribed to blockchains [115]. A ledger is: • Append-only: Data, once added, cannot be removed or modified.

• Public: Anyone can read its contents, which are consistent across time in the view of all users.4 • Available: The ledger can always be written to by authorized writers and read by anyone in a timely way. Alternative properties are possible in the ledger for a DON when realized by a committee. For instance, ledger write access might be restricted to certain users, as might read access for some applications, i.e., the ledger need not be public as defined above. Similarly, ledger rules might permit modification or redaction of data. We don’t explicitly consider such variants in this paper, however. The modular design of DONs can support any of a wide variety of modern BFT protocols, e.g., Hotstuff[231]. The exact choice will depend on trust assumptions and network characteristics among the oracle nodes. A DON could in principle alternatively use a highly performant permissionless blockchain for its ledger in its role supporting an equally scalable layer-2 or blockchain system. Similarly, hybridization is also possible: The DON could in principle be composed of nodes that are validators in an existing blockchain, e.g., in Proof-of-Stake systems in which committees are selected to execute transactions, e.g., [8, 81, 120, 146, 204]. This particular mode of operation requires that nodes operate in a dual-use manner, i.e., operate both as blockchain nodes and DON nodes. (See Section 8.2 for a discussion of techniques to ensure continuity in changing committees and Appendix F for some caveats on random committee selection.) In practice, in modern BFT algorithms, nodes digitally sign messages on the ledger. We assume for convenience that L has an associated public key pkL and that its contents are signed by the corresponding private key. This general notation applies even when data on L are signed using threshold signatures.5 Threshold signatures are convenient, as they enable a persistent identity for a DON even with changes of membership in the nodes running it. (See Appendix B.1.3.) We thus assume that \(sk_L\) is secret-shared in a \((k, n)\)-threshold manner for some security parameter \(k\), e.g., \(k = 2f + 1\) and \(n = 3f + 1\), where \(f\) is the number of potentially faulty nodes. (By choosing \(k\) in this way, we ensure that faulty nodes can neither learn \(sk_L\) nor mount a denial-of-service attack preventing its use.) A message on L takes the form M = (m, z), where m is a string and z a unique sequential index number. Where applicable, we write messages in the form m = ⟨MessageType : payload⟩. The message type MessageType is syntactic sugar that indicates the function of a particular message. 4In cases where a blockchain without finality realizes a ledger, inconsistency is typically abstracted away by disregarding insufficiently deep blocks or “pruning” [115]. 5In practice, some code bases, e.g., LibraBFT [205], a variant of Hotstuff, have currently adopted multi-signatures, rather than threshold signatures, trading offreduced communication complexity for simpler engineering. With some added cost, oracle nodes can append threshold signatures to messages written to L even if the consensus protocol used for L doesn’t employ them.

2.3 Notation We denote the set of \(n\) oracle nodes running the ledger by \(O = \{O_i\}_{i=1}^{n}\). Such a set of nodes is often called a committee. For simplicity, we assume that the set of oracles implementing DON functionality, i.e., services on top of L, is identical with that maintaining L, but they can be distinct. We let \(pk_i\) denote the public key of player \(O_i\), and \(sk_i\) the corresponding private key. Most BFT algorithms require at least \(n = 3f + 1\) nodes, where \(f\) is the number of potentially faulty nodes; remaining nodes are honest, in the sense that they follow the protocol exactly as specified. We refer to the committee O as honest if it meets this requirement, i.e., has greater than a \(2/3\)-fraction of honest nodes. Unless otherwise stated, we assume that O is honest (and a static model of corruption). We use \(pk_O\) / \(sk_O\) interchangeably with \(pk_L\) / \(sk_L\), depending on the context. We let \(\sigma = \text{Sig}_{pk}[m]\) denote a signature on message \(m\) with respect to \(pk\), i.e., using corresponding private key \(sk\). Let \(\text{verify}(pk, \sigma, m) \rightarrow \{false, true\}\) denote a corresponding signature verification algorithm. (We leave key generation implicit throughout the paper.) We use the notation \(S\) to denote a data source and \(\mathcal{S}\) to denote the full set of \(n_S\) sources in a given context. We denote by MAINCHAIN a smart-contract enabled blockchain supported by a DON. We use the term relying contract to denote any smart contract on MAINCHAIN that communicates with a DON, and use the notation SC to denote such a contract. We generally assume that a DON supports a single main chain MAINCHAIN, although it can support multiple such chains, as we show in examples in Section 4. A DON can and typically will support multiple relying contracts on MAINCHAIN. (As noted above, a DON can alternatively support non-blockchain services.) 2.4 Note on Trust Models As noted above, DONs may be built atop committee-based consensus protocols, and we expect they will commonly use such protocols. There are many strong arguments that one of the two alternatives, committee-based or permissionless blockchains, provides stronger security than the other. It is important to recognize that the security of committee-based vs. permissionless decentralized systems is incommensurable. Compromising a PoW or a PoS blockchain via 51% attack requires that an adversary obtain majority resources ephemerally and potentially anonymously, for example by renting hash power in a PoW system. Such attacks in practice have already impacted several blockchains [200, 34]. In contrast, compromising a committee-based system means corrupting a threshold number (typically one-third) of its nodes, where the nodes may be publicly known, well resourced, and trustworthy entities. On the other hand, committee-based systems (as well as “hybrid” permissionless systems that support committees) can support more functionality than strictly per-

missionless systems. This includes the ability to maintain persistent secrets, such as signing and/or encryption keys—one possibility in our designs. We emphasize that DONs can in principle be built atop either a committee-based or permissionless consensus protocol and DON deployers may ultimately choose to adopt either approach. Bolstering trust models: A key feature of Chainlink today is the ability of users to select nodes based on decentralized records of their performance histories, as discussed in Section 3.6.4. The staking mechanism and Implicit-Incentive Framework we introduce in Section 9 together constitute a broadly scoped and rigorous mechanism-design framework that will empower users with a greatly expanded ability to gauge the security of DONs. This same framework will also make it possible for DONs themselves to enforce various security requirements on participating nodes and ensure operation within strong trust models. It is also possible using tools described in this paper for DONs to enforce special trust-model requirements, such as compliance with regulatory requirements. For example, using techniques discussed in Section 4.3, nodes can present evidence of node-operator characteristics, e.g., territory of operation, that can be used to help enforce compliance with, e.g., the General Data Protection Regulation (GDPR) Article 3 (“Territorial Scope”) [105]. Such compliance can otherwise be challenging to meet in decentralized systems [45]. Additionally, in Section 7 we discuss plans to strengthen the robustness of DONs through trust-minimization mechanisms on the main chains they support.

安全模型和目标

去中心化预言机网络是一个独特的分布式系统,我们预计它将 最初通常(尽管不一定)由以委员会为基础的委员会实施 共识协议并由一组 oracle 节点运行。 DON 主要设计为 使用 oracle 报告增强主链上 smart contract 的功能 和其他服务,但它可以为其他非blockchain系统提供相同的支持服务,因此不需要与特定的主链相关联。

因此,我们考虑的模型和属性在很大程度上独立于 DON 的特定应用。 2.1 当前的建筑模型 需要强调的是,今天的 Chainlink 不是一个单一的服务,而是 一个无需许可的框架,可以在其中启动独特的、独立的 oracle 节点 [77] 的网络。网络具有异构的节点运营商集, 设计。他们提供的服务类型也可能有所不同,这可以 包括例如数据馈送、储备证明、可验证的随机性等。其他 差异可能包括去中心化程度、网络规模 它支持的锁定值以及各种服务级别参数,例如数据频率 和准确性。 Chainlink 的无需许可模式鼓励生态系统的发展,其中 提供商专注于他们最有能力为社区提供的服务。这个 与模型相比,模型可能会降低用户成本并提高服务质量 要求所有节点和网络提供全方位的服务,一种方法 这可以很容易地转变为全系统采用代表最少的服务 节点可用资源的共同点。 随着 Chainlink 在 Chainlink 2.0 中向基于 DON 的设计发展,我们继续 支持无需许可的开放框架模型,同时考虑到以下目标: 为用户提供一系列服务选择,在全球范围内实现最佳匹配 具有特定的应用要求。 2.2 共识假设 我们使用术语“去中心化预言机网络”来涵盖 我们描述的 oracle 系统: oracle 节点维护的数据结构和 核心 API 位于其之上。 我们使用术语“账本”(小写),用 L 表示,表示基础数据 由 DON 维护的结构,用于支持它提供的特定服务。 我们强调,我们的 DON 框架并不将 L 视为独立系统,例如 a blockchain:其目的是支持blockchains和其他系统。区块链是, 当然,这是实现可信账本的一种方法,但还有其他方法。我们期望 在许多情况下,DONs 使用拜占庭容错来实现其底层账本 (BFT) 系统,其大大早于 blockchain,例如 Bitcoin [174]。我们使用 为了方便起见,尽管我们在整篇论文中使用了 BFT 类型符号和属性 强调 DONs 可以使用无需许可的共识协议来实现。 从概念上讲,账本 L 是一个公告板,上面的数据是线性排序的。 我们通常认为分类账具有一些通常归因于的关键属性 blockchains [115]。账本是: • 仅附加: 数据一旦添加就无法删除或修改。• 公共: 任何人都可以阅读其内容,这些内容在时间上是一致的 所有用户的视图.4 • 可用:账本始终可以由授权写入者写入和读取 任何人及时。 当由 DON 实现时,分类帐中可能存在替代属性 委员会。例如,分类账写访问可能仅限于某些用户,如 可能会读取某些应用程序的访问权限,即分类帐不需要按照定义公开 上面。同样,分类账规则可能允许修改或编辑数据。我们不 然而,本文明确考虑了此类变体。 DONs 的模块化设计可以支持任何多种现代 BFT 协议,例如 Hotstuff[231]。确切的选择将取决于信任假设和 oracle 节点之间的网络特征。原则上 DON 也可以 使用高性能的无许可 blockchain 为其分类帐提供支持 同样可扩展的第 2 层或 blockchain 系统。同样,杂交也是可能的: DON 原则上可以由现有节点中的 validator 节点组成。 blockchain,例如,在选择委员会执行的权益证明系统中 交易,例如 [8, 81, 120, 146, 204]。这种特殊的操作模式要求 节点以双重用途方式运行,即既作为 blockchain 节点又作为 DON 运行 节点。 (参见第 8.2 节,了解确保变革连续性的技术讨论 委员会和附录 F 有关随机委员会选择的一些注意事项。) 实际上,在现代 BFT 算法中,节点对账本上的消息进行数字签名。 为了方便起见,我们假设 L 有一个关联的公钥 pkL 并且其内容 由相应的私钥签名。即使当 L 上的数据使用门限签名进行签名。5 门限签名很方便, 因为即使会员资格发生变化,它们也可以为 DON 提供持久的身份 运行它的节点。 (参见附录 B.1.3。)因此我们假设 skL 是秘密共享的 对于某些安全参数 k,以 (k, n) 阈值方式,例如 k = 2f + 1 且 n = 3f + 1,其中 f 是潜在故障节点的数量。 (通过在此选择 k 这样,我们确保故障节点既无法学习 skL,也无法发起拒绝服务攻击 攻击阻止其使用。) L 上的消息采用 M = (m, z) 的形式,其中 m 是字符串,z 是唯一的 顺序索引号。 在适用的情况下,我们以 m = 的形式编写消息 ⟨消息类型:有效负载⟩。消息类型MessageType是指示特定消息的功能的语法糖。 4在没有最终性的 blockchain 实现账本的情况下,通常会抽象出不一致性 通过忽略深度不足的块或“修剪”[115] 来消除。 5在实践中,一些代码库,例如 LibraBFT [205](Hotstuff 的一个变体)目前已采用 多重签名,而不是阈值签名,以降低通信复杂性为代价 更简单的工程。通过一些额外的成本,oracle 节点可以将阈值签名附加到消息中 写入 L,即使用于 L 的共识协议不使用它们。2.3 符号 我们将运行账本的 n 个 oracle 节点集表示为 O = {Oi}n 我=1。 这样一个 节点集通常称为委员会。为了简单起见,我们假设集合 oracles 实现 DON 功能,即 L 之上的服务,与 保持 L,但它们可以是不同的。我们让 pki 表示公钥 玩家Oi,并ski相应的私钥。 大多数 BFT 算法至少需要 n = 3f + 1 个节点,其中 f 是节点数 潜在的故障节点;其余节点是诚实的,因为它们遵循 协议完全按照规定。如果委员会 O 符合此要求,我们称其为诚实的 要求,即诚实节点的比例大于 2/3。除非另有说明 如上所述,我们假设 O 是诚实的(并且是腐败的静态模型)。我们使用 pkO / skO 与 pkL / skL 可以互换,具体取决于上下文。 我们让 σ = Sigpk[m] 表示消息 m 相对于 pk 的签名,即使用 对应的私钥sk.令 verify(pk, σ, m) →{false, true} 表示相应的签名验证算法。 (我们在整篇论文中都隐含了密钥生成。) 我们使用符号 S 来表示数据源,并使用 S 来表示完整的数据集 给定上下文中的 nS 源。我们用 MAINCHAIN 表示启用了智能合约的 blockchain 由 DON 支持。我们使用术语依赖合约来表示任何智能合约 与 DON 通信的主链上的合约,并使用符号 SC 来 表示这样的合同。 我们通常假设 DON 支持单个主链 MAINCHAIN,尽管它可以支持多个这样的链,如我们在第 4 节的示例中所示。 DON 可以并且通常会支持主链上的多个依赖合约。 (如 如上所述,DON 也可以支持非 blockchain 服务。) 2.4 关于信任模型的说明 如上所述,DONs 可以构建在基于委员会的共识协议之上,并且我们 预计他们会普遍使用此类协议。有许多有力的论据表明 两种选择之一(基于委员会的或无需许可的 blockchains)提供 比其他的安全性更强。 重要的是要认识到基于委员会与未经许可的安全性 去中心化系统是不可通约的。危害 PoW 或 PoS blockchain 通过 51% 攻击,要求对手暂时获得多数资源,并且 可能是匿名的,例如通过在 PoW 系统中租用 hash 电力。这样的 实践中的攻击已经影响了几个 blockchain [200, 34]。相比之下, 损害基于委员会的系统意味着破坏其阈值数量(通常是三分之一)的节点,其中节点可能是公开的、资源丰富的、 和值得信赖的实体。 另一方面,基于委员会的系统(以及“混合”未经许可的系统) 支持委员会的系统)可以支持比严格要求更多的功能无任务系统。这包括维护持久秘密的能力,例如 签名和/或加密密钥——我们设计中的一种可能性。 我们强调 DON 原则上可以建立在基于委员会或 无许可共识协议和 DON 部署者最终可能选择采用 任一方法。 支持信任模型: 如今 Chainlink 的一个关键功能是用户能够 如所讨论的,根据节点性能历史记录的分散记录来选择节点 在第 3.6.4 节中。我们在第 9 节中介绍的 staking 机制和隐性激励框架共同构成了范围广泛且严格的机制设计 该框架将使用户能够极大地扩展衡量 DONs 安全性的能力。同样的框架也将使 DONs 本身成为可能 对参与节点执行各种安全要求并确保运行 在强大的信任模型中。 还可以使用本文中为 DON 描述的工具来强制实施特殊的信任模型要求,例如遵守监管要求。对于 例如,使用第 4.3 节中讨论的技术,节点可以提供以下证据: 节点运营商特征,例如运营区域,可用于帮助 强制遵守《通用数据保护条例》(GDPR) 第 3 条(“领土范围”)[105] 等规定。否则,这种合规性可能会对 在去中心化系统[45]中见面。 此外,在第 7 节中,我们讨论了加强 DONs 稳健性的计划 通过他们支持的主链上的信任最小化机制。

Decentralized Oracle Network Interface and Ca-

Decentralized Oracle Network Interface and Ca-

pabilities Here we briefly sketch the capabilities of DONs in terms of the simple but powerful interface they are designed to realize. Applications on a DON are composed of executables and adapters. An executable is a program whose core logic is a deterministic program, analogous to a smart contract. An executable also has a number of accompanying initiators, programs that call entry points in the executable’s logic when predetermined events occur—e.g., at certain times (like a cron job), when a price crosses a threshold, etc.—much like Keepers (see Section 3.6.3). Adapters provide interfaces to off-chain resources and may be called by either the initiators or core logic in executables. As their behavior may depend on that of external resources, initiators and adapters may behave non-deterministically. We describe the DON developer interface and the functioning of executables and adapters in terms of the three resources typically used to characterize computing systems: networking, compute, and storage. We give a brief overview of each of these resources below and provide more details in Appendix B.

Adapters connecting a DON with different resources including blockchains, web servers, storage, and IoT devices

3.1 Networking Adapters are interfaces through which executables running on a DON can send and receive data from off-DON systems. Adapters may be viewed as a generalization of the adapters used in Chainlink today [20]. Adapters may be bidirectional—i.e., they cannot just pull, but push data from a DON to a web server. They may also leverage distributed protocols as well as cryptographic functionality such as secure multi-party computation. Figure 9: Adapters connecting a DON, denoted DON1, with a range of different resources, including another DON, denoted DON2, a blockchain (main chain) and its mempool, external storage, a web server, and IoT devices (via a web server). Examples of external resources for which adapters might be created are shown in Fig. 9. They include: • Blockchains: An adapter can define how to send transactions to a blockchain and how to read blocks, individual transactions, or other state from it. An adapter can also be defined for a blockchain’s mempool. (See Section 3.5.) • Web servers: Adapters can define APIs through which data may be retrieved from web servers, including legacy systems that are not specially adapted for interfacing with DONs. Such adapters can also include APIs to send data to such servers. The web servers to which a DON connects may serve as gateways to additional resources, such as Internet-of-Things (IoT) devices.

• External storage: An adapter can define methods to read and write to storage services outside the DON, such as a decentralized file system [40, 188] or cloud storage. • Other DONs: Adapters can retrieve and transmit data between DONs. We expect that initial deployments of DONs will include a set of building block adapters for such commonly used external resources and will further allow DON-specific adapters to be published by DON nodes. As smart contract developers write adapters today, we expect that they will build even more powerful adapters using this advanced functionality. We expect that ultimately it will be possible for users to create new adapters in a permissionless manner. Some adapters must be constructed in a way that ensures the persistence and availability of external resources controlled by a DON. For example, cloud storage may require maintenance of a cloud services account. Additionally, a DON can perform decentralized management of private keys on behalf of users (as in, e.g., [160]) and/or executables. Consequently, the DON is capable of controlling resources, such as cryptocurrency, that may be used, e.g., for sending transactions on a target blockchain. See Appendix B.1 for further details on DON adapters, as Appendix C for a few example adapters. 3.2 Computation An executable is the basic unit of code on a DON. An executable is a pair exec = (logic, init). Here, logic is a deterministic program with a number of designated entry points (logic1, logic2, . . . , logicℓ) and init is a set of corresponding initiators (init1, init2, . . . , inite). To ensure the full auditability of the DON, an executable’s logic uses the underlying ledger L for all inputs and outputs. Thus, for instance, any adapter data serving as input to an executable must be stored first on L. Initiators: Initiators in Chainlink today cause event-dependent job executions on Chainlink nodes [21]. Initiators in DONs function in much the same way. A DON initiator, however, is specifically associated with an executable. An initiator may depend on an external event or state, on the current time, or on a predicate on DON state. With their dependency on events, initiators may of course behave non-deterministically (as of course may adapters). An initiator can execute within individual DON nodes and so need not rely on an adapter. (See Example 1 below.) Initiators are an important feature distinguishing executables from smart contracts. Because an executable can run in response to an initiator, it can effectively operate autonomously, as of course by extension can a hybrid contract incorporating the executable. One form of initiators today are Chainlink Keepers, which provide transaction

automation services, triggering smart contract execution—such as liquidation of undercollateralized loans and execution of limit-order trades—based on oracle reports. Conveniently, initiators in DONs may also be viewed as a way of specifying the service agreements that apply to an executable, as they define the circumstances under which the DON must call it. The following example illustrates how initiators work within an executable: Example 1 (Deviation-triggered price feed). A smart contract SC may require fresh price-feed data (see Section 3.6.3) whenever there is a substantial change, e.g., 1%, in the exchange rate between a pair of assets, e.g., ETH-USD. Volatility-sensitive price feeds are supported in Chainlink today, but it is instructive to see how they can be realized on a DON by means of an executable execfeed. The executable execfeed maintains the most recent ETH-USD price r on L, in the form of a sequence of ⟨NewPrice : j, r⟩entries, where j is an index incremented with each price update. An initiator init1 causes each node Oi to monitor the current ETH-USD price for deviations of at least 1% from the most recently stored price r with index j. Upon detection of such a deviation, Oi writes its current view ri of the new price to L using an entry of the form ⟨PriceView : i, j + 1, ri⟩. A second initiator init2 fires when at least k such PriceView-entries with new price values for index j + 1 created by distinct nodes have accumulated on L. Then, init2 invokes an entry point logic2 to compute the median \(\rho\) of the first \(k\) fresh, valid priceview values and writes a fresh value ⟨NewPrice : j + 1, ρ⟩to L . (Operationally, nodes may take turns as designated writers.) A third initiator init3 watches for NewPrice entries on L. Whenever a new report ⟨NewPrice : j, r⟩appears there, it invokes an entry point logic3 that pushes (j, r) to SC using an adapter. As we have noted, an executable is similar in its capabilities to a smart contract. Apart from its higher performance, though, it differs from a typical main chain contract in two essential ways: 1. Confidentiality: An executable can perform confidential computation, i.e., a secret program may process cleartext inputs, or a published program may process secret input data, or a combination of both. In a simple model, secret data can be accessed by DON nodes, which conceal intermediate results and disclose only processed and sanitized values to MAINCHAIN. It is also possible to conceal sensitive data from DONs themselves: DONs are meant to support approaches such as multi-party computation, e.g., [42, 157], and trusted execution environments (TEEs) [84, 133, 152, 229] for this purpose.6 6By extension, keeping executables themselves secret with respect to DON nodes is also possible, although this is only practical today for non-trivial executables using TEEs.

  1. Supporting role: An executable is meant to support smart contracts on a main chain, rather than replace them. An executable has several limitations that a smart contract does not: (a) Trust model: An executable operates within the trust model defined by the DON: Its correct execution relies on the honest behavior of O. (A main chain can, however, provide some guard rails against DON malfeasance, as discussed in Section 7.3.) (b) Asset access: A DON can control an account on a blockchain—and thus control assets on it through an adapter. But a DON cannot authoritatively represent assets created on a main chain, e.g., Ether or ERC20 tokens, since their native chain maintains the authoritative record of their ownership. (c) Lifecycle: DONs may be stood up intentionally with limited lifetimes, as defined by on-chain service level agreements between DONs and the owners of relying contracts. Blockchains, in contrast, are meant to function as permanent archival systems. See Appendix B.2 for further details on DON computation. 3.3 Storage As a committee-based system, a DON can store moderate amounts of data persistently on L at much lower cost than a permissionless blockchain. Additionally, via adapters, DONs can reference external decentralized systems for data storage, e.g., Filecoin [85], and can thereby connect such systems to smart contracts. This option is particularly attractive for bulk data as a means of addressing the pervasive problem of “bloat” in blockchain systems. DONs can thus store data locally or externally for use in their specifically supported services. A DON can additionally make use of such data in a confidential way, computing on data that is: (1) secret-shared across DON nodes or encrypted under a key managed by DON nodes in ways suitable for secure multi-party computation or partial or fully homomorphic encryption; or (2) protected using a trusted execution environment. We expect that DONs will adopt a simple memory-management model common to smart-contract systems: An executable may only write to its own memory. Executables may, however, read from the memory of other executables. See Appendix B.3 for further details on DON storage. 3.4 Transaction-Execution Framework (TEF) DONs are intended to support contracts on a main chain MAINCHAIN (or on multiple main chains). The Transaction-Execution Framework (TEF), discussed in detail

in Section 6, is a general-purpose approach to the efficient execution of a contract SC across MAINCHAIN and a DON. The TEF is intended to support FSS and layer-2 technologies—simultaneously, if desired. Indeed, it is likely to serve as the main vehicle for use of FSS (and for that reason, we do not further discuss FSS in this section). Briefly, in TEF an original target contract SC designed or developed for MAINCHAIN is refactored into a hybrid contract. This refactoring produces the two interoperating pieces of the hybrid contract: a MAINCHAIN contract SCa that we refer to for clarity in the context of TEFs as an anchor contract and an executable execs on a DON. The contract SCa custodies users’ assets, executes authoritative state transitions, and also provides guard rails (see Section 7.3) against failures in the DON. The executable execs sequences transactions and provides associated oracle data for them. It can bundle transactions for SCa in any of a number of ways—e.g., using validity-proof-based or optimistic rollups, confidential execution by the DON, etc. We expect to develop tools that make it easy for developers to partition a contract SC written in a high-level language into pieces of MAINCHAIN and DON logic, SCa and execs respectively, that compose securely and efficiently. Using TEF to integrate high-performance transaction schemes with high-performance oracles is integral to our oracle scaling approach. 3.5 Mempool Services An important application-layer feature that we intend to deploy on DONs in support of FSS and the TEF are Mempool Services (MS). MS may be viewed as an adapter, but one with first-class support. MS provides support for legacy-compatible transaction processing. In this use, MS ingests from a main chain’s mempool those transactions intended for a target contract SC on MAINCHAIN. MS then passes these transactions to an executable on the DON, where they are processed in the desired way. MS data can be used by the DON to compose transactions that can then be passed directly to SC from the DON or to another contract that calls SC. For example, the DON can forward transactions harvested via MS, or it can use MS data to set gas prices for transactions it sends to MAINCHAIN. Because it monitors the mempool, MS can obtain transactions from users interacting directly with SC. Thus users may continue to generate their transactions using legacy software, i.e., applications unaware of the existence of MS and MS-configured contracts. (In this case, SC must be changed to ignore the original transactions and accept only those processed by the MS, so as to avoid double-processing.) For use with a target contract SC, MS can be used with FSS and/or the TEF.

3.6 Stepping Stones: Existing Chainlink Capabilities 3.6.1 Off-Chain Reporting (OCR) Off-Chain Reporting (OCR) [60] is a mechanism in Chainlink for oracle report aggregation and transmission to a relying contract SC. Recently deployed for Chainlink price feed networks, it represents a first step along the path to full DONs. At its core, OCR is a BFT protocol designed to operate in a partially synchronous network. It ensures liveness and correctness in the presence of \(f < n/3\) arbitrarily faulty nodes, guaranteeing the properties of Byzantine reliable broadcast, but it is not a complete BFT consensus protocol. Nodes do not maintain message logs that are consistent in the sense of representing a ledger that is identical in all of their views, and the leader of the protocol may equivocate without violating safety. OCR is currently designed for a particular message type: medianized aggregation of (at least \(2f + 1\)) values reported by participating nodes. It provides a key assurance on the reports it outputs for SC, called attested reports: The median value in an attested report is equal to or lies between values reported by two honest nodes. This property is the key safety condition for OCR. The leader may have some influence on the median value in an attested report, but only subject to this correctness condition. OCR can be extended to message types that aggregate values in different ways. While the Chainlink network’s liveness and correctness goals today do not require OCR to be a full-blown consensus protocol, they do require OCR to provide some additional forms of functionality not present in conventional BFT protocols, most notably: 1. All-or-nothing off-chain report broadcast: OCR ensures that an attested report is made quickly available to all honest nodes or none of them. This is a fairness property that helps ensure that honest nodes have an opportunity to participate in attested report transmission. 2. Reliable transmission: OCR ensures, even in the presence of faulty or malicious nodes, that all OCR reports and messages are transmitted to SC within a certain, pre-defined interval of time. This is a liveness property. 3. Contract-based trust minimization: SC filters out potentially erroneous OCRgenerated reports, e.g., if their reported values deviate significantly from other recently received ones. This is a form of extra-protocol correctness enforcement. All three of these properties will play a natural role in DONs. All-or-nothing offchain (DON) broadcast is an important building block for cryptoeconomic assurances around reliable transmission, which is in turn an essential adapter property. Trust minimization in SC is a type of guard rail, as discussed in Section 7.3. OCR also provides a basis for operational deployment and refinement of BFT protocols in Chainlink’s oracle networks and thus, as noted above, a path to the full functionality of DONs.

3.6.2 DECO and Town Crier DECO [234] and Town Crier [233] are a pair of related technologies currently being developed in Chainlink networks. Most web servers today allow users to connect over a secure channel using a protocol called Transport Layer Security (TLS) [94]. (HTTPS indicates a variant of HTTP that is enabled with TLS, i.e., URLs prefixed with “https” denote use of TLS for security.) Most TLS-enabled servers have a notable limitation, though: They don’t digitally sign data. Consequently, a user or Prover cannot present the data she receives from a server to a third party or Verifier, such as an oracle or smart contract, in a way that ensures the data’s authenticity. Even if a server were to digitally sign data, there remains a problem of confidentiality. A Prover may wish to redact or modify sensitive data before presenting it to a Verifier. Digital signatures are designed specifically to invalidate modified data, however. They thus prevent a Prover from making confidentiality-preserving alterations to data. (See Section 7.1 for more discussion.) DECO and Town Crier are designed to allow a Prover to obtain data from a web server and present it to a Verifier in a way that ensures integrity and confidentiality. The two systems preserve integrity in the sense that they ensure that data presented by the Prover to the Verifier originates authentically from the target server. They support confidentiality in the sense of allowing the Prover to redact or modify data (while still preserving integrity). A key feature of both systems is that they do not require any modifications to a target web server. They can operate with any existing TLS-enabled server. In fact, they are transparent to the server: From the viewpoint of the server, the Prover is establishing an ordinary connection. The two systems have similar goals, but differ in their trust models and implementations as we now briefly explain. DECO makes fundamental use of cryptographic protocols to achieve its integrity and confidentiality properties. While establishing a session with a target server using DECO, the Prover engages at the same time in an interactive protocol with the Verifier. This protocol enables the Prover to prove to the Verifier that it has received a given piece of data D from the server during its current session. The Prover can alternatively present the Verifier with a zero-knowledge proof of some property of D and thus not reveal D directly. In a typical use of DECO, a user or a single node can export data D from a private session with a web server to all of the nodes in a DON. As a result, the full DON can attest to the authenticity of D (or a fact derived from D via a zero-knowledge proof). In addition to the example applications given later in the paper, this capability can be used to amplify high-integrity access to a data source by a DON. Even if only one node has direct access to a data source—due, for instance, to an exclusive arrangement with a data provider—it remains possible for the entire DON to attest to the correctness of

reports emitted by that node. Town Crier relies on the use of a trusted execution environment (TEE) such as Intel SGX. Briefly, a TEE functions as a kind of black box that executes applications in a tamperproof and confidential way. In principle, even the owner of the host on which the TEE is running can neither (undetectably) alter a TEE-protected application nor view the application’s state, which may include secret data. Town Crier can achieve all of the functionality of DECO and more. DECO constrains the Prover to interaction with a single Verifier. In contrast, Town Crier enables a Prover to generate a publicly verifiable proof on data D fetched from a target server, i.e., a proof that anyone, even a smart contract, can verify directly. Town Crier can also securely ingest and make use of secrets (e.g., user credentials). The main limitation of Town Crier is its reliance on TEEs. Production TEEs have recently been shown to have a number of serious vulnerabilities, although the technology is in its infancy and will undoubtedly mature. See Appendices B.2.1 and B.2.2 for further discussion of TEEs. For a few example applications of DECO and Town Crier, see Sections 4.3, 4.5 and 9.4.3 and Appendix C.1. 3.6.3 Existing On-Chain Chainlink Services Chainlink oracle networks provide a number of main services across a multiplicity of blockchains and other decentralized systems today. Further evolution as described in this whitepaper will endow these existing services with additional capabilities and reach. Three examples are: Data feeds: Today, the majority of Chainlink users relying on smart contracts make use of data feeds. These are reports on the current value of key pieces of data according to authoritative off-chain sources. For example, price feeds are feeds reporting the prices of assets—cryptocurrencies, commodities, forex, indexes, equities, etc.—according to exchanges or data-aggregation services. Such feeds today already help secure billions of dollars in on-chain value through their use in DeFi systems such as Aave [147] and Synthetix [208]. Other examples of Chainlink data feeds include weather data for parametric crop insurance [75] and election data [93], among a number of others. The deployment of DONs and other technologies described in this paper will enhance provision of data feeds in Chainlink networks in many ways, including: • Scaling: OCR and subsequently DONs aim to enable Chainlink services to scale dramatically across the many blockchains they support. For example, we expect that DONs will help increase the number of data feeds provided by nodes using Chainlink from 100s to 1000s and beyond. Such scaling will help the Chainlink ecosystem achieve its goal of furnishing data relevant to smart contracts comprehensively and both meeting and anticipating existing and future needs.

• Enhanced security: By storing intermediate reports, DONs will retain records of node behaviors for high-fidelity monitoring and measurement of their performance and accuracy, enabling strong empirical grounding of reputation systems for Chainlink nodes. FSS and the TEF will enable price feeds to be incorporated with transaction data in flexible ways that prevent attacks such as front-running. (Explicit) staking will bolster existing cryptoeconomic protection of the security of data feeds. • Feed agility: As blockchain-agnostic systems (indeed, more broadly, consumeragnostic systems), DONs can facilitate the provision of data feeds to a multiplicity of relying systems. A single DON can push a given feed simultaneously to a set of different blockchains, eliminating the need for per-chain oracle networks and enabling rapid deployment of existing feeds on new blockchains and of additional feeds across currently serviced blockchains. • Confidentiality: The ability to perform generalized computation in a DON enables computations on sensitive data to take place offchain, avoiding on-chain exposure. Additionally, using DECO or Town Crier, it is possible to achieve even stronger confidentiality, allowing report generation based on data that isn’t exposed even to DON nodes. See Section 4.3 and Section 4.5 for examples. Verifiable Random Functions (VRFs): Several types of DApps require a verifiably correct source of randomness to enable verification of their own fair operation. Non-Fungible Tokens (NFTs) are an example. The rarity of NFT features in Aavegotchi [23] and Axie Infinity [35] is determined by Chainlink VRF, as is the distribution of NFTs by means of ticket-based drawings in Ether Cards [102]; the wide variety of gaming DApps whose outcomes are randomized; and unconventional financial instruments, e.g., no-loss savings games such as PoolTogether [89], which allocate funds to random winners. Other blockchain and non-blockchain applications also require secure sources of randomness, including selection of decentralized-system committees and the execution of lotteries. While block hashes can serve as a source of unpredictable randomness, they are vulnerable to manipulation by adversarial miners (and to some extent by users submitting transactions). Chainlink VRF [78] offers a considerably more secure alternative. An oracle has an associated private / public key pair (sk, pk) whose private key is maintained offchain and whose public key pk is published. To output a random value, it applies sk to an unpredictable seed x furnished by a relying contract (e.g., a block hash and DApp-specific parameters) using a function F, yielding y = Fsk(x) along with a proof of correctness. (See [180] for the VRF available on Chainlink.) What makes a VRF verifiable is the fact that with knowledge of pk, it is possible to check the correctness of the proof and therefore of y. The value y is consequently unpredictable to an adversary that cannot predict x or learn sk and infeasible for the service to manipulate.

Chainlink VRF may be viewed as just one of a family of applications that involve custodianship of private keys offchain. More generally, DONs can offer secure, decentralized storage of individual keys for applications and/or users, and combine this capability with generalized computation. The result is a host of applications, of which we give some examples in this paper, including key management for Proof of Reserves (see Section 4.1) and for users’ decentralized credentials (and other digital assets) (see Section 4.3). Keepers: Chainlink Keepers [87] enable developers to write code for decentralized execution of off-chain jobs, generally to trigger execution of relying smart contracts. Before the advent of Keepers, it was common for developers to operate such off-chain logic themselves, creating centralized points of failure (as well as considerable duplicated development effort). Keepers instead provide an easy-to-use framework for decentralized outsourcing of these operations, enabling shorter development cycles and strong assurance of liveness and other security properties. Keepers can support any of a wide variety of triggering goals, including price-dependent liquidation of loans or execution of financial transactions, time-dependent initiation of airdrops or payments in systems with yield harvesting, and so forth. In the DON framework, initiators may be viewed as a generalization of Keepers in several senses. Initiators may make use of adapters, and thus can leverage a modularized library of interfaces to on-chain and off-chain systems, permitting rapid development of secure, sophisticated functionality. Initiators initiate computation in executables, which themselves offer the full versatility of DONs, permitting the wide range of decentralized services we present in this paper for on-chain and off-chain applications. 3.6.4 Node Reputation / Performance History The existing Chainlink ecosystem natively documents the performance histories of contributing nodes on chain. This feature has given rise to a collection of reputationoriented resources that ingest, filter, and visualize performance data on individual node operators and data feeds. Users can reference these resources to make informed decisions in their selection of nodes and to monitor the operation of existing networks. Similar capabilities will help users choose DONs. For example, permissionless marketplaces today such as market.link allow node operators to list their oracle services and attest to their off-chain identities through services such as Keybase [4], which bind the profile of a node in Chainlink to its owner’s existing domain names and social media accounts. Additionally, performance analytics tools, such as those available at market.link and reputation.link, allow users to view statistics on the historical performance of individual nodes, including their average response latency, the deviation of values in their reports from consensus values relayed on chain, revenue generated, jobs fulfilled, and more. These analytics tools also allow users to track the adoption of various oracle networks by other users, a form of

implicit endorsement of the nodes securing such networks. The result is a flat “web of trust” in which, by using particular nodes, high-value decentralized applications create a signal of their trust in those nodes that other users can observe and factor into their own node-selection decisions. With DONs (and initially with OCR) comes a shift in transaction processing and contract activity more generally offchain. A decentralized model for recording node performance remains possible within the DON itself. Indeed, the high performance and data capacity of DONs make it possible to construct records in a fine-grained way and also to perform decentralized computation on these records, yielding trustworthy summaries that can be consumed by reputation services and checkpointed on MAINCHAIN. While it is possible for a DON in principle to misrepresent the behavior of constituent nodes if a large fraction of nodes is corrupted, we note that the collective performance of a DON itself in delivering on-chain data is visible on MAINCHAIN and thus cannot be misrepresented. Additionally, we plan to explore mechanisms that incentivize accurate internal reporting of node behaviors in a DON. For example, by reporting the subset of high-performing nodes that most quickly return data contributing to a report relayed on chain, a DON creates an incentive for nodes to contest incorrect reports: Incorrectly including nodes in this subset means incorrectly excluding nodes that should have been included and therefore invalidly penalizing them. Repeated reporting failures by a DON would also create an incentive for honest nodes to leave the DON. Decentralized compilation of accurate performance histories and the consequent ability of users to identify high-performing nodes and for node operators to build reputations are important distinguishing features of the Chainlink ecosystem. We show in Section 9 how we can reason about them as a key piece of a rigorous and expansive view of the economic security provided by DONs.

去中心化的 Oracle 网络接口和 Ca-

能力 在这里,我们简单地描述了 DONs 的功能,简单但强大 它们旨在实现的接口。 DON 上的应用程序由可执行文件和适配器组成。可执行文件是 其核心逻辑是确定性程序的程序,类似于 smart contract。 可执行文件还具有许多附带的启动程序,即调用入口的程序 当预定事件发生时(例如,在某些时间),可执行文件逻辑中的点 (就像 cron 作业),当价格超过阈值时,等等——很像 Keepers(参见第 3.6.3 节)。适配器提供链下资源的接口,可以被调用 可执行文件中的发起者或核心逻辑。因为他们的行为可能取决于此 外部资源、启动器和适配器的行为可能是不确定的。 我们描述了 DON 开发者界面以及可执行文件的功能和 适配器通常用于表征计算系统的三种资源:网络、计算和存储。我们对其中每一个进行简要概述 以下资源并在附录 B 中提供更多详细信息。

Adapters connecting a DON with different resources including blockchains, web servers, storage, and IoT devices

3.1 网络 适配器是在 DON 上运行的可执行文件可以通过其发送和接收信息的接口。 从off-DON系统接收数据。适配器可以被视为泛化 今天 Chainlink 使用的适配器 [20]。适配器可以是双向的,即它们 不能只是从 DON 拉取数据,而是将数据推送到 Web 服务器。他们还可以利用 分布式协议以及加密功能,例如安全多方 计算。 图 9:适配器连接 DON(表示为 DON1)与一系列不同的资源,包括另一个 DON(表示为 DON2)、一条 blockchain(主链)及其 mempool、外部存储、Web 服务器和 IoT 设备(通过 Web 服务器)。 显示了可以为其创建适配器的外部资源的示例 如图 9 所示。它们包括: • 区块链:适配器可以定义如何将交易发送到 blockchain 并 如何从中读取区块、单个交易或其他状态。适配器一个 也可以为 blockchain 的内存池定义。 (参见第 3.5 节。) • Web 服务器:适配器可以定义可检索数据的 API 来自网络服务器,包括不专门适应的遗留系统 与 DONs 连接。此类适配器还可以包含用于将数据发送到的 API 这样的服务器。 DON 连接的 Web 服务器可以充当网关 其他资源,例如物联网 (IoT) 设备。• 外部存储:适配器可以定义读取和写入存储的方法 DON 之外的服务,例如去中心化文件系统 [40, 188] 或云 存储。 • 其他DON:适配器可以在DON 之间检索和传输数据。 我们预计 DONs 的初始部署将包括一组构建块 此类常用外部资源的适配器,并将进一步允许 DON 特定的 由 DON 节点发布的适配器。作为 smart contract 开发人员编写适配器 今天,我们预计他们将使用这种先进的技术构建更强大的适配器 功能。 我们期望用户最终能够在一个新的适配器中创建新的适配器。 未经许可的方式。 某些适配器的构造方式必须确保由 DON 控制的外部资源的持久性和可用性。例如,云存储可以 需要维护云服务帐户。此外,DON 可以执行 代表用户对私钥进行去中心化管理(例如 [160])和/或 可执行文件。因此,DON能够控制可用于例如在目标blockchain上发送交易的资源,例如加密货币。 有关 DON 适配器的更多详细信息,请参阅附录 B.1,一些适配器的详细信息请参阅附录 C。 示例适配器。 3.2 计算 可执行文件是 DON 上的基本代码单元。可执行文件是一对 exec = (逻辑,初始化)。这里,逻辑是一个具有多个指定入口的确定性程序 点 (logic1,logic2,...,logicℓ) 和 init 是一组相应的启动器 (初始化1、初始化2、……、初始化)。确保可执行文件逻辑 DON 的完全可审计性 使用底层账本 L 来处理所有输入和输出。因此,例如,任何适配器 作为可执行文件输入的数据必须首先存储在 L 上。 发起人: 今天 Chainlink 中的启动器会导致事件相关的作业执行 Chainlink 节点 [21]。 DONs 中的启动器的功能大致相同。然而,DON 启动器与可执行文件特定关联。发起者可能取决于 基于外部事件或状态、当前时间或 DON 状态的谓词。 由于对事件的依赖,发起者的行为当然可能是不确定的 (当然也可以是适配器)。启动器可以在各个 DON 节点内执行 因此不需要依赖适配器。 (参见下面的示例 1。) 启动器是区分可执行文件和 smart contract 的一个重要特征。 因为可执行文件可以响应启动器而运行,所以它可以有效地操作 自主地,当然通过扩展可以包含可执行文件的混合合同。如今发起者的一种形式是 Chainlink 守护者,它提供交易自动化服务,根据 oracle 报告触发 smart contract 执行,例如清算抵押不足的贷款和执行限价订单交易。 方便地,DONs 中的启动器也可以被视为指定 适用于可执行文件的服务协议,因为它们定义了以下情况 DON 必须调用它。 以下示例说明启动器如何在可执行文件中工作: 示例 1(偏差触发的喂价)。 smart contract SC 可能需要新鲜的 每当价格发生重大变化(例如 1%)时,喂价数据(参见第 3.6.3 节) 一对资产之间的汇率,例如 ETH-USD。波动敏感的价格 今天 Chainlink 支持提要,但了解它们如何实现是有启发性的 通过可执行的 execfeed 在 DON 上实现。 可执行文件 execfeed 在 L 上维护最新的 ETH-USD 价格 r,在 ⟨NewPrice : j, r⟩entries 序列的形式,其中 j 是递增的索引 每次价格更新。 发起者 init1 使每个节点 Oi 监控当前 ETH-USD 价格 与索引 j 的最近存储的价格 r 的偏差至少为 1%。之上 检测到这种偏差,Oi 将新价格的当前视图 ri 写入 L 使用 ⟨PriceView : i, j + 1, ri⟩ 形式的条目。 当至少 k 个这样的 PriceView 条目具有新价格时,第二个启动器 init2 就会触发 由不同节点创建的索引 j + 1 的值已累积在 L 上。然后,init2 调用入口点逻辑 2 来计算前 k 个新的有效价格视图值的中位数 ρ 并将新值 ⟨NewPrice : j + 1, ρ⟩ 写入 L 。 (操作上,节点 可以轮流担任指定撰稿人。) 第三个发起者 init3 监视 L 上的 NewPrice 条目。每当有新报告时 ⟨NewPrice : j, r⟩出现在那里,它调用一个入口点逻辑 3,将 (j, r) 推送到 SC 使用适配器。 正如我们所指出的,可执行文件的功能与 smart contract 类似。 然而,除了其更高的性能之外,它与典型的主链合约不同 以两种基本方式: 1. 机密性:可执行文件可以执行机密计算,即秘密程序可以处理明文输入,或者发布的程序可以处理 秘密输入数据,或两者的组合。在一个简单的模型中,秘密数据可以 由 DON 节点访问,隐藏中间结果并仅公开 处理和清理的值到主链。也可以从 DON 本身隐藏敏感数据:DON 旨在支持此类方法 作为多方计算,例如 [42, 157] 和可信执行环境 (TEE) [84, 133, 152, 229] 为此目的。6 6通过扩展,也可以对 DON 节点保持可执行文件本身的秘密, 尽管这在今天仅适用于使用 TEE 的重要可执行文件。2. 支持角色:可执行文件旨在支持主系统上的 smart contracts 链,而不是取代它们。可执行文件有几个限制: smart contract 不: (a) 信任模型:可执行文件在由 DON:其正确执行依赖于 O 的诚实行为。(主要 然而,链条可以提供一些防范 DON 渎职行为的防护措施,如 第 7.3 节中讨论。) (b) 资产访问:DON 可以控制 blockchain 上的帐户,因此 通过适配器控制其上的资产。但 DON 不能权威地 代表在主链上创建的资产,例如以太坊或 ERC20 tokens,因为 他们的本地链维护其所有权的权威记录。 (c) 生命周期:DONs 可能会故意以有限的生命周期建立起来,因为 由 DON 和所有者之间的链上服务水平协议定义 依赖合同。 相比之下,区块链的作用是 永久档案系统。 有关 DON 计算的更多详细信息,请参阅附录 B.2。 3.3 存储 作为基于委员会的系统,DON 可以持久存储适量的数据 在 L 上的成本比未经许可的 blockchain 低得多。此外,通过适配器, DONs 可以引用外部去中心化系统进行数据存储,例如 Filecoin [85], 从而可以将此类系统连接到 smart contracts。这个选项特别 作为解决普遍存在的“膨胀”问题的一种手段,对大量数据很有吸引力 blockchain 系统。 因此,DONs 可以在本地或外部存储数据,以便在其特定支持的服务中使用。 DON 还可以以保密的方式使用此类数据, 计算以下数据:(1) 在 DON 节点之间秘密共享或在以下情况下加密 由 DON 节点以适合安全多方计算的方式管理的密钥 或部分或完全同态加密;或 (2) 使用可信执行进行保护 环境。 我们预计 DONs 将采用常见的简单内存管理模型 智能合约系统:可执行文件只能写入自己的内存。可执行文件 但是,可以从其他可执行文件的内存中读取。 有关 DON 存储的更多详细信息,请参阅附录 B.3。 3.4 交易执行框架 (TEF) DON 旨在支持主链 MAINCHAIN (或多个主链)上的合约。详细讨论事务执行框架 (TEF)第 6 节中的内容是有效执行合同的通用方法 SC 跨主链和 DON。 TEF 旨在支持 FSS 和第 2 层 技术——如果需要的话,可以同时进行。事实上,它很可能作为主要车辆 FSS 的使用(因此,我们在本节中不再进一步讨论 FSS)。 简而言之,在 TEF 中,有一个为 MAINCHAIN 设计或开发的原始目标合约 SC 被重构为混合合约。这种重构产生了两个互操作的 混合合约的组成部分:为了清楚起见,我们将其称为主链合约 SCa 在 TEF 的背景下,作为锚定合约和 DON 上的可执行执行程序。的 合约SCa托管用户的资产,执行权威的状态转换,还 提供防护栏(参见第 7.3 节)以防止 DON 中的故障。可执行的 exec 对交易进行排序并为其提供关联的 oracle 数据。可以捆绑 通过多种方式进行 SCa 交易——例如,使用基于有效性证明的或 乐观 rollups,由 DON 保密执行,等等。 我们希望开发出使开发人员能够轻松分割合约的工具 SC 用高级语言编写成 MAINCHAIN 和 DON 逻辑块,SCa 和 分别执行,安全高效地组合。 使用TEF将高性能交易方案与高性能相结合 oracles 是我们的 oracle 缩放方法的组成部分。 3.5 内存池服务 我们打算在 DON 上部署一项重要的应用程序层功能以提供支持 FSS 和 TEF 的核心是 Mempool Services(MS)。 MS 可以被视为一个适配器, 但拥有一流的支持。 MS 提供对传统兼容事务处理的支持。在此用途中,MS 从主链的内存池中摄取那些用于目标合约的交易 主链上的 SC。然后,MS 将这些事务传递给 DON 上的可执行文件, 它们以所需的方式进行处理。 MS 数据可由 DON 使用 组成交易,然后可以直接从 DON 传递到 SC 或 到另一个名为 SC 的合约。例如,DON可以转发交易 通过 MS 收集,或者它可以使用 MS 数据为其发送到的交易设置 Gas 价格 主链。 由于它监控内存池,MS 可以从直接与 SC 交互的用户获取交易。因此,用户可以继续使用以下方式生成交易 遗留软件,即不知道 MS 和 MS 配置的存在的应用程序 合同。 (在这种情况下,必须更改 SC 以忽略原始交易并 仅接受MS处理过的内容,以避免双重处理。) 为了与目标合同 SC 一起使用,MS 可以与 FSS 和/或 TEF 一起使用。3.6 垫脚石:现有 Chainlink 功能 3.6.1 链下报告(OCR) 链外报告 (OCR) [60] 是 Chainlink 中的一种机制,用于 oracle 报告聚合和传输到依赖合约 SC。最近以 Chainlink 价格部署 馈送网络,它代表了通往完整 DON 之路的第一步。 OCR 的核心是 BFT 协议,旨在以部分同步的方式运行 网络。它确保任意存在 f < n/3 时的活性和正确性 故障节点,保证了拜占庭可靠广播的特性,但事实并非如此 完整的 BFT 共识协议。节点不维护消息日志 一致的意思是代表一个在所有观点上都相同的账本, 协议的领导者可以在不违反安全的情况下含糊其辞。 OCR 目前是为特定消息类型设计的: 参与节点报告的(至少 2f +1)个值。它提供了关键保证 它为 SC 输出的报告称为经过验证的报告:经过验证的报告中的中值 报告等于或位于两个诚实节点报告的值之间。此属性是 OCR 的关键安全条件。领导者可能对中位数有一定影响 经证明的报告中的值,但仅受此正确性条件的限制。光学字符识别可以 可以扩展到以不同方式聚合值的消息类型。 虽然 Chainlink 网络今天的活跃度和正确性目标不需要 OCR 是一个成熟的共识协议,它们确实需要 OCR 提供传统 BFT 协议中不存在的一些附加形式的功能,最值得注意的是: 1. 全有或全无的链下报告广播:OCR 确保经过验证的报告 快速可供所有诚实节点使用,或者不可供任何节点使用。这是一种公平 有助于确保诚实节点有机会参与的属性 在经过验证的报告传输中。 2. 可靠传输:OCR 确保即使存在错误或恶意 节点,所有OCR报告和消息在一定时间内传输到SC, 预先定义的时间间隔。这是一个活跃的属性。 3. 基于合同的信任最小化:SC 过滤掉潜在错误的 OCR 生成的报告,例如,如果它们报告的值与其他值显着偏差 最近收到的。这是协议外正确性强制的一种形式。 所有这三个属性都将在 DONs 中发挥自然作用。全有或全无链下 (DON) 广播是加密经济保证的重要组成部分 围绕可靠的传输,这又是适配器的一个重要属性。信任 SC 中的最小化是一种护栏,如第 7.3 节所述。 OCR 还为 Chainlink 的 oracle 网络中的 BFT 协议的操作部署和细化提供了基础,因此,如上所述,这是一条通往完整的路径。 DONs 的功能。3.6.2 德科和城市公告员 DECO [234] 和 Town Crier [233] 是目前正在开发的一对相关技术 在 Chainlink 网络中开发。 如今,大多数 Web 服务器允许用户使用协议通过安全通道进行连接 称为传输层安全 (TLS) [94]。 (HTTPS 表示 HTTP 的一个变体, 启用了 TLS,即以“https”为前缀的 URL 表示使用 TLS 来确保安全。) 不过,大多数启用 TLS 的服务器都有一个显着的限制:它们不进行数字签名 数据。因此,用户或证明者无法呈现她从服务器接收的数据 向第三方或验证者,例如 oracle 或 smart contract,以确保 数据的真实性。 即使服务器对数据进行数字签名,仍然存在保密问题。证明者可能希望在将敏感数据呈现给证明者之前对其进行编辑或修改 验证者。然而,数字签名是专门为使修改后的数据失效而设计的。因此,它们阻止证明者进行保密性的更改 到数据。 (更多讨论请参见第 7.1 节。) DECO 和 Town Crier 旨在允许证明者从网络获取数据 服务器并以确保完整性和机密性的方式将其呈现给验证者。 这两个系统在确保数据呈现的意义上保持完整性 证明者到验证者确实源自目标服务器。他们支持 机密性是指允许证明者编辑或修改数据(同时仍然 保持完整性)。 这两个系统的一个关键特点是它们不需要对系统进行任何修改 目标网络服务器。它们可以与任何现有的启用 TLS 的服务器一起运行。事实上, 它们对服务器是透明的:从服务器的角度来看,证明者是 建立普通连接。 这两个系统具有相似的目标,但在信任模型和实现方面有所不同,正如我们现在简要解释的那样。 DECO 从根本上利用加密协议来实现其完整性 和保密性。在使用 DECO 与目标服务器建立会话时,证明者同时与目标服务器建立交互协议 验证者。该协议使证明者能够向验证者证明它已收到 在当前会话期间来自服务器的给定数据 D。证明者可以 或者向验证者提供 D 的某些属性的零知识证明 因此不直接揭示 D。 在 DECO 的典型使用中,用户或单个节点可以从私有节点导出数据 D。 与 Web 服务器的会话到 DON 中的所有节点。因此,完整的 DON 可以 证明 D 的真实性(或通过零知识证明从 D 导出的事实)。 除了本文后面给出的示例应用程序之外,此功能还可以 用于通过 DON 放大对数据源的高完整性访问。即使只有一个节点 可以直接访问数据源——例如,由于与 数据提供者——整个 DON 仍然有可能证明以下内容的正确性该节点发出的报告。 Town Crier 依赖于使用可信执行环境 (TEE),例如 Intel 新交所。简而言之,TEE 的功能就像一种黑匣子,在特定环境中执行应用程序 防篡改和保密的方式。原则上,即使是主机的所有者 TEE 正在运行既不能(无法检测地)改变受 TEE 保护的应用程序,也不能 查看应用程序的状态,其中可能包括秘密数据。 Town Crier 可以实现 DECO 的所有功能以及更多功能。 DECO 将证明者限制为与单个验证者交互。相比之下,Town Crier 能够 证明者对从目标服务器获取的数据 D 生成可公开验证的证明, 即任何人,甚至 smart contract,都可以直接验证的证明。城镇公告员可以 还可以安全地获取和使用秘密(例如用户凭据)。 Town Crier 的主要限制是它对 TEE 的依赖。生产 TEE 具有 最近被证明存在许多严重的漏洞,尽管该技术还处于起步阶段,并且无疑会成熟。参见附录 B.2.1 和 B.2.2 TEE 的进一步讨论。 有关 DECO 和 Town Crier 的一些示例应用程序,请参阅第 4.3、4.5 节 9.4.3 和附录 C.1。 3.6.3 现有链上 Chainlink 服务 Chainlink oracle 网络提供多种主要服务 blockchains 和当今的其他去中心化系统。 如所描述的进一步演变 在本白皮书中,将赋予这些现有服务额外的功能和 达到。三个例子是: 数据源: 今天,大多数 Chainlink 用户依赖 smart contracts 使用数据源。这些是根据关键数据的当前价值的报告 权威的链下来源。例如,价格源是报告价格的源 资产——加密货币、商品、外汇、指数、股票等——根据 交换或数据聚合服务。如今,此类信息流已经帮助确保了数十亿美元的安全 通过在 DeFi 系统(如 Aave [147] 和)中使用美元来实现链上价值 Synthetix [208]。 Chainlink 数据源的其他示例包括以下天气数据 参数农作物保险 [75] 和选举数据 [93] 等。 本文中描述的 DON 和其他技术的部署将以多种方式增强 Chainlink 网络中数据馈送的提供,包括: • 扩展:OCR 和随后的 DON 旨在使 Chainlink 服务能够扩展 他们支持的许多 blockchain 都具有显着的差异。例如,我们期望 DONs 将有助于增加节点提供的数据馈送数量 Chainlink 从 100 到 1000 甚至更长。这种缩放将有助于 Chainlink 生态系统实现了全面提供与 smart contract 相关的数据并满足和预测现有和未来需求的目标。• 增强安全性:通过存储中间报告,DONs 将保留记录 节点行为的高保真监控和测量其性能和准确性,为声誉系统提供强有力的经验基础 对于 Chainlink 节点。 FSS 和 TEF 将纳入价格反馈 以灵活的方式处理交易数据,防止抢先交易等攻击。 (明确)staking 将加强现有的加密经济安全保护 数据源。 • 馈送敏捷性:作为与 blockchain 无关的系统(实际上,更广泛地说,与消费者无关的系统),DON 可以促进向多重性提供数据馈送 依赖系统。单个 DON 可以将给定的 feed 同时推送到一组 不同的 blockchain ,消除了对每链 oracle 网络的需求, 能够在新的 blockchain 和其他设备上快速部署现有源 为当前服务的 blockchain 提供数据。 • 保密性:在 DON 中执行广义计算的能力使得敏感数据的计算能够在链外进行,避免在链上进行 曝光。 此外,使用 DECO 或 Town Crier,可以实现 更强的保密性,允许基于非公开数据生成报告 甚至暴露于 DON 节点。示例请参见第 4.3 节和第 4.5 节。 可验证随机函数(VRF): 几种类型的 DApp 需要可验证的正确随机源,以验证其自身的公平运行。 不可替代代币 (NFTs) 就是一个例子。 Aavegotchi [23] 和 Axie Infinity [35] 中 NFT 特征的稀有度由 Chainlink VRF 决定,分布也是如此 通过以太卡 [102] 中基于票证的抽奖方式获得 NFT 份;种类繁多的 结果随机的游戏 DApp;以及非常规金融工具,例如 PoolTogether [89] 等无损储蓄游戏,它将资金分配给 随机获胜者。其他 blockchain 和非 blockchain 应用程序也需要安全 随机性的来源,包括去中心化系统委员会的选择和 彩票的执行。 虽然区块 hashes 可以作为不可预测的随机性来源,但它们很容易受到敌对矿工的操纵(在某种程度上,用户提交 交易)。 Chainlink VRF [78] 提供了一种更安全的替代方案。安 oracle 有一个关联的私钥/公钥对(sk,pk),其私钥在链外维护,其公钥 pk 已发布。为了输出一个随机值,它 将 sk 应用于由依赖合约提供的不可预测的种子 x(例如,区块 hash 和 DApp 特定参数)使用函数 F,产生 y = Fsk(x) 以及 正确性证明。 (有关 Chainlink 上提供的 VRF,请参阅 [180]。) VRF 可验证的事实是,有了 pk 的知识,就可以检查证明的正确性,从而检查 y 的正确性。因此,y 值对于 对手无法预测 x 或学习 sk 并且服务无法操纵。Chainlink VRF 可能被视为涉及链下私钥托管的一系列应用程序之一。更一般地说,DONs 可以提供安全、 应用程序和/或用户的单个密钥的分散存储,并结合 这种能力具有广义计算。结果是大量的应用程序, 我们在本文中给出了一些示例,包括证明的密钥管理 储备金(参见第 4.1 节)和用户的去中心化凭证(以及其他数字 资产)(参见第 4.3 节)。 饲养员: Chainlink Keepers [87] 使开发人员能够为去中心化编写代码 链外作业的执行,通常会触发依赖smart contracts的执行。 在 Keepers 出现之前,开发者进行此类链下操作是很常见的 逻辑本身,造成集中的故障点(以及大量的重复开发工作)。相反,Keeper 提供了一个易于使用的框架 这些业务的分散外包,缩短了开发周期 活性和其他安全属性的有力保证。守护者可以支持任何 各种各样的触发目标,包括依赖于价格的贷款清算或 金融交易的执行、空投或付款的时间依赖启动 在具有产量收获的系统中,等等。 在 DON 框架中,发起者可以被视为多种意义上的守护者的概括。发起者可以使用适配器,因此可以利用 链上和链下系统的模块化接口库,允许快速 开发安全、复杂的功能。发起者发起计算 可执行文件,它们本身提供 DON 的全部多功能性,允许广泛的 我们在本文中为链上和链下应用程序提供了一系列去中心化服务。 3.6.4 节点声誉/性能历史记录 现有的 Chainlink 生态系统本身记录了性能历史记录 链上贡献节点。这一功能催生了一系列以声誉为导向的资源,这些资源可以摄取、过滤和可视化个人的绩效数据。 节点操作员和数据源。用户可以参考这些资源来获取信息 决定节点选择并监控现有网络的运行。 类似的功能将帮助用户选择DONs。 例如,当今的无许可市场(例如 market.link)允许节点 运营商列出他们的 oracle 服务并通过以下方式证明他们的链外身份 诸如 Keybase [4] 之类的服务,它将 Chainlink 中的节点的配置文件绑定到其 所有者现有的域名和社交媒体帐户。此外,性能 分析工具,例如 market.link 和reputation.link 上提供的工具,允许 用户可以查看各个节点的历史性能统计数据,包括其 平均响应延迟,报告中的值与共识值的偏差 在链上传递、产生收入、实现就业等等。这些分析工具还 允许用户跟踪其他用户对各种 oracle 网络的采用情况,这是一种形式保护此类网络的节点的隐式认可。结果是一个扁平的“网络” 信任”,其中通过使用特定节点,高价值的去中心化应用程序创建 他们对这些节点的信任信号,其他用户可以观察并纳入他们的考虑因素 自己的节点选择决策。 随着 DONs(最初是 OCR)带来了交易处理和 合同活动更普遍地是链下的。记录节点的去中心化模型 DON 本身的性能仍然是可能的。确实,高性能 DONs 的数据容量使得以细粒度构造记录成为可能 方式,并对这些记录执行去中心化计算,产生可信的摘要,可供信誉服务使用并在其上设置检查点 主链。 虽然原则上 DON 有可能在大部分节点损坏的情况下歪曲组成节点的行为,但我们注意到集体 DON 本身在传递链上数据方面的性能在主链上可见 因此不能被歪曲。此外,我们计划探索以下机制: 激励 DON 中节点行为的准确内部报告。例如,通过报告最快返回数据贡献的高性能节点的子集 对于链上转发的报告,DON 会激励节点对不正确的内容提出异议 报告:错误地在此子集中包含节点意味着错误地排除节点 这应该被包括在内,因此对他们的惩罚是无效的。 DON 重复报告失败也会激励诚实节点离开 DON。 准确的绩效历史记录和后续结果的分散编制 用户识别高性能节点以及节点运营商构建的能力 声誉是 Chainlink 生态系统的重要区别特征。 我们 第 9 节展示了我们如何将它们推理为严格且可靠的模型的关键部分。 对 DONs 提供的经济安全的广阔视野。

Decentralized Services Enabled by Decentralized

Decentralized Services Enabled by Decentralized

Oracle Networks To illustrate the versatility of DONs and how they enable a host of new services, we present five examples of DON-based applications in this section and describe the hybrid contracts that realize them: (1) Proof of Reserves, a form of cross-chain service; (2) Interfacing with enterprise / legacy systems, that is, creating a middleware-based abstraction layer that facilitates development of blockchain applications with minimal blockchain-specific code or expertise; (3) Decentralized identity, tools enabling users to obtain and manage their own identity documents and credentials; (4) Priority channels, a service that ensures timely inclusion of critical-infrastructure transactions (e.g., oracle reports) on a blockchain; and (5) Confidentiality-preserving DeFi, that is, financial smart contracts that conceal the sensitive data of participating parties. Here, we

use SC to denote the MAINCHAIN part of a hybrid contract and describe the DON component separately or in terms of an executable exec. 4.1 Proof of Reserves For many applications, it is useful to relay state between or among blockchains. A popular application of such services is cryptocurrency wrapping. Wrapped coins such as WBTC [15] are becoming a popular asset in Decentralized Finance (DeFi). They involve depositing the “wrapped” backing asset on its source blockchain MAINCHAIN(1) and creating a corresponding token on a different, target blockchain MAINCHAIN(2). For example, WBTC is an ERC20 token on the Ethereum blockchain that corresponds to BTC on the Bitcoin blockchain. Because contracts on MAINCHAIN(2) do not have direct visibility into MAINCHAIN(1), they must rely explicitly or implicitly on an oracle to report on deposits of the wrapped asset in a smart contract, producing what is sometimes called a Proof of Reserves. In WBTC [15], for example, custodian BitGo holds BTC and issues WBTC, with the Chainlink network providing Proofs of Reserve [76]. A DON can itself provide a Proof of Reserves. With a DON, however, it is possible to go further. A DON can manage secrets and, through use of appropriate adapters, can transact on any desired blockchain. Consequently, it is possible for the DON to act as one among a number of custodians—or even as a sole, decentralized custodian—for a wrapped asset. DONs can thereby serve as a platform to enhance the security of existing services that use Proofs of Reserves. For example, suppose that MAINCHAIN(1) is Bitcoin and MAINCHAIN(2) is Ethereum. On MAINCHAIN(2), a contract SC issues tokens representing wrapped BTC. The DON controls a BTC address addr(1) DON. To wrap BTC, then, a user U sends X BTC from addr(1) U to addr(1) DON along with a MAINCHAIN(2)-address addr(2) U . The DON monitors addr(1) DON via an adapter to MAINCHAIN(1). On observing U’s deposit, with sufficiently high-probability confirmation, it sends a message to SC via an adapter to MAINCHAIN(2). This message instructs SC to mint X tokens for addr(2) U . For U to release X tokens, the reverse happens. On MAINCHAIN(1), however, addr(1) DON sends X BTC to addr(1) U (or to another address, if thus requested by the user). These protocols can be adapted, of course, to work with exchanges, rather than directly with users. 4.2 Interfacing with Enterprise / Legacy Systems DONs can serve as bridges between and among blockchains, as in the example of Proof of Reserves, but another objective is for them to act as bidirectional bridges between blockchains and legacy systems [176] or blockchain-like systems such as central bank digital currencies [30]. Enterprises face a number of challenges in connecting their existing systems and processes to decentralized systems, including:

• Blockchain agility: Blockchain systems change rapidly. An enterprise may confront the rapid new appearance or rise in popularity of blockchains on which counterparties wish to conduct transactions, but for which the enterprise has no support in its existing infrastructure. In general, blockchains’ dynamism makes it difficult for individual enterprises to remain abreast of the full ecosystem. • Blockchain-specific development resources: For many organizations, hiring or incubating cutting-edge blockchain expertise is difficult, particularly in view of the challenge of agility. • Private-key management: Managing private keys for blockchains or cryptocurrencies requires operational expertise distinct from that of traditional cybersecurity practices and unavailable to many enterprises. • Confidentiality: Enterprises are leery of exposing their sensitive and proprietary data on chain. To address the first three of these difficulties, developers can simply use a DON as a secure middleware layer to enable enterprise systems to read from or write to blockchains. The DON can abstract away detailed technical considerations such as gas dynamics, chain reorganization, and so forth, for both developers and users. By presenting a streamlined blockchain interface to enterprise systems, a DON can thus considerably simplify the development of blockchain-aware enterprise applications, removing the burden from enterprises of acquiring or incubating blockchain-specific development resources. Such use of DONs is especially attractive in that it enables enterprise developers to create smart-contract applications that are largely blockchain agnostic. As a result, the larger the set of blockchains for which a DON is instrumented to act as middleware, the larger the set of blockchains to which enterprise users can gain easy access. Developers can port applications from existing blockchains to new ones with minimal modification to their internally developed applications. To address the additional problem of confidentiality, developers can appeal to the tools we introduce in this paper and expect to deploy in support of DON applications. These include DECO and Town Crier Section 3.6.2 as well as confidentiality-preserving API modifications discussed in Section 7.1.2 and a number of application-specific approaches covered in the remainder of this section. These DON systems can provide high-integrity, on-chain attestations about enterprise system state without revealing sensitive enterprise source data on chain. 4.3 Decentralized Identity Decentralized identity is a general term for the notion that users should be able to obtain and manage their own credentials, rather than relying on third parties to do so. Decentralized credentials are attestations to attributes or assertions of the holder,

which are often called claims. Credentials are digitally signed by entities, often called issuers, that can authoritatively associate claims with users. In most proposed schemes, claims are associated with a Decentralized Identifier (DID), a universal identifier for a given user. Credentials are bound to a public key whose private key the user holds. The user can thus prove possession of a claim using her private key. Visionary as decentralized identity is, existing and proposed schemes, e.g., [14, 92, 129, 216], have three severe limitations: • Lack of legacy compatibility: Existing decentralized identity systems rely on a community of authorities, called issuers, to produce DID credentials. Because existing web services do not generally digitally sign data, issuers must be launched as special-purpose systems. Because there is no incentive to do this without a decentralized-identity ecosystem, a chicken-and-the-egg problem results. In other words, it’s unclear how to bootstrap an issuer ecosystem. • Unworkable key management: Decentralized identity systems require users to manage private keys, something that experience with cryptocurrency has shown to be an unworkable onus. It is estimated that some 4,000,000 Bitcoin have been lost forever because of key management failures [194], and many users store their crypto assets with exchanges [193], thereby undermining decentralization. • Lack of privacy-preserving Sybil resistance: A basic security requirement of applications such as voting, fair allocation of tokens during token sales, etc. is that users be unable to assert multiple identities. Existing decentralized identity proposals require users to reveal their real-world identities in order to achieve such Sybil resistance, thereby undermining important privacy assurances. It is possible to address these problems using a combination of a committee of nodes performing distributed computation within a DON and the use of tools such as DECO or Town Crier, as shown in a system called CanDID [160]. DECO or Town Crier can by design turn existing web services without modification into confidentiality-preserving credential issuers. They enable a DON to export relevant data for this purpose into a credential while concealing sensitive data that should not appear in the credential. In addition, to facilitate key recovery for users, thus addressing the key-management problem, a DON can allow users to store private keys in secret-shared form. Users can recover their keys by proving to the nodes in the DON—similarly, using Town Crier or DECO—an ability to log into accounts with a set of predetermined web providers (e.g., Twitter, Google, Facebook). The benefit of using Town Crier or DECO, as opposed to OAUTH, is user privacy. Those two tools enable a user to avoid revealing to the DON a web provider identifier—from which real-world identities can often be derived. Finally, to provide Sybil resistance, as shown in [160], it is possible for a DON to perform a privacy-preserving transformation of unique real-world identifiers for users (e.g., Social Security Numbers (SSNs)) into on-chain identifiers upon user registration.

The system can thereby detect duplicate registrations without sensitive data such as SSNs being revealed to individual DON nodes.7 A DON can provide any of these services on behalf of external decentralized identity systems on permissionless or permissioned blockchains, e.g., instances of Hyperledger Indy [129]. Example application: KYC: Decentralized identity holds promise as a means to streamline requirements for financial applications on blockchains while improving user privacy. Two challenges it can help address are accreditation and compliance obligations under anti-money-laundering / know-your-customer (AML / KYC) regulations. AML regulations in many countries require financial institutions (and other businesses) to establish and verify the identities of individuals and businesses with which they perform transactions. KYC forms one component of a financial institution’s broader AML policy, which also typically involves monitoring user behaviors and watching fund flows, among other things. KYC typically involves user presentation of identity credentials in some form (e.g., entry into an online web form, holding up an identity document in front of a user’s face in a video session, etc.). Secure creation of and presentation of decentralized credentials could in principle be a beneficial alternative in several respects, namely by: (1) Making the KYC process more efficient for users and financial institutions, because once a credential is obtained, it could be presented seamlessly to any financial institution; (2) Reducing fraud by reducing opportunities for identity theft through compromise of personally identifiable information (PII) and spoofing during video verification; and (3) Reducing the risk of PII compromise in financial institutions, as users retain control of their own data. Given the multi-billion-dollar penalties paid by financial institutions for AML compliance failures, and the many financial institutions spending millions of dollars annually on KYC, improvements could yield considerable savings for financial institutions and, by extension, for consumers [196]. While the traditional financial sector is slow to adopt new compliance tools, DeFi systems are increasingly embracing it [43]. Example application: Under-collateralized loans: Most DeFi applications that support lending today originate only fully collateralized loans. These are loans made to borrowers who deposit cryptocurrency assets of value exceeding that of the loans. Interest has arisen recently in what the DeFi community generally refers to as undercollateralized loans. These, by contrast, are loans for which the corresponding collateral has value that is less than that of the principal of the loan. Under-collateralized loans resemble loans often made by traditional financial institutions. Rather than relying on deposited collateral as a guarantee of loan repayment, they instead base lending decisions on the credit histories of borrowers. 7This transformation relies on a distributed pseudorandom function (PRF).

Under-collateralized loans constitute a nascent but growing part of the DeFi lending market. They rely upon mechanisms like those employed by traditional financial institutions, such as legal contracts [91]. An essential requirement for their growth will be the ability to furnish data on user creditworthiness—a key factor in conventional lending decisions—to DeFi systems in a way that provides strong integrity, i.e., assurance of correct data. A DON-enabled decentralized identity system would enable would-be borrowers to generate high-assurance credentials attesting to their creditworthiness while preserving the confidentiality of sensitive information. Specifically, borrowers can generate these credentials based on records from authoritative online sources while exposing only the data attested to by the DON, without exposing other, potentially sensitive data. For example, a borrower can generate a credential indicating that her credit score with a set of credit bureaus exceeds a particular threshold (e.g., 750), without revealing her precise score or any other data in her records. Additionally, if desired, such credentials can be generated anonymously, i.e., the user’s name can be treated as sensitive data and itself not exposed to oracle nodes or in her decentralized credential. The credential itself can be used on chain or offchain, depending on the application. In summary, a borrower can provide essential information to lenders on their credit histories with strong integrity and without risk of exposure of unnecessary, sensitive data. A borrower can also provide a variety of other confidentiality-preserving credentials helpful in making lending decisions. For example, credentials can attest to a borrower’s possession of (off-chain) assets, as we show in our next example. Example application: Accreditation: Many jurisdictions limit the class of investor to which unregistered securities may be sold. For example, in the U.S., SEC Regulation D stipulates that to be accredited for such investment opportunities, an individual must possess a net worth of $1 million, meet certain minimum income requirements, or have certain professional qualifications [209, 210]. Current accreditation processes are cumbersome and inefficient, often requiring a letter of attestation from an accountant, or similar evidence. A decentralized identity system would enable users to generate credentials from existing online financial services accounts that prove compliance with accreditation regulations, facilitating a more efficient and privacy-preserving KYC process. The privacy-preserving properties of DECO and Town Crier, moreover, would allow these credentials to be generated with a strong assurance of integrity without directly revealing details of a user’s financial status. For example, a user could generate a credential proving that she has a net worth of at least $1 million without revealing any additional information about her financial status. 4.4 Priority Channels Priority channels are a useful new service that is easy to build using a DON. Their

Priority channel diagram showing a miner guarantee for transaction ordering to protect against MEV

goal is to deliver select, high-priority transactions in a timely way on MAINCHAIN during periods of network congestion. Priority channels may be viewed as a form of futures contract on block space and thus as a cryptocommodity, a term coined as part of Project Chicago [61, 136]. Priority channels are intended specifically for miners to enable infrastructure services, such as oracles, governance functions for contracts, etc.—not for ordinary userlevel activities such as financial transactions. In fact, as designed here, a priority channel implemented by less than 100% of the mining power in the network can only provide loose bounds on delivery times, preventing its use for highly speed-dependent goals such as front-running. Figure 10: A priority channel is a guarantee by a miner M—or, more generally, a set of miners M—to a user U that her transaction \(\tau\) will be mined within D blocks of inclusion in the mempool. A contract SC can use DON monitoring to enforce the service terms of the channel. A priority channel takes the form of an agreement between a miner or set of miners (or mining pools) M that provides the channel and a user U that pays a fee for access. M agrees that when U submits a transaction \(\tau\) to the mempool (with any gas price,

but a pre-agreed-upon gas limit), M will place it on chain within the next D blocks.8 The idea is depicted schematically in Fig. 10. Priority-channel contract description: A priority channel may be realized as a hybrid smart contract roughly as follows. We let SC denote the logic on MAINCHAIN and that on the DON by exec. SC accepts a deposit / stake \(d from M and an advance payment \)p from U. A DON executable exec monitors the mempool, triggering on placement of a transaction by U. It sends a success message to SC if U submits a transaction that M mines in a timely way and a failure message in case of a service failure. SC sends payment $p to M given a success message and sends all remaining funds, including $d, to U if it receives a failure message. Upon successful termination, it releases deposit $d to M. The miner M can of course provide priority channels simultaneously to multiple users and can open a priority channel with U for a pre-agreed-upon number of messages. 4.5 Confidentiality-Preserving DeFi / Mixicles Today, DeFi applications [1] provide little to no confidentiality for users: All transactions are visible on chain. Various zero-knowledge-based approaches, e.g., [149, 217], can provide transaction privacy, and the TEF is general enough to support them. But these approaches are not comprehensive, and do not, for example, typically conceal the asset on which a transaction is based. The broad set of computational tools we ultimately intend to support in DONs will enable privacy in a number of different ways that can plug such gaps, helping complement the privacy assurances of other systems. For example, Mixicles, a confidentialitypreserving DeFi instrument proposed by Chainlink Labs researchers [135], can conceal the asset type backing a financial instrument, and fit very naturally into the DON framework. Mixicles are most easily explained in terms of their use to realize a simple binary option. A binary option is a financial instrument in which two users, which we’ll refer to here for consistency with [135] as players, bet on an event with two possible outcomes, e.g., whether or not an asset exceeds a target price at a predesignated time. The following example illustrates the idea. Example 2. Alice and Bob are parties to a binary option based on the value of an asset called Carol’s Bubble Token (CBT). Alice bets that CBT will have a market price of at least 250 USD at time T = noon on 21 June 2025; Bob bets the reverse. Each player deposits 100 ETH by a prespecified deadline. The player with the winning position receives 200 ETH (i.e., gains 100 ETH). 8D must of course be large enough to ensure that M can comply with high probability. For instance, if M controls 20% of the mining power in the network, it might choose D = 100, ensuring a failure probability of ≈2 × 10−10, i.e., less than one in a billion.

Diagram of basic Mixicle showing on-chain secrecy with private oracle reporting

Given an existing Chainlink oracle network O, it is easy to implement a smart contract SC that realizes the agreement in Example 2. The two players each deposit 100 ETH in SC. Sometime after T, a query q is sent to O requesting the price r of CBT at time T. O sends a report r of this price to SC. SC then sends money to Alice if \(r \geq 250\) and Bob if not. This approach, however, reveals \(r\) on chain—making it easy for an observer to deduce the asset underlying the binary option. In the terminology of Mixicles, it is helpful to think conceptually of the outcome of SC in terms of a Switch that transmits a binary value computed as a predicate switch(\(r\)). In our example, switch(\(r\)) = 0 if \(r \geq 250\); given this outcome, Alice wins. Otherwise switch(r) = 1 and Bob wins. A DON can realize a basic Mixicle as a hybrid contract by running an executable exec that computes switch(r) and reports it on chain to SC. We show this construction in Fig. 11. Figure 11: Diagram of basic Mixicle in Example 2. To provide on-chain secrecy for report r, and thus the asset underlying the binary option, the oracle sends to the contract SC via Switch only the binary value switch(r). We specify an adapter ConfSwitch in Appendix C.3 that makes it easy to achieve this goal in a DON. The basic idea behind ConfSwitch is quite simple. Instead of reporting the value r, ConfSwitch reports only the binary switch value switch(r). SC can be designed to make a correct payment based on switch(r) alone, and switch(r) by itself reveals no information about the underlying asset—CBT in our example. Additionally, by placing a ciphertext on (q, r) on the ledger encrypted under pkaud, the public key of an auditor, the adapter ConfSwitch creates a confidentiality-preserving audit trail. The basic Mixicle we’ve chosen for simplicity to describe here conceals only the asset and bet behind the binary option in our example. A full-blown Mixicle [135] can provide two forms of confidentiality. It conceals from observers: (1) What event the players bet on (i.e., q and r) but also (2) Which player won the bet. Since Mixicles are executed on MAINCHAIN, either one player would need to relay switch(r) from the DON to MAINCHAIN, or an executable exec could be created that

is triggered on output by ConfSwitch and calls another adapter to send switch(r) to MAINCHAIN. A third, subtle type of confidentiality is also worth considering. In a basic implementation of ConfSwitch, O is running the adapter on the DON and thus learns the asset—CBT in our example—and thus the nature of the binary option. As discussed in Appendix C.3, however, it is additionally possible to use DECO or Town Crier to conceal even this information from O. In this case, the O learns no more information than a public observer of SC. For further details on Mixicles, we refer readers to [135].

去中心化支持的去中心化服务

甲骨文网络 为了说明 DON 的多功能性以及它们如何启用大量新服务, 我们在本节中介绍了五个基于 DON 的应用程序示例,并描述了 实现它们的混合合约:(1)储备证明,一种跨链服务形式; (2)与企业/遗留系统对接,即创建基于中间件的 抽象层,有助于以最少的成本开发 blockchain 应用程序 blockchain-特定代码或专业知识; (3) 去中心化的身份,使用户能够 获取并管理自己的身份证件和凭证; (4) 优先通道, 确保及时纳入关键基础设施交易的服务(例如 oracle 报告)在 blockchain 上; (5) 保密DeFi,即财务信息 smart contract 隐藏参与方的敏感数据。 在这里,我们

使用 SC 表示混合合约的主链部分并描述 DON 组件单独或作为可执行文件执行。 4.1 储备金证明 对于许多应用程序来说,在 blockchain 之间中继状态非常有用。一个 此类服务的流行应用是加密货币包装。包裹硬币之类的 随着 WBTC [15] 正在成为去中心化金融 (DeFi) 中的流行资产。他们 涉及将“包装”的支持资产存入其源 blockchain MAINCHAIN(1) 并在不同的目标 blockchain MAINCHAIN(2) 上创建相应的 token。 例如,WBTC 是 Ethereum blockchain 上的 ERC20 token 对应的 至 Bitcoin blockchain 上的 BTC。 由于 MAINCHAIN(2) 上的合约无法直接查看 MAINCHAIN(1), 他们必须显式或隐式依赖 oracle 来报告已包装的存款 smart contract 中的资产,产生有时称为储备证明的东西。在 WBTC [15],例如托管人 BitGo 持有 BTC 并发行 WBTC, Chainlink 网络提供储备证明 [76]。 DON 本身可以提供储备证明。但是,使用 DON 是可能的 走得更远。 DON 可以管理机密,并通过使用适当的适配器, 可以在任何所需的 blockchain 上进行交易。因此,DON 可以采取行动 作为众多托管人之一,甚至作为唯一的去中心化托管人 打包的资产。 DONs 因此可以作为增强安全性的平台 使用储备证明的现有服务。 例如,假设 MAINCHAIN(1) 为 Bitcoin,MAINCHAIN(2) 为 Ethereum。 在 MAINCHAIN(2) 上,合约 SC 发行代表打包 BTC 的 tokens。 DON 控制BTC地址addr(1) DON。为了包装 BTC,用户 U 从 地址(1) U 至地址(1) DON 以及 MAINCHAIN(2)-地址 addr(2) 乌。 DON 监视器 地址(1) DON 通过 MAINCHAIN(1) 的适配器。 在观察到 U 的存款后,以足够高的概率确认,它通过适配器向 SC 发送一条消息 主链(2)。该消息指示 SC 为 addr(2) 铸造 X tokens 乌。 当 U 释放 X tokens 时,会发生相反的情况。 然而,在 MAINCHAIN(1) 上, 地址(1) DON 发送 X BTC 到 addr(1) U(或另一个地址,如果用户如此请求)。 当然,这些协议可以进行调整,以便与交易所合作,而不是直接 与用户。 4.2 与企业/遗留系统接口 DONs 可以充当 blockchains 之间的桥梁,如证明的示例所示 储备金,但另一个目标是让它们充当储备金之间的双向桥梁 blockchain 和旧系统 [176] 或 blockchain 类似系统,例如中央银行 数字货币[30]。 企业在连接现有系统和 去中心化系统的流程,包括:• 区块链敏捷性:区块链系统变化迅速。企业可能会遇到 blockchain 的快速新出现或流行度上升,其中 交易对手有意愿进行交易,但企业无能力进行交易 现有基础设施的支持。一般来说,blockchains 的活力使得 单个企业很难跟上整个生态系统的步伐。 • 区块链特定的开发资源:对于许多组织来说,雇用或孵化尖端的blockchain 专业知识是很困难的,特别是考虑到 敏捷性的挑战。 • 私钥管理:管理 blockchain 或加密货币的私钥需要不同于传统网络安全的运营专业知识 实践中,很多企业都无法做到这一点。 • 保密性:企业对于暴露其敏感和专有信息持谨慎态度。 数据上链。 为了解决前三个困难,开发人员可以简单地使用 DON 作为安全的中间件层,使企业系统能够读取或写入 blockchains。 DON 可以抽象出详细的技术考虑因素,例如 为开发者和用户提供气体动力学、链重组等。由 为企业系统提供简化的 blockchain 接口,因此 DON 可以 大大简化了 blockchain 感知企业应用程序的开发,消除了企业获取或孵化 blockchain 特定开发资源的负担。 DONs 的这种使用特别有吸引力,因为它使企业开发人员能够 创建很大程度上与 blockchain 无关的智能合约应用程序。结果, 较大的 blockchain 集(其中 DON 被检测为充当中间件), 企业用户可以轻松访问的更大的 blockchain 集合。开发商 可以通过最少的修改将应用程序从现有的 blockchain 移植到新的应用程序 到他们内部开发的应用程序。 为了解决额外的保密问题,开发人员可以向 我们在本文中介绍并期望部署以支持 DON 应用程序的工具。 其中包括 DECO 和 Town Crier 第 3.6.2 节以及保密性 第 7.1.2 节讨论了 API 修改,本节其余部分介绍了一些特定于应用程序的方法。这些 DON 系统可以提供 关于企业系统状态的高完整性、链上证明而不泄露 敏感企业源数据上链。 4.3 去中心化身份 去中心化身份是用户应该能够 获取并管理自己的凭证,而不是依赖第三方来做 所以。去中心化凭证是对持有者属性或主张的证明,这通常称为索赔。凭证由实体进行数字签名,通常称为 发行者,可以权威地将声明与用户关联起来。在大多数提议的方案中, 声明与去中心化标识符(DID)相关联,这是一个通用标识符 给定用户。凭证绑定到用户持有其私钥的公钥。 因此,用户可以使用她的私钥证明拥有索赔。 去中心化身份是有远见的,现有的和拟议的方案,例如,[14, 92, 129, 216],具有三个严重的局限性: • 缺乏遗留兼容性:现有的去中心化身份系统依赖于 由称为发行者的权威机构组成的社区,负责生成 DID 凭证。因为 现有的网络服务通常不会对数据进行数字签名,必须启动发行者 作为特殊用途的系统。因为没有动力就没有动力这样做 去中心化的身份生态系统,就会出现先有鸡还是先有蛋的问题。在其他方面 换句话说,目前还不清楚如何引导发行人生态系统。 • 密钥管理不可行:去中心化身份系统要求用户 管理私钥,加密货币的经验已经证明了这一点 成为一个不可行的责任。据估计,大约有 4,000,000 个 Bitcoin 已被 由于密钥管理故障 [194] 而永远丢失,并且许多用户存储了他们的 加密资产与交易所[193],从而破坏权力下放。 • 缺乏保护隐私的女巫抵抗:投票、token 销售期间公平分配 token 等应用程序的基本安全要求是: 用户无法断言多个身份。现有的去中心化身份提案要求用户透露他们的现实世界身份才能实现这一目标 女巫抵抗,从而破坏重要的隐私保证。 可以使用节点委员会的组合来解决这些问题 在 DON 中执行分布式计算并使用 DECO 等工具 或 Town Crier,如名为 CanDID [160] 的系统中所示。 DECO 或 Town Crier 可以通过设计将现有的 Web 服务转变为无需修改 成为保密凭证颁发者。它们使 DON 能够导出相关的 为此目的的数据到凭证中,同时隐藏不应该的敏感数据 出现在凭证中。 另外,为了方便用户恢复密钥,从而解决密钥管理问题 问题,DON 可以允许用户以秘密共享的形式存储私钥。用户可以 通过向 DON 中的节点证明来恢复其密钥——类似地,使用 Town Crier 或 DECO——通过一组预先确定的网络提供商(例如, 推特、谷歌、脸书)。相对于使用 Town Crier 或 DECO 的好处 OAUTH,是用户隐私。这两个工具使用户能够避免向 DON 泄露信息 网络提供商标识符——通常可以从中导出现实世界的身份。 最后,为了提供 Sybil 抵抗,如 [160] 所示,DON 可以 为用户执行独特的现实世界标识符的隐私保护转换 (例如,社会安全号码(SSN))在用户注册时添加到链上标识符中。因此,系统可以检测重复注册,而无需敏感数据,例如 SSN 被泄露给各个 DON 节点。7 DON 可以代表外部去中心化身份提供任何这些服务 未经许可或经过许可的 blockchain 上的系统,例如 Hyperledger 的实例 印地[129]。 应用示例:KYC: 去中心化身份有望作为一种手段 简化 blockchains 上金融应用程序的要求,同时提高用户体验 隐私。它可以帮助解决两个挑战,即反洗钱/了解你的客户 (AML / KYC) 法规下的认证和合规义务。 许多国家的反洗钱法规要求金融机构(和其他企业)建立并验证与其进行交易的个人和企业的身份。 他们执行交易。 KYC 是金融机构的一个组成部分 更广泛的反洗钱政策,通常还涉及监控用户行为和资金流动等。 KYC 通常涉及用户以某种形式呈现身份凭证(例如, 进入在线网络表单,在用户面前举起身份证件 在视频会议等)。安全创建和呈现去中心化凭证 原则上在几个方面可能是一个有益的替代方案,即:(1) KYC 流程对于用户和金融机构来说更加高效,因为一旦 获得证书后,可以无缝地向任何金融机构出示; (2) 通过妥协减少身份盗窃的机会,从而减少欺诈 个人身份信息 (PII) 和视频验证过程中的欺骗;和 (3) 由于用户保留控制权,降低金融机构 PII 泄露的风险 他们自己的数据。 考虑到金融机构因 AML 合规失败而支付的数十亿美元罚款,以及许多金融机构每年在 KYC 上花费数百万美元,改进措施可以为金融机构带来可观的节省 并且,推而广之,对于消费者[196]。虽然传统金融业发展缓慢 为了采用新的合规工具,DeFi 系统越来越多地采用它 [43]。 应用示例: 抵押贷款不足: 大多数 DeFi 应用程序 如今的支持贷款仅源自完全抵押贷款。这些是贷款 对于存入价值超过贷款价值的加密货币资产的借款人。 最近,人们对 DeFi 社区通常所说的抵押不足贷款产生了兴趣。相比之下,这些贷款需要相应的抵押品 其价值小于贷款本金的价值。抵押贷款不足 类似于传统金融机构通常发放的贷款。而不是依靠 他们以存入的抵押品作为贷款偿还的保证,而是以贷款为基础 对借款人信用记录的决定。 7 此转换依赖于分布式伪随机函数 (PRF)。抵押不足的贷款是 DeFi 贷款市场的一个新兴但不断增长的部分。他们依赖于传统金融所采用的机制 机构,例如法律合同 [91]。是他们成长的必备条件 将能够以提供强大完整性的方式向 DeFi 系统提供有关用户信用度的数据(传统贷款决策的关键因素),即 保证数据正确。 启用 DON 的去中心化身份系统将使潜在借款人能够 生成高保证的凭证,证明其信誉度,同时保留 敏感信息的机密性。具体来说,借款人可以生成这些 基于权威在线来源记录的凭据,同时仅公开 数据由 DON 证明,而不暴露其他潜在敏感数据。对于 例如,借款人可以生成一个凭证,表明她的信用评分 信用局集合超过特定阈值(例如 750),但未透露她的信息 精确的分数或她记录中的任何其他数据。此外,如果需要,此类凭证 可以匿名生成,即用户名可以被视为敏感数据 并且其本身不会暴露于 oracle 节点或她的去中心化凭证中。凭证 它本身可以在链上或链下使用,具体取决于应用程序。 总之,借款人可以向贷方提供有关其信用的重要信息 历史具有很强的完整性,并且没有暴露不必要的敏感信息的风险 数据。 借款人还可以提供各种其他保密凭证 有助于做出贷款决策。例如,凭证可以证明借款人的 拥有(链下)资产,正如我们在下一个示例中所示。 应用示例: 认证: 许多司法管辖区限制可以出售未注册证券的投资者类别。例如,在美国,SEC D 条例规定,要获得此类投资机会的认可, 个人必须拥有 100 万美元的净资产,满足某些最低收入要求,或具有某些专业资格 [209, 210]。目前的认证 流程繁琐且低效,通常需要来自以下机构的证明信 会计师或类似的证据。 去中心化的身份系统将使用户能够从以下位置生成凭证 证明符合认可的现有在线金融服务账户 法规,促进更高效和保护隐私的 KYC 流程。 的 此外,DECO 和 Town Crier 的隐私保护特性将允许这些 生成的凭证具有强有力的完整性保证,而不会直接泄露用户财务状况的详细信息。例如,用户可以生成凭证 证明她的净资产至少为 100 万美元,且无需透露任何其他信息 有关她的财务状况的信息。 4.4 优先频道 优先通道是一项有用的新服务,可以使用 DON 轻松构建。他们的

Diagram of basic Mixicle showing on-chain secrecy with private oracle reporting

Priority channel diagram showing a miner guarantee for transaction ordering to protect against MEV

目标是在主链上及时交付精选的高优先级交易 在网络拥塞期间。优先通道可以被视为一种形式 区块空间上的期货合约,因此作为一种加密商品,这个术语是作为一部分创造的 芝加哥项目 [61, 136]。 优先通道专门用于矿工启用基础设施服务,例如 oracles、合约的治理功能等,而不是用于金融交易等普通用户级活动。 事实上,按照这里的设计,优先 网络中不到100%的算力实施的通道只能 对交货时间提供宽松的限制,防止其用于高度依赖速度的 目标,例如抢先交易。 图 10:优先通道是矿工 M 的保证,或者更一般地说,是矿工 M 的保证 一组矿工 M——向用户 U 表示她的交易 τ 将在 D 块内被开采 包含在内存池中。合约 SC 可以使用 DON 监控来强制执行 频道的服务条款。 优先通道采用一个或一组矿工之间协议的形式 提供通道的(或矿池)M和支付访问费用的用户U。 M 同意当 U 向内存池提交交易 τ 时(无论 Gas 价格如何,但预先商定的 Gas 限制),M 会将其放在接下来的 D 区块内的链上。8 图 10 示意性地描述了这个想法。 优先通道合约说明: 优先级信道可以被实现为 混合 smart contract 大致如下。我们让 SC 表示 MAINCHAIN 上的逻辑 以及 exec 的 DON 上的内容。 SC 接受来自 U. A 的存款/股份 \(d from M and an advance payment \)p DON 可执行文件 exec 监视内存池,在交易放置时触发 如果U提交了M挖矿的交易,它会向SC发送成功消息 服务失败时的及时方式和失败消息。 SC 在收到成功消息后将付款 $p 发送给 M,并发送所有剩余资金, 包括 $d,如果收到失败消息,则发送给 U。成功终止后, 将存款 $d 释放给 M。 矿工M当然可以同时向多个矿工提供优先通道 用户可以与 U 打开优先通道以接收预先商定数量的消息。 4.5 保密 DeFi / Mixicles 如今,DeFi 应用程序 [1] 为用户提供的保密性几乎为零:所有交易在链上都是可见的。各种基于零知识的方法,例如[149, 217], 可以提供交易隐私,并且 TEF 足够通用来支持它们。但是 这些方法并不全面,例如,通常不会隐藏 交易所基于的资产。 我们最终打算在 DONs 中支持的广泛计算工具将 通过多种不同方式实现隐私保护,可以弥补此类差距,有助于补充其他系统的隐私保证。例如,Mixicles,一种由 Chainlink 实验室研究人员 [135] 提出的保密 DeFi 工具,可以隐藏 支持金融工具的资产类型,非常自然地适合 DON 框架。 Mixicles 最容易解释为它们用于实现简单的二进制文件 选项。 二元期权是一种有两个用户的金融工具,我们将 请参阅此处以与 [135] 作为玩家保持一致,对有两种可能的赛事进行投注 结果,例如资产是否在预先指定的时间超过目标价格。 下面的例子说明了这个想法。 示例 2. Alice 和 Bob 是基于资产价值的二元期权的参与方 称为卡罗尔的泡沫代币(CBT)。 Alice 打赌 CBT 的市场价格为 时间 T = 2025 年 6 月 21 日中午至少 250 美元;鲍勃打赌相反。每个玩家 在预定期限内存入 100 ETH。获胜位置的玩家 收到 200 ETH(即收益 100 ETH)。 8D当然必须足够大,以保证M能够符合高概率。 对于 例如,如果M控制网络中20%的算力,它可能会选择D = 100,确保 失效概率为 ≈2 × 10−10,即小于十亿分之一。给定现有的 Chainlink oracle 网络 O,很容易实现智能 实现例2协议的合约SC,两个玩家各自存款 100 ETH 为 SC。 T 之后的某个时间,查询 q 被发送到 O 请求价格 r CBT 在 T.O 时间向 SC 发送该价格的报告 r。 SC然后将钱发送给Alice 如果 r ≥250,则 Bob 如果不是。然而,这种方法揭示了链上的 r——使其变得容易 让观察者推断出二元期权背后的资产。 在 Mixicles 的术语中,从概念上思考结果是有帮助的 SC 就 Switch 而言,它传输作为谓词计算的二进制值 开关(r)。在我们的示例中,如果 r ≥250,则 switch(r) = 0;鉴于此结果,爱丽丝获胜。 否则 switch(r) = 1 并且 Bob 获胜。 DON 可以通过运行可执行文件将基本 Mixicle 实现为混合合约 exec 计算 switch(r) 并将其在链上报告给 SC。我们展示这个结构 如图 11 所示。 图 11:示例 2 中的基本 Mixicle 图表。为以下内容提供链上保密性: 报告 r,因此二元期权的基础资产 oracle 发送到 仅通过 Switch 签订二进制值 switch(r) 合约 SC。 我们在附录 C.3 中指定了一个适配器 ConfSwitch,可以轻松实现这一点 DON 的目标。 ConfSwitch 背后的基本思想非常简单。而不是报告 r 值,ConfSwitch 仅报告二进制开关值 switch(r)。 SC 可以 旨在仅基于 switch(r) 和 switch(r) 本身进行正确支付 没有透露有关标的资产(在我们的示例中为 CBT)的信息。另外, 通过将密文放在账本上的 (q, r) 上,并使用 pkaud 的公钥进行加密 作为审计员,适配器 ConfSwitch 创建保密审计跟踪。 为了简单起见,我们在这里选择的基本 Mixicle 只隐藏了 在我们的示例中,二元期权背后的资产和赌注。一个成熟的 Mixicle [135] 可以 提供两种形式的保密性。它向观察者隐瞒了:(1)发生了什么事件 玩家对(即 q 和 r)下注,还对 (2) 哪位玩家赢得了赌注。 由于 Mixicles 是在主链上执行的,因此任一玩家都需要中继 switch(r) 从 DON 到 MAINCHAIN,或者可以创建一个可执行的 exec

由 ConfSwitch 输出触发并调用另一个适配器将 switch(r) 发送到 主链。 第三种微妙的保密方式也值得考虑。在 ConfSwitch 的基本实现中,O 在 DON 上运行适配器,从而学习 资产——在我们的例子中是 CBT——以及二元期权的本质。正如所讨论的 然而,在附录 C.3 中,还可以使用 DECO 或 Town Crier 来 甚至向 O 隐瞒此信息。在这种情况下,O 不会了解更多信息 而非 SC 的公共观察员。 有关 Mixicles 的更多详细信息,我们建议读者参阅 [135]。

Fair Sequencing Services

Fair Sequencing Services

One important service that we expect DONs will offer that leverages their networking, computation, and storage capabilities is called Fair Sequencing Services (FSS). Although FSS may be viewed simply as an application realized within the DON framework, we highlight it as a service that we believe will be in high demand across blockchains, and which we expect the Chainlink network to support actively. When executed on public blockchain networks, many of today’s DeFi applications reveal information that can be exploited by users to their own benefit, analogous to the kind of insider leaks and manipulation opportunities that are pervasive in existing markets [64, 155]. FSS instead paves the way toward a fair DeFi ecosystem. FSS helps developers to build DeFi contracts that are protected from market manipulation resulting from information leakage. Given the problems we highlight below, FSS is especially attractive for layer-2 services and fits within the framework for such services that we discuss in Section 6. The challenge: In existing permissionless systems, transactions are ordered entirely at the discretion of miners. In permissioned networks, the validator nodes may exert the same power. This is a form of largely unrecognized ephemeral centralization in otherwise decentralized systems. A miner can (temporarily) censor transactions for its own benefit [171] or reorder them to maximize its own gain, a notion called minerextractable value (MEV) [90]. The term MEV is slightly deceptive: It does not refer only to value that miners can capture: Some MEV can be captured by ordinary users. Because miners have more power than ordinary users, however, MEV represents an upper bound on the amount of value any entity can obtain through adversarial reordering and complementary transaction insertion. Even when miners order transactions simply based on fees (gas), without manipulation, users themselves can manipulate gas prices to advantage their transactions over those of less sophistication. Daian et al. [90] document and quantify ways in which bots (not miners) take advantage of gas dynamics in a way that harms users of DeFi systems today and how MEV even threatens the stability of the underlying consensus layer in a blockchain. Other examples of transaction-order manipulation surface regularly, e.g., [50, 154].

New transaction-processing methods such as rollups are a very promising approach to the scaling problems of high-throughput blockchains. They do not, however, address the problem of MEV. Instead, they shift it to the entity that generates the rollup. That entity, whether the operator of a smart contract or a user furnishing a (zk-)rollup with a validity proof, has the power to order and insert transactions. In other words, rollups swap MEV for REV: Rollup-Extractable Value. MEV affects upcoming transactions that have been submitted to the mempool but are not yet committed on chain. Information about such transactions is broadly available in the network. Miners, validators, and ordinary network participants can therefore exploit this knowledge and create dependent transactions. In addition, miners and validators may influence the order of those transactions that they commit themselves and exploit this to their advantage. The problem of undue influence by leaders on transaction ordering in consensus protocols has been known in the literature since the 1990s [71, 190], but no satisfying solutions have been realized in practice so far [97]. The main reason is that proposed solutions—at least until very recently—cannot readily be integrated with public blockchains, as they rely on the content of transactions remaining secret until after their ordering has been determined. Fair Sequencing Services (FSS) overview: DONs will provide tools to decentralize transaction ordering and implement it according to a policy specified by a relying contract creator, ideally one that is fair, and not advantaging actors who wish to manipulate transaction ordering. Collectively, these tools constitute FSS. FSS includes three components. The first is monitoring of transactions. In FSS, oracle nodes in O both monitor the mempool of MAINCHAIN and (if desired) permit off-chain submission of transactions through a specialized channel. The second is sequencing of transactions. The nodes in O order transactions for a relying contract according to a policy defined for that contract. The third is posting of transactions. After the transactions are ordered, the nodes in O jointly send the transactions to the main chain. The potential benefits of FSS include: • Order-fairness: FSS includes tools to help developers ensure that transactions input to a particular contract are ordered in a way that does not give an unfair advantage to well-resourced and/or technically savvy users. Ordering policies can be specified for this purpose. • Reduction or elimination of information leaks: By ensuring that network participants cannot exploit knowledge about upcoming transactions, FSS can abate or eliminate attacks like front-running that are based on information available in the network before transactions are committed. Preventing exploitation of such leakage ensures that adversarial transactions which depend on original pending transactions cannot enter the ledger before the original transactions are committed.

• Reduced transaction cost: By eliminating players’ need for speed in submitting their transactions to a smart contract, FSS can greatly reduce the cost of transaction processing. • Priority ordering: FSS can automatically give critical transactions special priority ordering. For example, in order to prevent front-running attacks against oracle reports, e.g., [79], FSS can insert an oracle report into a stream of transactions retroactively. An overarching goal of the FSS in DONs is to empower DeFi creators to realize fair financial systems, that is, systems that don’t advantage particular users (or miners) over others on the basis of speed, insider knowledge, or ability to perform technical manipulation. While a crisp, general notion of fairness is elusive, and perfect fairness in any reasonable sense is unachievable, FSS aims to provide developers with a powerful set of tools so that they can enforce policies that help meet their design goals for DeFi. We note that while the main goal of FSS is to act as a fair sequencing service for the MAINCHAIN that DONs target, some of the same fairness desiderata that FSS guarantees can also be appropriate for (decentralized) protocols that are run among DON parties. Thus, FSS can be viewed more broadly as a service provided by a subset of DON nodes to fairly sequence not only transactions sent by users of MAINCHAIN but also transactions (i.e., messages) shared among other DON nodes. In this section, we will focus primarily on the goal of sequencing MAINCHAIN transactions. Section organization: In Section 5.1, we describe two high-level applications that motivate the design of FSS: preventing front-running of oracle reports and preventing front-running of user transactions. We then provide more details on the design of FSS in Section 5.2. Section 5.3 describes examples of fair ordering guarantees and means to achieve them. Finally, Section 5.4 and Section 5.5 discuss network-level threats to such policies and means to address them, respectively for network flooding and Sybil attacks. 5.1 The Front-Running Problem To explain the goals and design of FSS, we describe two general forms of front-running attacks and the limitations of existing solutions. Front-running exemplifies a class of transaction-ordering attacks: There are a number of related attacks such as backrunning and sandwiching (front-running plus back-running) [237] that we don’t cover here, but which FSS also helps address. 5.1.1 Oracle Front-Running In their traditional role of providing off-chain data to blockchain applications, oracles become a natural target for front-running attacks.

Consider the common design pattern of using an oracle to supply various price feeds to an on-chain exchange: periodically (say every hour), the oracle collects price data for different assets and sends these to an exchange contract. These price-data transactions present obvious arbitrage opportunities: For example, if the newest oracle report lists a much higher price for some asset, an adversary could front-run the oracle report to buy up assets and immediately resell them once the oracle’s report is processed. Speed bumps and retroactive pricing: A natural solution to the oracle frontrunning problem is to give oracle reports special priority over other transactions. For example, oracle reports could be sent with high fees to encourage miners to process them first. But this will not prevent front-running if the arbitrage opportunity is high, nor can it prevent arbitrage by the miners themselves. Some exchanges have thus resorted to implementing more heavyweight “speedbumps,” such as queuing user transactions for a number of blocks before processing them, or retroactively adjusting prices when a new oracle report arrives. The disadvantages of these solutions are that they add complexity to the exchange implementation, increase storage requirements and thus transaction costs, and disrupt the user experience as asset exchanges are only confirmed after a significant time period. Piggybacking: Before moving on to FSS, we discuss piggybacking, a quite simple and elegant solution to the oracle front-running problem. It is not applicable to address front-running in other scenarios, however. In short, instead of periodically sending reports to the on-chain contract, oracles publish signed reports that users append to their transactions when buying or selling on-chain assets. The exchange then simply checks that the report is valid and fresh (e.g., the oracle can sign a range of blocks for which the report is valid), and extracts the relevant price feed from it. This simple approach has a number of advantages over the above “speed bump” approach: (1) The exchange contract need not keep state of price feeds, which should lead to lower transaction costs; (2) As oracle reports are posted on chain on a byneed basis, oracles can generate more frequent updates (e.g., every minute), thereby minimizing arbitrage opportunities from front-running a report9; (3) Transactions can be validated immediately, as they always include a fresh price feed. The approach is not perfect, however. First, this piggybacking solution puts the onus on the exchange’s users to fetch up-to-date oracle reports and attach them to their transactions. Second, while piggybacking minimizes arbitrage opportunities, it cannot fully prevent them without affecting the liveness of the on-chain contract. Indeed, if an oracle report is valid until some block number n, then a transaction submitted to block n + 1 would require a new valid report. Due to inherent delays in the propagation of reports from oracles to users, the new report that is valid for block n + 1 would have 9Arbitrage is only worthwhile if the exploitable difference in asset prices exceeds the extraneous fees required to buy and sell the assets, e.g., those collected by miners and the exchange.

to be publicized some period before block n + 1 is mined, say at block n −k, thereby creating a sequence of k blocks where a short-lived arbitrage opportunity exists. We now describe how FSS gets around these limitations. Prioritizing oracle reports with FSS: FSS can address the oracle front-running problem by building upon the above piggybacking solution, but pushing the additional work of augmenting transactions with oracle reports to the Decentralized Oracle Network. At a high level, oracle nodes collect transactions destined for an on-chain exchange, agree on a real-time price feed, and post the price feed along with the collected transactions to the main-chain contract. Conceptually, one can think of this approach as a “data-augmented transaction batching”, where the oracle ensures that an up-to-date price feed is always added to transactions. FSS solutions can be implemented transparently to the exchange’s users, and with minimal changes to contract logic, as we describe in more detail in Section 5.2. Ensuring that fresh oracle reports are always prioritized over user transactions is just one example of an ordering policy that FSS can adopt and enforce. Policies of FSS for ensuring order fairness are described more generally in Section 5.3. 5.1.2 Front-Running User Transactions We now turn to front-running in generic applications, where the defense method above does not work. The problem can be captured broadly through the following scenario: An adversary sees some user transaction tx1 sent into the P2P network and injects its own adversarial transaction tx2, so that tx2 is processed before tx1 (e.g., by paying a higher transaction fee). For instance, this kind of front-running is common among bots that exploit arbitrage opportunities in DeFi systems [90] and has affected users of various decentralized applications [101]. Imposing a fair order among the transactions processed on the blockchain addresses this problem. More fundamentally, seeing the details of tx1 is sometimes not even necessary and knowledge of its mere existence may allow an adversary to front-run tx1 through its own tx2 and defraud the innocent user that created tx1. For example, the user might be known to trade a particular asset at regular times. Preventing such attacks requires mitigations that avoid leakage of metadata as well [62]. Some solutions for this problem exist, but they introduce delays and usability concerns. From network-order to finalized-order with FSS: Opportunities for front-running arise because existing systems have no mechanisms to ensure that the order in which transactions appear on chain respects the order of events and the information flow outside the network. This represents a problem arising from deficiencies in the implementation of applications (e.g., trading platforms) on a blockchain. Ideally, one would ensure that transactions are committed on the blockchain in the same order as they were created and sent to the blockchain’s P2P network. But since the blockchain network

Fair Sequencing Services general schematic showing transaction flow from users through DON to main chain

is distributed, no such order can be captured. FSS therefore introduces mechanisms to safeguard against violations of fairness, which arise only because of the distributed nature of the blockchain network. 5.2 FSS Details Figure 12: Order-fair mempool with two different transaction paths: direct and mempool-based. Fig. 12 shows a general schematic of the FSS. For ensuring fairness, the DON providing FSS must interfere with the flow of transactions as they enter MAINCHAIN. Adjustments to clients, to smart contracts on MAINCHAIN, or to both may be necessary. At a high level, processing of transactions by FSS can be decomposed into three phases, described below: (1) Transaction monitoring; (2) Transaction sequencing; and (3) Transaction posting. Depending on the ordering method used for transaction sequencing, additional protocol steps are needed, as described in the next section. 5.2.1 Transaction Processing Transaction monitoring: We envision two different approaches for FSS to monitor user transactions destined for a specific smart contract, direct and mempool-based: • Direct: The direct approach is conceptually simplest, but requires changes to user clients so that transactions are sent directly to the Decentralized Oracle

Network nodes, rather than to the nodes of the main chain. The DON collects user transactions destined to a specific smart contract SC and orders them based on some ordering policy. The DON then sends the ordered transactions to the smart contract on the main chain. Some ordering mechanisms also require the direct approach because the user that creates a transaction must cryptographically protect it before sending it to FSS. • Mempool-based: To facilitate the integration of FSS with legacy clients, the DON can use Mempool Services (MS) to monitor the main chain’s mempool and collect transactions. Direct transmission is likely to be the preferred implementation for many contracts, and we believe it should be fairly practical in many cases. We briefly discuss how existing DApps could be minimally modified to support direct transmission while preserving a good user experience. We describe approaches using Ethereum and MetaMask [6] since these are the most popular choices today, but the mentioned techniques should extend to other chains and wallets. A recent Ethereum Improvement Proposal, “EIP-3085: Wallet add Ethereum chain RPC method” [100], will make it easy to target custom Ethereum chains (using a different CHAIN ID than that of MAINCHAIN to prevent replay attacks) from MetaMask and other browserbased wallets. After implementation of this proposal, a DApp seeking to use a DON would simply add a single method call to their front-end to be able to directly transmit transactions to any DON exposing an Ethereum-compatible API. In the meantime, “EIP-712: Ethereum typed structured data hashing and signing” [49] provides a slightly more involved but already widely deployed alternative, where a DApp user can use MetaMask to sign structured data specifying a DON transaction. The DApp can send this signed structured data to the DON. Finally, we note that hybrid approaches are also possible. For example, legacy clients can continue to send transactions into the main chain’s mempool, but critical transactions (e.g., oracle reports) are sent to DON nodes directly (in particular, the set of nodes providing oracle reports such as price-feed updates and the set of nodes providing FSS may overlap or be identical). Transaction sequencing: The main purpose of FSS is to guarantee that user transactions are ordered according to a pre-defined policy. The nature of this policy will depend on the application’s needs and the types of unfair transaction orderings that it aims to prevent. Since FSS on the DON is capable of processing data and maintaining local state, they may impose an arbitrary sequencing policy based on the information that is available at the oracles. The particular ordering policies and their implementation are discussed subsequently in Section 5.3.

Transaction posting: After collecting and ordering user transactions, received either directly from users or collected from the mempool, the DON sends these transactions to the main chain. As such, a DON’s interactions with the main chain remain subject to (potentially unfair) transaction ordering governed by the main chain’s miners. To harness the benefits of decentralized transaction ordering, the target smart contract SC thus has to be designed to treat the DON as a “first-class” citizen. We distinguish two approaches: • DON-only contracts: The simplest design option is to have the main chain smart contract SC only accept transactions that have been processed by the DON. This ensures that the smart contract processes transactions in the order proposed by the DON, but de-facto restricts the smart contract to operating in a committeebased system (i.e., the DON committee now has ongoing power to determine the ordering and inclusion of transactions). • Dual-class contracts: A preferred, more granular design has the main chain smart contract SC accept transactions originating both from the DON and from legacy users,10 but places traditional “speed bumps” on transactions that were not processed by the DON. For example, transactions from the DON may be processed immediately, whereas legacy transactions get “buffered” by the smart contract for a fixed period of time. Other standard mechanisms for preventing front-running such as commit-reveal schemes or VDFs [53] could also be applied to legacy transactions. This ensures that DON-ordered transactions do get processed in the order agreed upon, without giving the DON the unwanted power to censor transactions. As the imposition of transaction ordering by FSS requires that transactions are aggregated “off-chain,” this solution is naturally combined with other aggregation techniques that aim to reduce on-chain processing costs. For example, after collecting and ordering transactions, the DON may send these transactions to the main chain as a single “batched transaction” (e.g., a rollup), thereby reducing the aggregate transaction fee. Enforcing the transaction order: Whether in a DON-only or dual-class design, the main chain smart contract SC and the DON have to be co-designed so as to guarantee that the DON’s transaction ordering is upheld. Here also, we envision different design options: • Sequence numbers: The DON can append a sequence number to each transaction, and send these transactions into the main chain’s mempool. The main 10If the DON’s transaction monitoring is based on the mempool, legacy transactions must be distinguishable from DON transactions so that they are not collected by the DON, e.g., via a special tag embedded in the transaction or by specifying a particular gas price, e.g. DON transactions have gas prices below a certain threshold.

chain smart contract SC ignores transactions that arrive “out-of-sequence.” We note that in this setting, the main-chain miners can decide to ignore the DON’s transaction ordering, thereby causing transactions to fail. It is possible by keeping (expensive) state for SC to enforce correct transaction ordering, somewhat analogously to how TCP buffers out-of-order packets until missing packets are received. • Transaction nonces: For many blockchains, and in particular for Ethereum, the above sequence-numbering approach can leverage built-in transaction nonces to enforce that the main-chain smart contract SC processes transactions in sequence. Here, the DON nodes send transactions to the main chain through a single mainchain account, protected with a key shared among the DON nodes. The account’s transaction nonce ensures that transactions are mined and processed in the correct order. • Aggregate transactions: The DON can aggregate multiple transactions in a rollup (or in a bundle similar to a rollup). The main-chain smart contract needs to be designed to handle such aggregate transactions. • Aggregate transactions with a main chain proxy: Here, the DON similarly bundles transactions into one “meta-transaction” for the main chain, but relies on a custom proxy smart contract to unpack the transactions and relay them to the target contract SC. This technique can be useful for legacy compatibility. Metatransactions act like rollups but differ in that they consist of an uncompressed list of transactions posted once to the main chain. The last design has the advantage of seamlessly supporting user transactions that are themselves proxied through a main chain contract before reaching the DON’s target contract SC. For example, consider a user who sends a transaction to some wallet contract, which in turn sends an internal transaction to SC. Assigning a sequence number to such a transaction would be tricky, unless the user’s wallet contract is specially designed to forward the sequence number with every internal transaction to SC. Similarly, such internal transactions cannot be easily aggregated into a metatransaction that is sent directly to SC. We discuss further design considerations for such proxied transactions below. 5.2.2 Transaction Atomicity Our discussion thus far has implicitly assumed that transactions interact with a single on-chain smart contract (e.g., a user sends a buy request to an exchange). Yet, in systems such as Ethereum, a single transaction can consist of multiple internal transactions, e.g., one smart contract calling a function in another contract. Below, we describe two high-level strategies for sequencing “multi-contract” transactions, while preserving the atomicity of the transaction (i.e., the sequence of actions prescribed by the transaction are all executed in the correct order, or not at all).

Strong atomicity: The simplest solution is to apply FSS, as described above, directly to entire “multi-contract” transactions. That is, users send their transactions into the network and FSS monitors, sequences, and posts these transactions to the main chain. This approach is technically simple, but has one potential limitation: If a user transaction interacts with two contracts SC1 and SC2 that both want to leverage fair sequencing services, then the sequencing policy of these two contracts has to be consistent. That is, given two different transactions tx1 and tx2 that each interacts with both SC1 and SC2, it must not be the case that the policy of SC1 orders tx1 before tx2 whereas the policy of SC2 prescribes the opposite order. For the vast majority of scenarios of interest, we envision that the sequencing policies adopted by different contracts will be consistent. For example, both SC1 and SC2 may want transactions to be ordered by their approximate arrival time in the mempool, and SC1 may further want certain oracle reports to always be delivered first. As the latter oracle report transactions do not interact with SC2, the policies are consistent. Weak atomicity: In its full generality, FSS could be applied at the level of individual internal transactions. Consider transactions of the form tx = { ˜txpre, ˜txSC, ˜txpost}, consisting of some initial transaction(s) ˜txpre, which results in an internal transaction ˜txSC to SC, which in turn issues internal transaction(s) ˜txpost. The sequencing policy of SC might determine how the internal transaction ˜txSC has to be ordered with respect to other transactions sent to SC, but leave open the sequencing order for ˜txpre and ˜txpost. Given the intrinsics of transaction processing in systems such as Ethereum, developing a sequencing service that targets specific internal transactions is not straightforward. With a specially designed contract SC, this may be realizable as follows: 1. The transaction tx is sent into the network and mined (without any sequencing performed by FSS). The initial ˜txpre is executed, and calls ˜txSC. 2. SC does not execute ˜txSC and returns. 3. FSS monitors internal transactions to SC, sequences them, and posts them back to SC (i.e., by sending transactions ˜txSC directly to SC). 4. SC processes the transactions ˜txSC received from FSS, and issues internal transactions ˜txpost that result from ˜txSC. With this approach, transactions are not executed fully atomically (i.e., the original transaction tx gets broken up into multiple on-chain transactions), but the ordering of internal transactions is preserved. This solution entails a number of design constraints. For example, ˜txpre cannot assume that ˜txSC and ˜txpost will be executed. Moreover, SC should be designed so as to execute transactions ˜txSC and ˜txpost on behalf of a certain user, even though they were

sent by FSS. For these reasons, the more coarse-grained “Strong Atomicity” solution above is likely preferable in practice. For respecting more complex dependencies, involving multiple transactions and their respective internal transactions, the transaction scheduler of FSS may contain elaborate functions that resemble those found in transaction managers of relational database managers. 5.3 Fair Transaction Sequencing Here we discuss two notions of fairness for transaction sequencing and the corresponding implementations, which may be realized by FSS: order-fairness based on a policy imposed by FSS and secure causality preservation, which requires additional cryptographic methods in FSS. Order-fairness: Order-fairness is a notion of temporal fairness in consensus protocols that has first been introduced formally by Kelkar et al. [144]. Kelkar et al. aim to achieve a form of natural policy in which transactions are ordered based on the time they are first received by the DON (or the P2P network, in the case of a mempool-based FSS). In a decentralized system, however, different nodes may see transactions arrive in a different order. Establishing a total order on all transactions is the very problem solved by the consensus protocol underlying MAINCHAIN. Kelkar et al. [144] therefore introduce a weaker notion that can be achieved with the help of a Decentralized Oracle Network, called “block-order fairness.” It groups the transactions that the DON has received during a time interval into a “block” and inserts all transactions of the block concurrently and at the same position (i.e., height) into MAINCHAIN. They are thus ordered together and must be executable in parallel, without creating any conflicts among them. Roughly speaking, orderfairness then states that if a large fraction of nodes see transaction \(\tau_1\) before \(\tau_2\), then \(\tau_1\) will be sequenced before or in the same block as \(\tau_2\). By imposing such a coarse granularity on transaction order, the opportunities for front-running and other orderrelated attacks are greatly reduced. Kelkar et al. propose a family of protocols called Aequitas [144], which address different deployment models, including synchronous, partially synchronous, and asynchronous network settings. Aequitas protocols impose significant communication overhead relative to basic BFT consensus and are therefore not ideal for practical use. We believe, however, that practical variants of Aequitas will emerge that can be used for transaction sequencing in FSS and other applications. Some related schemes have already been proposed that have less accompanying formalism and weaker properties, e.g., [36, 151, 236], but better practical performance. These schemes can be supported in FSS as well. It is also worth noting that the term “fairness” appears elsewhere in the blockchain literature with a different meaning, namely fairness in the sense of opportunity for

miners proportional to their committed resources [106, 181] or for validators in terms of equal opportunity [153]. Secure causality preservation: The most widely known approach to prevent frontrunning and other ordering violations in distributed platforms relies on cryptographic techniques. Their common feature is to hide the transaction data itself, waiting until the order at the consensus layer has been established, and to reveal the transaction data later for processing. This preserves the causal order among the transactions that are executed by the blockchain. The relevant security notions and cryptographic protocols have been developed considerably before the advent of blockchains [71, 190]. The security conditions of “input causality” [190] and “secure causality preservation” [71, 97] require formally that no information about a transaction becomes known before the position of this transaction in the global order has been determined. An adversary must not be able to infer any information until that time, in a cryptographically strong sense. One can distinguish four cryptographic techniques to preserve causality: • Commit-reveal protocols [29, 142, 145]: Instead of a transaction being announced in the clear, only a cryptographic commitment to the transaction is broadcast. After all committed but hidden transactions have been ordered (in early blockchain systems on MAINCHAIN itself, but here by FSS), the sender must open the commitment and reveal the transaction data within a predetermined time interval. The network then verifies that the opening satisfies the earlier commitment. The origins of this method date prior to the advent of blockchains. Although it is particularly simple, the approach introduces considerable drawbacks and is not easy to employ for two reasons. First, since only the commitment exists at the level of the ordering protocol, the semantics of the transaction cannot be validated during consensus. An additional round-trip to the client is required. More severely, though, weighs the possibility that no opening may ever arrive, which could amount to a denial-of-service attack. Furthermore, it is difficult to determine whether the opening is valid in a consistent, distributed manner because all participants must agree on whether the opening arrived in time. • Commit-reveal protocols with delayed recovery [145]: One challenge with the commit-reveal approach is that a client may commit to a transaction speculatively and reveal it later only if subsequent transactions make it profitable. A recent variant of the commit-reveal approach improves the resilience against this kind of misbehavior. In particular, the TEX protocol [145] addresses this problem using a clever approach in which encrypted transactions include a decryption key obtainable by computing a verifiable delay function (VDF) [53, 221]. If a client fails to decrypt her transaction in a timely way, others in the system will decrypt it on her behalf by solving a moderately hard cryptographic puzzle.

• Threshold encryption [71, 190]: This method exploits that the DON may perform threshold-cryptographic operations. Assume FSS maintains an encryption public key pkO and the oracles share the corresponding private key among themselves. Clients then encrypt transactions under pkO and send them to FSS. FSS orders transactions on the DON, then decrypts them, and finally injects them into MAINCHAIN in the fixed order. Encryption therefore ensures that ordering is not based on the transaction content, but that the data itself is available when needed. This method was originally proposed by Reiter and Birman [190] and later refined by Cachin et al. [71], where it was integrated with a permissioned consensus protocol. More recent work has explored the use of threshold cryptography as a consensus-level mechanism for generic messages [33, 97] and for general computations with shared data [41]. Compared to commit-reveal protocols, threshold encryption prevents simple denialof-service attacks (although care is required given the computational cost of decryption). It lets the DON proceed autonomously, at its own speed and without waiting for further client actions. Transactions may be validated immediately after they have been decrypted. Moreover, clients encrypt all transactions with one key for the DON and the communication pattern remains the same as with other transactions. Managing the threshold key securely and with changing nodes in O, however, may pose additional difficulties. • Committed secret sharing [97]: Instead of encrypting the transaction data under a key held by the DON, the client may also secret-share it for the nodes in O. Using a hybrid, computationally secure secret sharing scheme, the transaction is encrypted first using a symmetric cipher with a random key. Only the corresponding symmetric key is shared and the ciphertext is submitted to the DON. The client must send one key share to each node in O using a separately encrypted message. The remaining protocol steps are the same as with threshold encryption, except that the transaction data is decrypted with the symmetric algorithm after reconstructing the per-transaction key from its shares. This method does not require setup or management of a public-key cryptosystem associated with the DON. However, the clients must be aware of the nodes in O and communicate in a secure context with each one of them, which places additional burden on the clients. Although the cryptographic methods offer complete protection against information leaking from submitted transactions to the network, they do not conceal metadata. For example, an IP address or an Ethereum address of the sender could still be used by an adversary to perform front-running and other attacks. Various privacy-enhancing techniques deployed at the network layer, e.g., [52, 95, 107], or the transaction layer, e.g., [13, 65], would be needed to accomplish this goal. The impact of a particular piece of metadata, namely to which contract a transaction is sent, can be (partially) concealed

through multiplexing many contracts on the same DON. Cryptographic concealment of transactions per se also doesn’t prevent prioritization of transactions by corrupted DON nodes in collusion with transaction senders. Secure causality as guaranteed by cryptographic protocols complement the orderfairness guarantees for any policy, and we intend to explore a combination of the two methods, where this is possible. If an adversary cannot gain significant advantage from observing metadata, the secure causality-preservation protocols could be used alongside a na¨ıve ordering approach as well. For example, oracle nodes can write transactions to L as soon as they receive them, without duplication. Transactions would then be ordered according to their appearance on L and subsequently decrypted. We also plan to consider the use of TEEs as a way to help enforce fair ordering; for example, Tesseract [44] may be viewed as achieving a form of causal ordering, but one strengthened by the ability of the TEE to process transactions in explicit form while retaining their confidentiality. 5.4 Network-Layer Considerations So far, our description of FSS has mainly focused on the problem of enforcing that the finalized order of transactions matches their observed order in the network. Hereafter, we consider fairness issues that could arise at the network layer itself. High-frequency traders in conventional electronic marketplaces invest considerable resources to obtain superior network speed [64], and traders in cryptocurrency exchanges exhibit similar behavior [90]. Network speed confers an advantage both in observing the transactions of other parties and in submitting competing transactions. One remedy deployed in practice and popularized in the book Flash Boys [155] is the “speed bump” introduced initially in the IEX exchange [128] and later in other exchanges [179] (with mixed results [19]). This mechanism imposes a delay (350 microseconds in IEX) on access to the market, with the aim of neutralizing advantages in speed. Empirical evidence, e.g. [128], supports its efficacy in decreasing certain trading costs for ordinary investors. FSS can be used simply to implement an asymmetrical speed bump—one that delays incoming transactions. Budish, Cramton, and Shim [64] argue that exploitation of advantages in speed is inescapable in continuous-time markets, and argue for a structural remedy in the form of batch-auction-based markets. But this approach has not taken hold broadly in existing trading platforms. Conventional trading systems are centralized, typically receiving transactions through a single network connection. In a decentralized system, by contrast, it is possible to observe transaction propagation from multiple vantage points. Consequently, it is possible to observe behaviors such as network flooding in a P2P network. We intend to explore network-layer approaches to FSS that help developers to specify policies prohibiting such undesirable network behaviors.

5.5 Entity-Level Fairness Policies Order-fairness and secure causality aim at enforcing an ordering on transactions that respects the time when they were created and first submitted to the network. A limitation of this notion of fairness is that it does not prevent attacks in which an adversary gains an advantage by flooding a system with many transactions, a strategy observed in the wild as a way to perform effective transaction sniping in token sales [159] and to create congestion resulting in liquidation of collateralized debt positions (CDPs) [48]. In other words, order-fairness enforces fairness with respect to transactions, not players. As shown in the CanDID system [160], it is possible to use oracle tools such as DECO or Town Crier in conjunction with a committee of nodes (such as a DON) to achieve various forms of Sybil-resistance while protecting privacy. Users can register identities and provide evidence of their uniqueness without disclosing the identities themselves. Sybil-resistant credentials offer a possible approach to enriching transaction-ordering policies in a way that would limit opportunities for flooding attacks. For example, a token sale might permit only one transaction per registered user, where registration requires a proof of uniqueness of a national identifier, such as a Social Security Number. Such an approach isn’t foolproof, but may prove a useful policy to mitigate transactionflooding attacks.

公平测序服务

我们期望 DONs 将提供一项利用其网络、计算和存储功能的重要服务,称为公平排序服务 (FSS)。 尽管 FSS 可能被简单地视为在 DON 框架内实现的应用程序,但我们强调它是一项我们相信在各个领域都有很高需求的服务。 blockchains,我们希望 Chainlink 网络积极支持。 当在公共 blockchain 网络上执行时,当今的许多 DeFi 应用程序 揭示可以被用户利用以谋取自身利益的信息,类似于 现有的内幕泄密和操纵机会普遍存在 市场 [64, 155]。相反,FSS 为公平的 DeFi 生态系统铺平了道路。 FSS 帮助开发人员构建免受市场操纵的DeFi合约 因信息泄露而造成的。鉴于我们在下面强调的问题,FSS 是 对于第 2 层服务特别有吸引力,并且适合此类服务的框架 我们将在第 6 节中讨论。 挑战: 在现有的无需许可的系统中,交易是完全有序的 由矿工自行决定。在许可网络中,validator 节点可能会施加 相同的力量。这是一种在很大程度上未被认识到的短暂集中化形式。 否则分散的系统。矿工可以(暂时)审查其交易 自己的利益[171]或重新排序以最大化自己的收益,这一概念称为可开采价值(MEV)[90]。 MEV 这个术语有一点欺骗性:它并不指代 只考虑矿工可以捕获的价值:一些MEV可以被普通用户捕获。 然而,由于矿工比普通用户拥有更多的权力,MEV 代表了任何实体通过对抗性重新排序可以获得的价值上限 和补充交易插入。即使矿工简单地下令交易 基于费用(gas),无需操纵,用户自己可以操纵gas价格 使他们的交易比那些不太复杂的交易更有优势。 戴安等人。 [90] 记录并量化机器人(而非矿工)采取的方式 利用气体动力学的方式损害当今 DeFi 系统的用户以及如何 MEV 甚至威胁到 blockchain 中底层共识层的稳定性。 交易订单操纵的其他例子也经常出现,例如[50, 154]。新的事务处理方法(例如 rollups)是一种非常有前途的方法 解决高吞吐量 blockchains 的扩展问题。然而,他们并没有解决 MEV的问题。相反,他们将其转移到生成 rollup 的实体。那 实体,无论是 smart contract 的操作员还是提供 (zk-)rollup 的用户 有效性证明,有权订购和插入交易。换句话说,rollups 将 MEV 替换为 REV:汇总可提取值。 MEV 影响即将提交到内存池的交易 但尚未在链上承诺。有关此类交易的信息广泛 在网络中可用。矿工、validators和普通网络参与者可以 因此,利用这些知识并创建相关交易。此外,矿工和 validators 可能会影响他们提交的交易的顺序 并利用这一点为自己谋利。 领导者对共识交易排序施加不当影响的问题 自 20 世纪 90 年代以来,协议在文献中就已为人所知 [71, 190],但还没有令人满意的 到目前为止,解决方案已在实践中实现[97]。 主要原因是所提出的解决方案(至少直到最近)无法轻易地与公众整合 blockchains,因为它们依赖于交易内容在之后仍然保密 他们的顺序已经确定。 公平测序服务 (FSS) 概述: DONs 将提供去中心化交易排序的工具,并根据依赖项指定的策略来实施它 合同创建者,理想情况下是公平的,而不是让那些希望这样做的参与者受益 操纵交易顺序。这些工具共同构成了 FSS。 FSS 包括三个组成部分。首先是交易监控。在FSS中, O 中的 oracle 节点都监视 MAINCHAIN 的内存池并(如果需要)允许 通过专门的渠道在链下提交交易。二是交易顺序。依赖合约的 O 订单交易中的节点 根据为该合同定义的策略。第三是交易记录。 交易排序后,O中的节点共同将交易发送到 主链。 FSS 的潜在好处包括: • 订单公平性:FSS 包含帮助开发人员确保交易的工具 对特定合同的输入以不会产生不公平的方式排序 对于资源丰富和/或技术精湛的用户来说是有优势的。订购政策 可以为此目的指定网络。 • 减少或消除信息泄漏:通过确保网络参与者无法利用有关即将进行的交易的知识,FSS 可以减少或消除信息泄漏。 消除基于现有信息的抢先交易等攻击 提交交易之前的网络。防止利用此类 泄漏确保依赖于原始未决的对抗性交易 在原始交易提交之前,交易无法进入账本。• 降低交易成本:消除玩家对提交速度的要求 他们的交易为smart contract,FSS可以大大降低交易处理的成本。 • 优先排序:FSS 可以自动给予关键事务特殊优先级 订购。例如,为了防止针对 oracle 的抢先交易攻击 报告,例如 [79],FSS 可以将 oracle 报告插入交易流中 追溯性地。 FSS 在 DON 中的首要目标是帮助 DeFi 创作者实现公平 金融系统,即不利于特定用户(或矿工)的系统 基于速度、内部知识或执行技术的能力优于其他人 操纵。虽然公平的明确、普遍的概念是难以捉摸的,但完美的公平在 任何合理的感觉都是无法实现的,FSS旨在为开发者提供强大的 一套工具,以便他们能够执行有助于实现 DeFi 设计目标的策略。 我们注意到,虽然 FSS 的主要目标是充当公平排序服务 DON 的目标主链,某些与 FSS 相同的公平性需求 保证也适用于在其中运行的(去中心化)协议 DON 派对。因此,FSS 可以更广泛地视为由子集提供的服务 DON 节点不仅可以对主链用户发送的交易进行公平排序 还包括其他 DON 节点之间共享的事务(即消息)。在本节中, 我们将主要关注对主链交易进行排序的目标。 章节组织:在第 5.1 节中,我们描述了推动 FSS 设计的两个高级应用程序:防止 oracle 报告的抢先交易和防止 用户交易的抢先交易。然后我们提供有关 FSS 设计的更多细节 在第 5.2 节中。第 5.3 节描述了公平排序保证和手段的示例 来实现它们。最后,第 5.4 节和第 5.5 节讨论了网络级威胁 分别针对网络洪水和女巫攻击的此类政策和解决方法 攻击。 5.1 抢先交易问题 为了解释 FSS 的目标和设计,我们描述了两种常见的抢先交易形式 攻击和现有解决方案的局限性。 抢先交易是一个类的例子 交易排序攻击:有许多相关的攻击,例如我们没有涵盖的反向运行和夹心(前端运行加反向运行)[237] 在这里,但 FSS 也可以帮助解决这个问题。 5.1.1 Oracle抢先交易 oracles 的传统角色是向 blockchain 应用程序提供链下数据 成为抢先交易攻击的天然目标。考虑使用 oracle 提供各种价格源的常见设计模式 到链上交易所:oracle 定期(例如每小时)收集价格数据 不同的资产并将它们发送到交换合约。这些价格数据交易 呈现明显的套利机会:例如,如果最新的 oracle 报告列出 某些资产的价格要高得多,对手可能会抢先发送 oracle 报告给 购买资产并在 oracle 的报告处理完毕后立即转售。 减速带和追溯定价: oracle 抢先交易问题的自然解决方案是给予 oracle 报告高于其他交易的特殊优先级。对于 例如,可以以高额费用发送 oracle 报告,以鼓励矿工处理 首先是他们。但如果套利机会很高,这并不能阻止抢先交易, 也无法阻止矿工自己套利。 因此,一些交易所采取了更重量级的“减速带”,例如在处理之前将用户交易排队等待多个区块 或在新的 oracle 报告到达时追溯调整价格。这些解决方案的缺点是它们增加了交换实现的复杂性, 增加存储需求,从而增加交易成本,并破坏用户体验,因为资产交换只有在相当长的一段时间后才会得到确认。 捎带: 在继续讨论 FSS 之前,我们先讨论搭载,这是一种非常简单且 oracle 抢先交易问题的优雅解决方案。不适用于地址 然而,在其他情况下却是抢先交易。 简而言之,不是定期向链上合约发送报告,而是 oracles 发布用户在购买或出售时附加到其交易中的签名报告 链上资产。然后交易所只需检查报告是否有效且最新 (例如,oracle 可以签署报告有效的一系列区块),并提取 从中获取相关价格。 与上述“减速带”相比,这种简单的方法具有许多优点 方法:(1)交易合约不需要保存喂价状态,这应该 导致交易成本降低; (2) 由于 oracle 报告是根据需要发布到链上的,因此 oracle 可以生成更频繁的更新(例如每分钟),从而 最大限度地减少抢先报告带来的套利机会9; (3)交易可以 立即得到验证,因为它们始终包含新鲜的价格信息。 然而,这种方法并不完美。首先,这个搭载解决方案将 交易所用户有责任获取最新的 oracle 报告并将其附加到他们的 交易。其次,虽然捎带交易最大限度地减少了套利机会,但它不能 在不影响链上合约活跃性的情况下完全防止它们。确实,如果一个 oracle 报告在某个区块号 n 之前有效,然后将交易提交到区块 n + 1 将需要新的有效报告。由于传播的固有延迟 从 oracles 向用户报告,对块 n + 1 有效的新报告将具有 9只有当资产价格的可利用差异超过无关的资产价格差异时,套利才有价值。 买卖资产所需的费用,例如矿工和交易所收取的费用。在区块 n + 1 被开采之前的某个时期(例如在区块 n −k 处)公布,从而 创建一个包含 k 个区块的序列,其中存在短暂的套利机会。我们 现在描述 FSS 如何克服这些限制。 通过 FSS 对 oracle 报告进行优先级排序: FSS 可以解决 oracle 抢先交易问题 通过构建上述捎带解决方案来解决问题,但推动额外的 使用 oracle 向去中心化预言机网络报告增强交易的工作。 在较高层面上,oracle 节点收集用于链上交换的交易, 就实时价格反馈达成一致,并将价格反馈连同收集的交易一起发布到主链合约中。从概念上讲,人们可以将这种方法视为一种 “数据增强事务批处理”,其中 oracle 确保最新的 喂价总是添加到交易中。 FSS 解决方案可以对交易所用户透明地实施,并且 正如我们在第 5.2 节中更详细描述的那样,对合约逻辑的更改最小。确保 新的 oracle 报告始终优先于用户交易只是一个例子 FSS 可以采用和执行的订购政策。社会保障基金秩序保障政策 第 5.3 节更概括地描述了公平性。 5.1.2 抢先交易的用户交易 我们现在转向通用应用程序中的抢先交易,其中上述防御方法 不起作用。可以通过以下场景概括地捕获该问题: 对手看到一些用户交易 tx1 发送到 P2P 网络并注入 它自己的对抗性交易 tx2,以便 tx2 在 tx1 之前被处理(例如,通过支付 更高的交易费用)。例如,这种抢先交易在 利用 DeFi 系统 [90] 中的套利机会的机器人,并影响了 各种去中心化应用程序[101]。建立公平的交易秩序 在 blockchain 上处理可以解决此问题。 更根本的是,有时甚至没有必要查看 tx1 的详细信息,并且 仅仅知道 tx1 的存在就可能让对手通过其抢先交易 tx1 拥有 tx2 并欺骗创建 tx1 的无辜用户。例如,用户可能 众所周知会定期交易特定资产。防止此类攻击需要 还可以避免元数据泄漏的缓解措施[62]。这个问题的一些解决方案 存在,但它们会带来延迟和可用性问题。 通过 FSS 从网络订单到最终订单: 抢先交易的机会 出现的原因是现有系统没有机制来确保执行的顺序 链上出现的交易尊重事件顺序和信息流 网络之外。这代表了由于在 blockchain 上实施应用程序(例如交易平台)的缺陷而产生的问题。理想情况下,人们会 确保事务按照原来的顺序在 blockchain 上提交 创建并发送到 blockchain 的 P2P 网络。但自从 blockchain 网络

Fair Sequencing Services general schematic showing transaction flow from users through DON to main chain

是分布式的,无法捕获这样的订单。 FSS因此引入了机制 防止违反公平性,而这种违反公平性只是因为分布式 blockchain 网络的性质。 5.2 社会保障计划详情 图 12: 具有两种不同交易路径的订单公平内存池: 直接和 基于内存池。 图 12 显示了 FSS 的总体示意图。为了确保公平,提供 FSS 的 DON 必须干扰进入主链的交易流程。 可能需要对客户端、主链上的 smart contracts 或两者进行调整。在较高的层面上,FSS 的交易处理可以分解为三个部分 阶段,描述如下: (1) 交易监控; (2) 交易排序;和 (3) 交易过帐。根据用于事务排序的排序方法,需要额外的协议步骤,如下一节所述。 5.2.1 交易处理 交易监控: 我们设想 FSS 监控采用两种不同的方法 发往特定 smart contract 的用户交易,直接且基于内存池: • 直接:直接方法在概念上是最简单的,但需要进行更改 用户客户端,以便交易直接发送到去中心化预言机网络节点,而不是主链的节点。 DON 收集 用户交易发往特定的 smart contract SC,并根据 关于某些订购政策。然后 DON 将有序交易发送到 主链上的smart contract。一些排序机制还需要直接方法,因为创建交易的用户必须以加密方式 在将其发送到 FSS 之前对其进行保护。 • 基于内存池:为了促进 FSS 与旧客户端的集成,DON 可以使用Mempool Services(MS)来监控主链的mempool并收集 交易。 直接传输可能是许多合同的首选实施方式, 我们相信它在许多情况下应该相当实用。 我们简要讨论如何对现有的 DApp 进行最小程度的修改以支持 直接传输,同时保持良好的用户体验。我们描述方法 使用 Ethereum 和 MetaMask [6] 因为这些是当今最流行的选择,但是 上述技术应该扩展到其他链和钱包。最近的 Ethereum 改进提案,“EIP-3085:钱包添加Ethereum链RPC方法”[100], 将可以轻松定位自定义 Ethereum 链(使用与 MAINCHAIN 的(以防止来自 MetaMask 和其他基于浏览器的钱包的重放攻击)。实施此提案后,一个 DApp 寻求使用 DON 只需向其前端添加一个方法调用即可直接传输 交易到任何暴露 Ethereum 兼容 API 的 DON 。与此同时, “EIP-712:Ethereum 类型化结构化数据 hash 处理和签名” [49] 提供了一个稍微 涉及更多但已经广泛部署的替代方案,DApp 用户可以使用 MetaMask 用于签署指定 DON 交易的结构化数据。 DApp可以发送 此签名的结构化数据到 DON。 最后,我们注意到混合方法也是可能的。 例如,遗产 客户可以继续将交易发送到主链的内存池中,但至关重要 交易(例如 oracle 报告)直接发送到 DON 节点(特别是 提供 oracle 报告(例如喂价更新)的节点集和节点集 提供的 FSS 可能重叠或相同)。 交易排序: FSS 的主要目的是保证用户交易按照预先定义的策略进行排序。这项政策的性质将 取决于应用程序的需求以及它所处理的不公平交易订单的类型 旨在预防。 由于 DON 上的 FSS 能够处理数据并维护本地状态, 他们可能会根据所提供的信息强加任意排序策略 可在 oracles 处购买。 特定的排序策略及其实现将在随后的 5.3 节中讨论。交易过账: 在收集并排序用户交易(直接从用户接收或从内存池收集)后,DON 将这些交易发送到主链。因此,DON 与主链的交互仍然存在 受主链矿工管辖的(可能不公平的)交易排序。为了利用去中心化交易排序的好处,目标智能 因此,合同 SC 的设计必须将 DON 视为“一等”公民。我们 区分两种方法: • DON-only 合约:最简单的设计选项是让主链变得智能 合约SC仅接受已由DON处理的交易。这个 确保 smart contract 按照建议的顺序处理交易 DON,但事实上限制 smart contract 在基于委员会的系统中运行(即 DON 委员会现在拥有持续的权力来确定 交易的排序和包含)。 • 双级合约:首选、更细粒度的设计,主链智能 合约 SC 接受源自 DON 和遗留系统的交易 用户,10 但对 DON 未处理的交易设置了传统的“减速带”。例如,可以处理来自 DON 的交易 立即,而遗留事务则由 smart contract “缓冲” 一段固定的时间。其他防止抢先交易的标准机制 例如提交-显示方案或 VDF [53] 也可以应用于遗留 交易。这确保了 DON 有序的交易确实得到处理 同意该命令,但没有赋予 DON 不必要的审查权力 交易。 由于 FSS 强加的交易排序要求交易在“链外”聚合,因此该解决方案自然地与其他旨在降低链上处理成本的聚合技术相结合。例如,收集后 对交易进行排序后,DON 可以将这些交易作为 单个“批量交易”(例如 rollup),从而减少总交易 费。 执行交易指令: 无论是仅 DON 还是双级设计, 主链smart contract SC和DON必须共同设计,以保证DON的交易顺序得到维护。在这里,我们也设想了不同的 设计选项: • 序列号:DON 可以为每笔交易附加一个序列号,并将这些交易发送到主链的内存池中。 主要 10如果 DON 的交易监控基于内存池,则遗留交易必须与 DON 交易区分开来,以便它们不会被 DON 收集,例如通过特殊标签 嵌入交易中或通过指定特定的 Gas 价格,例如DON 交易有gas 价格低于一定阈值。链 smart contract SC 忽略“无序”到达的交易。我们 请注意,在这种设置中,主链矿工可以决定忽略 DON 的 交易排序,从而导致交易失败。通过保持 SC 的(昂贵的)状态来强制执行正确的交易排序是可能的,某种程度上 类似于 TCP 如何缓冲无序数据包直到丢失的数据包被删除 收到。 • 事务nonces:对于许多blockchain,特别是Ethereum, 上述序列编号方法可以利用内置事务 nonces 来 强制主链smart contract SC按顺序处理交易。 在这里,DON 节点通过单个主链帐户将交易发送到主链,并受到 DON 节点之间共享的密钥的保护。该帐户的 交易 nonce 确保交易以正确的顺序进行挖掘和处理。 • 聚合交易:DON 可以聚合rollup 中的多个交易。 (或类似于 rollup 的捆绑包)。主链 smart contract 需要 旨在处理此类聚合交易。 • 使用主链代理聚合交易:这里,DON 类似地将交易捆绑到主链的一个“元交易”中,但依赖于 自定义代理 smart contract 来解压交易并将其转发到 目标合同 SC。该技术对于遗留兼容性很有用。元交易的行为类似于 rollup,但不同之处在于它们由未压缩的 一次发布到主链的交易列表。 最后一种设计的优点是无缝支持用户交易 在达到 DON 的目标之前,它们本身通过主链合约进行代理 合同 SC。例如,考虑将交易发送到某个钱包的用户 合约,该合约又向 SC 发送内部交易。分配序列 此类交易的编号会很棘手,除非用户的钱包合约是 专门设计用于将每笔内部交易的序列号转发至 SC。 同样,此类内部交易也无法轻松聚合成直接发送到 SC 的元交易。我们讨论进一步的设计考虑 以下此类代理交易。 5.2.2 事务原子性 到目前为止,我们的讨论隐含地假设交易与单个交易交互 链上 smart contract (例如,用户向交易所发送购买请求)。然而,在 在 Ethereum 等系统中,单个交易可以由多个内部交易组成,例如,一个 smart contract 调用另一个合约中的函数。下面,我们 描述了两种对“多合约”交易进行排序的高级策略,同时 保留事务的原子性(即,由 交易全部按照正确的顺序执行,或者根本不执行)。强原子性: 最简单的解决方案是将 FSS 直接应用于整个“多合约”交易,如上所述。也就是说,用户发送他们的交易 进入网络,FSS 监控、排序并将这些交易发布到 主链。 这种方法在技术上很简单,但有一个潜在的限制:如果用户 交易与两个合约 SC1 和 SC2 交互,两者都希望公平杠杆 排序服务,那么这两个合约的排序策略必须一致。也就是说,给定两个不同的交易 tx1 和 tx2,每个交易都与之交互 SC1 和 SC2 都不能出现 SC1 的策略先排序 tx1 后排序 tx2 而 SC2 的政策规定了相反的顺序。 对于绝大多数感兴趣的场景,我们预计不同合约采用的排序策略将是一致的。例如,SC1 和 SC2 可能希望交易按照其到达内存池的大概时间进行排序, SC1 可能还希望始终首先交付某些 oracle 报告。作为 后者oracle报告交易不与SC2交互,政策一致。 弱原子性: 就其全面的普遍性而言,FSS 可以应用于个人层面 内部交易。 考虑 tx = { txpre, txSC, txpost} 形式的交易,由一些初始的 交易〜txpre,这会导致内部交易〜txSC到SC,这反过来 发出内部交易〜txpost。 SC 的排序策略可能决定如何 内部交易 ~txSC 必须相对于发送的其他交易进行排序 到 SC,但保留 txpre 和 txpost 的排序顺序。 鉴于 Ethereum 等系统中事务处理的本质,开发针对特定内部事务的排序服务并不简单。通过专门设计的合约 SC,这可以通过以下方式实现: 1. 交易tx被发送到网络并被挖掘(没有任何排序) 由 FSS 执行)。执行初始的 txpre,并调用 txSC。 2. SC不执行~txSC并返回。 3. FSS 监控 SC 的内部事务,对它们进行排序,然后将它们发回 到 SC(即,通过将交易 ~txSC 直接发送到 SC)。 4. SC 处理从 FSS 接收到的交易 txSC,并发出由 txSC 产生的内部交易 txpost。 使用这种方法,事务不会完全原子地执行(即原始的 交易 tx 被分解为多个链上交易),但是 内部交易被保留。 该解决方案存在许多设计限制。例如,~txpre 不能 假设~txSC 和~txpost 将被执行。此外,SC 的设计应使得 代表某个用户执行交易 〜txSC 和 〜txpost,即使它们是由 FSS 发送。由于这些原因,更粗粒度的“强原子性”解决方案 以上在实践中可能是更可取的。 为了尊重更复杂的依赖关系,涉及多个事务和 它们各自的内部事务,FSS的事务调度程序可能包含 类似于关系型事务管理器中的复杂功能 数据库管理器。 5.3 公平交易排序 这里我们讨论交易排序公平性的两个概念以及相应的实现,这可以通过 FSS 来实现: 基于策略的顺序公平性 FSS 和安全因果关系保存强加的,这需要在 FSS 中使用额外的加密方法。 订单公平性: 顺序公平是共识协议中时间公平的概念 这首先是由 Kelkar 等人正式提出的。 [144]。 凯尔卡等人。旨在实现一种自然政策形式,其中交易是 根据 DON (或 P2P 网络, 对于基于内存池的 FSS)。然而,在去中心化系统中, 节点可能会看到事务以不同的顺序到达。 建立总订单 所有交易的问题正是底层共识协议所解决的问题 主链。 凯尔卡等人。 [144] 因此引入一个较弱的概念,可以 在去中心化预言机网络的帮助下实现,称为“区块订单公平性”。 它将 DON 在某个时间间隔内收到的交易分组为 “块”并同时在同一位置插入该块的所有交易 (即高度)进入主链。因此它们被排序在一起并且必须是可执行的 并行进行,而不会在它们之间造成任何冲突。 粗略地说,顺序公平性表明,如果大部分节点在 τ2 之前看到事务 τ1,那么 τ1 将在 τ2 之前或在同一块中排序。通过施加如此粗略的 交易订单的粒度,抢先交易和其他与订单相关的攻击的机会大大减少。 凯尔卡等人。提出一系列名为 Aequitas [144] 的协议,该协议解决了 不同的部署模型,包括同步、部分同步和异步网络设置。相对于基本的 BFT 共识,Aequitas 协议会带来大量的通信开销,因此对于实际使用来说并不理想。 然而,我们相信 Aequitas 的实用变体将会出现,可以使用 用于 FSS 和其他应用程序中的事务排序。一些相关方案有 已经提出了较少伴随的形式主义和较弱的性质, 例如,[36,151,236],但实际性能更好。这些方案都可以支持 在 FSS 中也是如此。 还值得注意的是,术语“公平”出现在 blockchain 的其他地方 具有不同含义的文学,即机会意义上的公平矿工与其承诺资源成正比 [106, 181] 或 validators 平等机会[153]。 安全因果关系保存: 防止分布式平台中的抢先交易和其他顺序违规的最广为人知的方法依赖于加密技术 技术。它们的共同特点是隐藏交易数据本身,等到 共识层秩序已建立,交易数据公开 稍后进行处理。这保留了交易之间的因果顺序 由 blockchain 执行。相关安全概念和密码协议 在 blockchains [71, 190] 出现之前已经得到了很大的发展。 “输入因果关系”[190] 和“安全因果关系保存”[71, 97] 的安全条件正式要求不知道任何有关交易的信息 在该交易在全球秩序中的位置尚未确定之前。在此之前,对手必须无法以加密方式推断出任何信息 强烈的感觉。 人们可以区分四种加密技术来保持因果关系: • 提交-显示协议 [29, 142, 145]:而不是宣布交易 明确地说,只有对交易的加密承诺才会被广播。在所有已提交但隐藏的事务已排序之后(在 blockchain 早期) MAINCHAIN 本身的系统,但这里是 FSS),发送者必须在预定的时间间隔内公开承诺并披露交易数据。 然后网络验证开放是否满足先前的承诺。的 此方法的起源可以追溯到 blockchains 出现之前。 虽然它特别简单,但该方法存在相当大的缺点,并且由于两个原因不容易采用。首先,由于在排序协议层面仅存在承诺,因此交易的语义 在达成共识期间无法验证。与客户的额外往返 是必需的。然而,更严重的是,权衡了没有开口可能会发生的可能性。 到达,这可能相当于拒绝服务攻击。此外,它 很难确定开局在一致的、分布式的情况下是否有效 方式,因为所有参与者必须就空缺是否到达达成一致 时间。 • 延迟恢复的提交-显示协议[145]:一项挑战 提交-显示方法是,客户端可以推测性地提交交易,并在后续交易使其有利可图时才显示它。一个 提交-显示方法的最新变体提高了对此的恢复能力 一种不当行为。特别是,TEX 协议 [145] 解决了这个问题 使用一种巧妙的方法,其中加密交易包含解密密钥 可以通过计算可验证的延迟函数(VDF)获得[53, 221]。如果一个客户 未能及时解密她的交易,系统中的其他人将解密 通过解决一个中等难度的密码难题来代表她。• 阈值加密 [71, 190]:该方法利用 DON 可以执行 阈值加密操作。假设 FSS 维护一个加密公共 key pkO 和 oracle 在它们之间共享相应的私钥。 然后,客户端在 pkO 下加密交易并将其发送到 FSS。社会保障基金订单 DON 上的交易,然后解密它们,最后将它们注入到 主链按固定顺序排列。因此,加密可确保排序 不是基于交易内容,而是数据本身在以下情况下可用: 需要。 该方法最初由 Reiter 和 Birman [190] 提出,后来由 Cachin 等人改进。 [71],它与许可共识相结合 协议。最近的工作探索了使用阈值密码学作为 用于通用消息 [33, 97] 和共享数据 [41] 的一般计算的共识级别机制。 与提交-显示协议相比,阈值加密可以防止简单的拒绝服务攻击(尽管考虑到解密的计算成本,需要小心)。它让 DON 以自己的速度自主前进,无需 等待客户的进一步行动。交易在解密后可以立即得到验证。此外,客户用一个加密所有交易 DON 的密钥,通信模式与其他相同 交易。安全地管理阈值密钥并更改节点 然而,O 可能会带来额外的困难。 • 承诺秘密共享[97]:而不是加密下的交易数据 DON 持有的密钥,客户端也可以为 O 中的节点秘密共享它。 使用混合的、计算安全的秘密共享方案,交易 首先使用带有随机密钥的对称密码进行加密。仅共享相应的对称密钥,并将密文提交给DON。 客户端必须使用单独加密的消息向 O 中的每个节点发送一个密钥共享。其余协议步骤与阈值相同 加密,只不过交易数据采用对称解密 从其份额重建每笔交易密钥后的算法。 此方法不需要设置或管理公钥密码系统 与 DON 相关。但是,客户端必须了解其中的节点 O 并在安全的环境中与每个人进行交流,这使得 给客户带来额外的负担。 尽管加密方法提供了针对信息的完整保护 从提交的交易泄漏到网络,它们不隐藏元数据。对于 例如,发件人的 IP 地址或 Ethereum 地址仍可被使用 进行抢先交易和其他攻击的对手。各种隐私增强 部署在网络层的技术,例如[52,95,107],或事务层, 例如,[13, 65],需要实现这一目标。特定作品的影响 元数据的数量,即交易发送到哪个合约,可以(部分)隐藏通过在同一个 DON 上复用许多合约。密码隐藏 交易本身也不能阻止损坏的交易的优先级 DON 节点与交易发送者勾结。 加密协议保证的安全因果关系补充了任何策略的秩序公平性保证,我们打算探索两者的结合 方法,如果可能的话。如果对手无法从中获得显着优势 观察元数据,安全的因果关系保存协议可以与 也是一种简单的订购方法。例如oracle节点可以写入交易 他们收到后立即发送给 L,不得重复。那么交易将是 根据他们在L上的出现进行排序并随后解密。 我们还计划考虑使用 TEE 作为帮助执行公平排序的一种方式;为了 例如,Tesseract [44] 可能被视为实现了一种因果排序形式,但一个 TEE 以显式形式处理交易的能力得到了加强,同时 保留他们的机密。 5.4 网络层注意事项 到目前为止,我们对 FSS 的描述主要集中在强制执行 FSS 的问题上。 最终的交易顺序与其在网络中观察到的顺序相匹配。此后, 我们考虑网络层本身可能出现的公平问题。 传统电子市场的高频交易者投入大量资金 资源以获得卓越的网络速度[64],加密货币交易所的交易者表现出类似的行为[90]。网络速度在以下方面都具有优势 观察其他方的交易并提交竞争交易。 实践中采用并在 Flash Boys [155] 一书中普及的一种补救措施是 最初在 IEX 交易所 [128] 中引入的“减速带”,后来在其他交易所中引入 交换 [179] (结果混合 [19])。该机制对市场准入施加了延迟(IEX 为 350 微秒),目的是抵消市场准入的优势。 速度。经验证据,例如[128],支持其减少某些交易的功效 普通投资者的成本。 FSS 可以简单地用于实现非对称 减速带——延迟传入交易的减速带。 Budish、Cramton 和 Shim [64] 认为,利用速度优势 在连续时间市场中是不可避免的,并主张在市场中采取结构性补救措施 以批量拍卖为基础的市场形式。但这种方法并未得到广泛采用 在现有的交易平台上。 传统的交易系统是中心化的,通常通过以下方式接收交易: 单个网络连接。相比之下,在去中心化系统中,可以 从多个有利位置观察交易传播。因此,可以观察到 P2P 网络中的网络泛洪等行为。 我们打算 探索 FSS 的网络层方法,帮助开发人员指定策略 禁止此类不良网络行为。5.5 实体级公平政策 秩序公平和安全因果关系旨在对以下交易执行排序: 尊重它们创建和首次提交到网络的时间。这种公平概念的局限性在于,它不能防止对手发起攻击 通过向系统注入大量交易来获得优势,观察到的策略 作为在 token 销售 [159] 中执行有效交易狙击的一种方式,并 造成拥堵,导致债务抵押头寸 (CDP) [48] 清算。 换句话说,秩序公平强制的是交易的公平,而不是玩家的公平。 如CanDID系统[160]所示,可以使用oracle工具,例如DECO 或 Town Crier 与节点委员会(例如 DON)结合以实现 各种形式的女巫抵抗,同时保护隐私。用户可以注册身份 并在不透露身份本身的情况下提供其独特性的证据。 抗女巫凭证提供了一种丰富交易排序的可能方法 限制洪水攻击机会的政策。例如,一个 token 销售可能只允许每个注册用户进行一笔交易,其中注册 需要国家标识符的唯一性证明,例如社会安全号码。 这种方法并非万无一失,但可能被证明是减轻交易泛滥攻击的有用策略。

The DON Transaction-Execution Framework

The DON Transaction-Execution Framework

(DON-TEF) DONs will provide oracle and decentralized-resource support for layer-2 solutions within what we call the Decentralized Oracle Network Transaction-Execution Framework (DONTEF) or TEF for short. Today, the frequency of updates to DeFi contracts is limited by main chain latencies, e.g., the 10-15 second average block interval in Ethereum [104]—as well as the cost of pushing large amounts of data on chain and limited computational/tx throughput— motivating scaling approaches such as sharding [148, 158, 232] and layer-2 execution [5, 12, 121, 141, 169, 186, 187]. Even blockchains with much faster transaction times, e.g., [120], have proposed scaling strategies that involve off-chain computation [168]. TEF is meant to act as a layer-2 resource for any such layer-1 / MAINCHAIN systems. Using TEF, DONs can support faster updates in a MAINCHAIN contract while retaining the key trust assurances provided by the main chain. TEF can support any of a number of layer-2 execution techniques and paradigms, including rollups,11 optimistic rollups, Validium, etc., as well as a threshold trust model in which DON nodes execute transactions. The TEF is complementary to FSS and intended to support it. In other words, any application running in the TEF can use FSS. 11Often called “zk-rollups,” a misnomer, as they do not necessarily need zero-knowledge proofs.

6.1 TEF Overview The TEF is a design pattern for the construction and execution of a performant hybrid smart contract SC. In accordance with the main idea behind hybrid smart contracts, TEF involves a decomposition of SC into two pieces: (1) What we call in the TEF context an anchor contract SCa on MAINCHAIN and (2) DON logic exect that we call the TEF executable. We use SC here to denote the logical contract implemented by the combination of SCa and exect. (As noted above, we expect to develop compiler tools to decompose a contract SC automatically into these components.) The TEF executable exect is the engine that processes users’ transactions in SC. It can execute in a performant way, as it runs on the DON. It has several functions: • Transaction ingestion: exect receives or fetches users’ transactions. It can do so directly, i.e., through transaction submission on the DON, or via the MAINCHAIN mempool using MS. • Fast transaction execution: exect processes transactions involving assets within SC. It does so locally, i.e., on the DON. • Fast and low-cost oracle / adapter access: exect has native access to oracle reports and other adapter data leading to, e.g., faster, cheaper, and more accurate asset pricing than MAINCHAIN execution. Moreover, off-chain oracle access reduces the oracle’s operational cost, hence the cost of using the system, by avoiding expensive on-chain storage. • Syncing: exect periodically pushes updates from DON onto MAINCHAIN, updating SCa. The anchor contract is the MAINCHAIN front end of SC. As the higher-trust component of SC, it serves several purposes: • Asset custody: Users’ funds are deposited into, held in, and withdrawn from SCa. • Syncing verification: SCa may verify the correctness of state updates when exect syncs, e.g., SNARKs attached to rollups. • Guard rails: SCa may include provisions to protect against corruption or failures in exect. (See Section 7 for more details.) In TEF, users’ funds are custodied on MAINCHAIN, meaning the DON is itself noncustodial. Depending on the choice of syncing mechanism (see below), users may need to trust the DON only for accurate oracle reports and timely syncing with MAINCHAIN. The resulting trust model is very similar to that for order-book-based DEXes, e.g., [2], which today generally include an off-chain component for order matching and an onchain component for clearing and settlement.

Transaction Execution Framework schematic showing mempool, clearing, and settlement flow

To use the vocabulary of payment systems, one may think of exect as the component of SC responsible for clearing, while SCa handles settlement. See Fig. 13 for a schematic depiction of TEF. Figure 13: TEF schematic. In this example, transactions pass through the mempool of MAINCHAIN via MS to the DON. TEF benefits: TEF carries three main benefits: • High performance: SC inherits the DON’s much higher throughput than MAINCHAIN for both transactions and oracle reports. Additionally, exect can process transactions faster and respond to oracle reports in a more timely way than an implementation on MAINCHAIN alone. • Lower fees: The process of syncing is less time-sensitive than transaction processing, and transactions can be sent from the DON to MAINCHAIN in batches. Consequently, the per-transaction on-chain fees (e.g., gas costs) with this approach are much lower than for a contract that runs only on MAINCHAIN. • Confidentiality: The confidentiality mechanisms of the DON can be brought to bear on SC.

TEF limitations: One limitation of TEF is that it does not support instantaneous withdrawals, as they occur only on MAINCHAIN: Upon sending a withdrawal request to SCa, a user may need to wait for exect to perform a state update that includes the withdrawal transaction before it can be approved. We discuss some partial remedies, however, in Section 6.2. Another limitation of TEF is that it does not support atomic composition of DeFi contracts on MAINCHAIN, specifically the ability to route assets through multiple DeFi contracts in a single transaction. TEF can, however, support such atomicity among DeFi contracts running on the same DON. We also discuss some ways to address this problem in Section 6.2. 6.2 Transaction Routing Transactions for SC can be sent by users directly to the DON or can be routed through the mempool in MAINCHAIN (via FSS). There are four distinct transaction types, each of which requires different handling: Within-contract transactions: Because it sidesteps the complications of gas dynamics, TEF provides SC more flexibility in its handling of transactions than would be available in a layer-1 contract. For example, while a mempool transaction in Ethereum can be overwritten by a fresh transaction with a higher gas price, SC can treat a transaction that operates on assets within SC as authoritative as soon as it becomes visible in the mempool. Consequently, SC need not wait for a transaction to be confirmed within a block, resulting in considerably reduced latency. Proxying: A user may wish to send a transaction \(\tau\) to SC via a wallet contract or other contract on MAINCHAIN. It is possible for the DON to simulate execution of \(\tau\) on MAINCHAIN to determine whether it results in a follow-on transaction to SC. If so, \(\tau\) can be sequenced with other transactions for SC that do. There are a few possibilities for how the DON identifies such transactions: (1) The DON can simulate all transactions in the mempool (an expensive approach); (2) Certain contracts or contract types, e.g., wallets, can be listed for monitoring by the DON; or (3) Users can annotate transactions for DON inspection. Matters become more complicated when a single transaction interacts with two contracts, SC1 and SC2, both of which use Fair Sequencing Services and have incompatible ordering policies. The DON might, for example, sequence \(\tau\) at the latest time that is compatible with both. Deposits: A transaction depositing a MAINCHAIN asset into SC needs to be confirmed in a block before SC can treat it as valid. When it detects the mining of a transaction that sends assets (e.g., Ether) into SCa, exect can instantly confirm the

deposit. For example, it can apply a current oracle-reported price on the DON to the asset. Withdrawals: As noted above, a limitation of TEF is that withdrawals cannot always be executed instantaneously. In a rollup-type execution model, the withdrawal request must be sequenced with other transactions, i.e., rolled up, in order to be safely processed. There are, however, some partial remedies to this limitation. If the DON can quickly compute a rollup validity proof up to the withdrawal transaction, then observing a user's transaction \(\tau\) in the mempool exect can send a stateupdate transaction \(\tau'\) for \(\tau\) at a higher gas price, a kind of beneficial front-running. Provided that \(\tau\) isn't mined before \(\tau'\) reaches the mempool, \(\tau'\) will precede \(\tau\), and \(\tau\) will effect an approved withdrawal. In a TEF variant where the DON is relied upon to compute state updates (see the threshold signing variant below), the DON can alternatively determine off-chain whether \(\tau\) ought to be approved given the state of SC upon its execution. The DON can then send a transaction \(\tau'\) that approves withdrawal \(\tau\)—without effecting a full state update. If this approach isn’t possible, or in cases where it doesn’t succeed, a DON-initiated transaction \(\tau'\) can send funds to the user in response to \(\tau\) so that the user need not initiate an additional transaction. 6.3 Syncing The TEF executable exect periodically pushes updates from DON to MAINCHAIN, updating the state of SCa in a process we refer to as syncing. Syncing may be thought of as propagation of layer-2 transactions to layer-1, so TEF can draw on any of a number of existing techniques for this purpose, including rollups [5, 12, 16, 69], optimistic rollups [10, 11, 141], Validium [201], or basic threshold signing, e.g., threshold BLS, Schnorr, or ECDSA [24, 54, 116, 202]. In principle, trusted execution environments can also attest to the correctness of state changes, offering a much more performant alternative to rollups, but with a hardware-dependent trust model. (See, e.g., [80].) Below we compare these syncing options with respect to three key properties in TEF: • Data availability: Where is the state of SC stored? At least three options are available in TEF: on the MAINCHAIN, on a DON, or by some third-party storage providers such as IPFS. They achieve different security guarantees, availability levels, and performance profiles. Briefly, storing state on the MAINCHAIN enables on-chain auditability and eliminates reliance on any party for state availability; on the other hand, storing state off-chain can reduce storage cost and improve throughput, at the cost of trusting storage providers (DON or third parties) for data availability. Of course, flexible models that combine these options are also possible. We indicate the required form of data availability in Table 1.

• Correctness guarantees: How does SCa ascertain the correctness of the updates pushed by exect? This affects the computational load on exect and SCa and the syncing latency (see below). • Latency: Syncing latency has three contributing factors: (1) The time taken for exect to generate a syncing transaction \(\tau_{\text{sync}}\); (2) The time taken for \(\tau_{\text{sync}}\) to be confirmed on MAINCHAIN; and (3) The time for \(\tau_{\text{sync}}\) to take effect on SCa. In TEF, latency is particularly important for withdrawals (but less so for within-contract transactions) because withdrawals necessarily require an (at least partial) state sync. Syncing options Data availability Correctness guarantees Latency Rollup [5, 12, 16, 69] On-chain Validity proofs Time taken to generate validity proofs (e.g., minutes in current systems) Validium [201] Off-chain Validity proofs Same as above Optimistic rollup [10, 11, 141] On-chain Fraud proofs Length of the challenge period (e.g., days or weeks) Threshold signing [24, 54, 116, 202] Flexible Threshold signatures by DON Instantaneous Trusted execution environments [80] Flexible Hardware-based attestations Instantaneous Table 1: Various syncing options in TEF and their properties. Table 1 summarizes these properties in the five main syncing options in TEF. (Note that we do not intend to compare these technologies as standalone layer-2 scaling solutions. For that we refer readers to e.g., [121].) Now we discuss each syncing option. Rollups: A rollup [69] is a protocol in which the state transition effected by a batch of transactions is computed off-chain. The state change is then propagated onto MAINCHAIN. To implement rollups, the anchor smart contract SCa stores a compact representation Rstate (e.g., a Merkle root) of the actual state. To sync, exect sends \(\tau_{\text{sync}}\) = (T, R′ state) to SCa where T is the set of the transactions it processed since the last

sync and R′ state is the compact representation of the new state calculated by applying transactions in T to the previous state Rstate. There are two popular variants that differ in how SCa verifies state updates in \(\tau_{\text{sync}}\). The first, (zk-)rollups, attach a succinct argument of correctness, sometimes called a validity proof, for the transition Rstate →R′ state. To implement this variant, exect computes and submits the validity proof (e.g., a zk-SNARK proof) along with \(\tau_{\text{sync}}\), proving that R′ state is the result of applying T to the current state of SCa. The anchor contract accepts the state update only after it has verified the proof. Optimistic rollups do not include arguments of correctness, but have staking and challenge procedures that facilitate distributed verification of state transitions. For this rollup variant, SCa tentatively accepts \(\tau_{\text{sync}}\) assuming it is correct (hence the optimism) but \(\tau_{\text{sync}}\) does not take effect until after a challenge period, during which any party monitoring MAINCHAIN can identify erroneous state updates and inform SCa to take necessary actions (e.g., to rollback the state and inflict a penalty on exect.) Both rollup variants achieve on-chain data availability, as transactions are posted on-chain, from which the full state can be constructed. The latency of zk-rollups is dominated by the time needed to generate validity proofs, which typically is on the order of minutes in existing systems [16] and will likely see improvements over time. Optimistic rollups, on the other hand, have a higher latency (e.g., days or weeks) because the challenge period needs to be long enough for fraud proofs to work. The implication of slow confirmation is subtle and sometimes specific to the scheme, so that a thorough analysis is out of scope. For instance, certain schemes consider payment transactions as “trustless final” [109] before the state update is confirmed, since a regular user could verify a rollup much more quickly than the MAINCHAIN. Validium: Validium is a form of (zk-)rollup that makes data available off-chain only and does not maintain all data on MAINCHAIN. Specifically, exect sends only the new state and the proof but not transactions to SCa. With Validium-style syncing, exect and the DON that executes it are the only parties that store the complete state and that execute transactions. As with zk-rollups, syncing latency is dominated by validity proof generation time. Unlike zk-rollups, however, Validium style syncing reduces the storage cost and increases the throughput. Threshold signing by DON: Assuming a threshold of DON nodes is honest, a simple and fast syncing option is to have DON nodes collectively sign the new state. This approach can support both on-chain and off-chain data availability. Note that if users trust DON for oracle updates, they do not need to trust it more for accepting state updates, as they are already in a threshold trust model. Another benefit of threshold signing is low latency. Support for new transaction signature formats as proposed in EIP-2938 [70] and known as account abstraction would make threshold signing considerably easier to implement, as it would eliminate the need for threshold ECDSA, which involves considerably more complex protocols (e.g., [116, 117, 118])

than alternatives such as threshold Schnorr [202] or BLS [55] signatures. Trusted Execution Environments (TEEs): TEEs are isolated execution environments (usually realized by hardware) that aim to provide strong security protections for programs running inside. Some TEEs (e.g., Intel SGX [84]) can produce proofs, known as attestations, that an output is correctly computed by a specific program for a particular input12. A TEE-based variant of TEF syncing can be implemented by replacing proofs in (zk-)rollups or Validium with TEE attestations using techniques from [80]. Compared to zero-knowledge proofs used in rollups and Validium, TEEs are much more performant. Compared to threshold signing, TEEs remove the complexity of generating threshold ECDSA signatures as there need in principle be only one TEE involved. Using TEEs does, however, introduce extra hardware-dependent trust assumptions. One can also combine TEEs with threshold signing to create resilience against compromise of a fraction of TEE instances, although this protective measure reintroduces the complexity of generating threshold ECDSA signatures. Additional flexibility: These syncing options can be refined to provide more flexibility in the following ways. • Flexible triggering: TEF application can determine the conditions under which syncing is triggered. For example, syncing can be batch-based, e.g., occur after every N transactions, time-based, e.g., every 10 blocks, or event-based, e.g., occur whenever target asset prices move significantly. • Partial syncing: It is possible and in some cases desirable (e.g., with rollups, partial syncing can reduce latency) for exect to provide fast syncing of small amounts of state, performing full syncing perhaps only periodically. For example, exect can approve a withdrawal request by updating a user’s balance in SCa without otherwise updating MAINCHAIN state. 6.4 Reorgs Blockchain reorganizations resulting from network instability or even from 51%-attacks can pose a threat to the integrity of a main chain. In practice, adversaries have used them to mount double-spending attacks [34]. While such attacks on major chains are challenging to mount, they remain feasible for some chains [88]. Because it operates independently of MAINCHAIN, a DON offers the interesting possibility of observing and providing some protections against reorgs associated with attacks. For example, a DON can report to a relying contract SC on MAINCHAIN the existence of a competing fork of some threshold length \(\tau\). The DON can additionally 12Supplementary details can be found in Appendix B.2.1. They are not required for understanding.

provide proof—in either a PoW or PoS setting—of the existence of such a fork. The contract SC can implement suitable defensive actions, such as suspending further transaction execution for a period of time (e.g., to allow exchanges to blacklist double-spent assets). Note that although an adversary mounting a 51%-attack can seek to censor reports from a DON, a countermeasure in SC is to require periodic reports from the DON in order to process transactions (i.e., a heartbeat) or to require a fresh report to validate a high-value transaction. While such forking alerts are in principle a general service the DON can provide for any of a number of purposes, our plan is to incorporate them with the TEF.

DON 事务执行框架

(DON-TEF) DONs 将为 oracle 内的第 2 层解决方案提供 oracle 和去中心化资源支持 我们称之为去中心化 Oracle 网络交易执行框架 (DONTEF) 或简称 TEF。 如今,DeFi 合约的更新频率受到主链延迟的限制, 例如,Ethereum [104] 中 10-15 秒的平均区块间隔,以及 在链上推送大量数据和有限的计算/交易吞吐量—— 激励扩展方法,例如分片 [148、158、232] 和第 2 层执行 [5、 12、121、141、169、186、187]。即使 blockchains 的交易时间要快得多, 例如,[120],提出了涉及链外计算[168]的扩容策略。 TEF 旨在充当任何此类第 1 层/主链系统的第 2 层资源。 使用 TEF,DONs 可以支持主链合约中更快的更新,同时 保留主链提供的关键信任保证。 TEF可以支持 许多第 2 层执行技术和范例中的任何一种,包括 rollups,11 乐观的rollups、Validium等,以及阈值信任模型,其中DON 节点执行交易。 TEF 是 FSS 的补充,旨在为其提供支持。换句话说,任何 在 TEF 中运行的应用程序可以使用 FSS。 11通常称为“zk-rollups”,这是用词不当,因为它们不一定需要零知识证明。

Transaction Execution Framework schematic showing mempool, clearing, and settlement flow

6.1 TEF 概述 TEF 是一种用于构建和执行高性能混合体的设计模式 smart contract SC。 根据混合 smart contract 背后的主要思想,TEF 涉及 将 SC 分解为两部分: (1) 我们在 TEF 上下文中称之为锚点 MAINCHAIN 上的合约 SCa 和 (2) DON 逻辑要求我们调用 TEF 可执行文件。 我们这里用SC来表示SCa组合实现的逻辑合约 并执行。 (如上所述,我们期望开发编译器工具来分解 SC 自动收缩到这些组件中。) TEF可执行exec是SC中处理用户交易的引擎。它 可以以高性能的方式执行,因为它在 DON 上运行。它有几个功能: • 交易摄取:exec 接收或获取用户的交易。它可以这样做 直接,即通过 DON 上的交易提交,或通过主链 使用 MS 的内存池。 • 快速交易执行:exec 处理涉及以下资产的交易 SC。它在本地执行此操作,即在 DON 上。 • 快速且低成本的oracle /适配器访问:exec 具有对 oracle 报告的本机访问权限 和其他适配器数据,例如更快、更便宜和更准确的资产 定价高于主链执行。此外,链下 oracle 访问减少了 oracle 的运营成本,即使用该系统的成本,通过避免 昂贵的链上存储。 • 同步:exec 定期将更新从DON 推送到主链,更新SCa。 锚定合约是SC的主链前端。作为 SC 的更高信任组件,它有几个用途: • 资产托管:用户的资金存入、持有和提取于SCa。 • 同步验证:SCa 可以在执行时验证状态更新的正确性 同步,例如附加到 rollups 的 SNARK。 • 护栏:SCa 可能包括防止腐败或故障的规定 期待中。 (更多详情请参见第 7 节。) 在 TEF 中,用户的资金托管在主链上,这意味着 DON 本身是非托管的。根据同步机制的选择(见下文),用户可能需要 仅信任 DON 以获得准确的 oracle 报告并及时与主链同步。 由此产生的信任模型与基于订单簿的 DEX 非常相似,例如 [2], 如今,它通常包括用于订单匹配的链下组件和用于清算和结算的链上组件。要使用支付系统的词汇,人们可能会认为 exct 是一个组件 SC负责清算,SCa负责结算。原理图见图 13 TEF 的描述。 图 13:TEF 原理图。在此示例中,交易通过内存池 通过 MS 到 DON 的主链。 TEF的好处: TEF 具有三个主要优势: • 高性能:SC 继承了DON 比 MAINCHAIN 高得多的吞吐量 对于交易和 oracle 报告。此外,与单独在 MAINCHAIN 上实现相比,exec 可以更快地处理交易并更及时地响应 oracle 报告。 • 费用更低:同步过程对时间的敏感性低于交易处理,并且交易可以批量从DON 发送到MAINCHAIN。 因此,这种方法的每笔交易链上费用(例如,gas 成本)比仅在主链上运行的合约低得多。 • 保密性:DON 的保密机制可用于 承担SC。

TEF 限制: TEF 的一个限制是它不支持瞬时 提款,因为它们仅发生在主链上:发送提款请求后 对于SCa,用户可能需要等待execute来执行状态更新,其中包括 在获得批准之前提款交易。我们讨论一些部分补救措施, 然而,在第 6.2 节中。 TEF 的另一个限制是它不支持 DeFi 的原子组合 主链上的合约,特别是通过多个 DeFi 路由资产的能力 单一交易中的合同。然而,TEF 可以支持这种原子性 DeFi 合约在同一个 DON 上运行。我们还讨论了一些解决这个问题的方法 6.2 节中的问题。 6.2 交易路由 SC 的交易可以由用户直接发送到 DON 或可以通过 MAINCHAIN 中的内存池(通过 FSS)。有四种不同的交易类型,每种类型 其中需要不同的处理: 合约内交易: 因为它回避了气体动力学的复杂性,TEF 为 SC 在处理交易方面提供了比普通 SC 更大的灵活性。 在第 1 层合约中可用。例如,当 Ethereum 中的内存池交易时 可以被更高 Gas 价格的新交易覆盖,SC 可以在 SC 内的资产上操作的交易一旦变得可见就视为权威交易 在内存池中。因此,SC不需要等待交易被确认 在一个块内,从而大大减少延迟。 代理: 用户可能希望通过钱包合约向 SC 发送交易 τ 或 主链上的其他合约。 DON 可以模拟执行 MAINCHAIN 上的 τ 来确定是否会导致 SC 的后续交易。 如果是这样,τ 可以与 SC 的其他交易一起排序。有几个 DON 如何识别此类交易的可能性: (1) DON 可以模拟 内存池中的所有交易(一种昂贵的方法); (2) 某些合同或 可以列出合约类型,例如钱包,以供 DON 监控;或 (3) 用户可以 注释交易以供 DON 检查。 当单个事务与两个事务交互时,事情变得更加复杂 合约 SC1 和 SC2,两者都使用公平排序服务并且具有不兼容的排序策略。例如,DON 可能会在最晚的时间对 τ 进行排序 两者兼容。 存款: 将主链资产存入 SC 的交易需要在区块中得到确认,然后 SC 才能将其视为有效。当它检测到采矿 将资产(例如以太币)发送到SCa的交易,exec可以立即确认订金。例如,它可以将 DON 的当前 oracle 报告价格应用于 资产。 提款: 如上所述,TEF 的局限性在于提款不能总是立即执行。在 rollup 类型的执行模型中,提款 请求必须与其他事务一起排序,即汇总,以便安全地进行 已处理。然而,有一些针对此限制的部分补救措施。 如果 DON 可以快速计算出 rollup 的有效性证明直到提款交易,那么观察内存池中的用户交易 τ 可以以更高的 Gas 价格发送 τ 的状态更新交易 τ ′,这是一种有益的抢先交易。 假设 τ 在 τ ′ 到达内存池之前未被开采,则 τ ′ 将先于 τ,并且 τ 将影响批准的提款。 在 TEF 变体中,依赖 DON 来计算状态更新(请参阅 下面的阈值签名变体),DON 也可以确定链下 考虑到 SC 执行时的状态,是否应该批准 τ。 DON 然后可以发送一个交易 τ ′ 来批准提款 τ,而不影响完整的交易 状态更新。 如果此方法不可行,或者在不成功的情况下,则由 DON 启动 交易 τ ′ 可以响应 τ 向用户发送资金,这样用户就不需要 发起额外交易。 6.3 正在同步 TEF 可执行文件 exec 定期将更新从 DON 推送到 MAINCHAIN, 在我们称为同步的过程中更新 SCa 的状态。可以考虑同步 作为第 2 层交易到第 1 层的传播,因此 TEF 可以利用任意数字 用于此目的的现有技术,包括 rollups [5, 12, 16, 69],乐观 rollups [10, 11, 141],Validium [201],或基本阈值签名,例如阈值 BLS, Schnorr,或 ECDSA [24,54,116,202]。原则上,可信执行环境 还可以证明状态更改的正确性,提供更高性能的 rollups 的替代方案,但具有依赖于硬件的信任模型。 (例如,参见 [80]。) 下面我们比较这些同步选项的三个关键属性 技术教育框架: • 数据可用性:SC 的状态存储在哪里?至少三个选项是 在 TEF 中可用:在主链上、在 DON 上或通过某些第三方存储 IPFS 等提供商。他们实现了不同的安全保证、可用性 级别和性能概况。简而言之,在主链上存储状态可以实现 链上可审计性并消除对任何一方的状态可用性的依赖; 另一方面,链下存储状态可以降低存储成本并提高 吞吐量,以信任存储提供商(DON 或第三方)为代价 数据可用性。当然,结合这些选项的灵活模型也可以 可能的。我们在表 1 中指出了所需的数据可用性形式。• 正确性保证:SCa 如何确定更新的正确性 由exec 推动?这会影响 exect 和 SCa 的计算负载以及 同步延迟(见下文)。 • 延迟:同步延迟有三个影响因素: (1) 所花费的时间 用于生成同步交易τsync; (2) τsync 所花费的时间 待主链确认; (3) τsync 生效的时间 SC。在 TEF 中,延迟对于提款尤为重要(但对于提款来说则不那么重要) 合约内交易)因为提款必然需要(至少 部分)状态同步。 正在同步 选项 数据 可用性 正确性 保证 延迟 汇总 [5, 12, 16, 69] 链上 有效性证明 生成所需时间 有效性证明(例如当前系统中的分钟数) 维迪乌姆 [201] 链下 有效性证明 与上面相同 乐观rollup [10, 11, 141] 链上 欺诈证明 挑战时长 期间 (例如, 天 或 周) 门槛签名 [24, 54、116、202] 灵活 DON 的阈值签名 瞬时 可信执行环境 [80] 灵活 基于硬件 证明 瞬时 表 1:TEF 中的各种同步选项及其属性。 表 1 总结了 TEF 中五个主要同步选项的这些属性。 (注 我们不打算将这些技术与独立的第 2 层扩展进行比较 解决方案。为此,我们建议读者参考 [121]。) 现在我们讨论每个同步选项。 汇总: rollup [69] 是一个协议,其中状态转换由 一批交易是在链外计算的。 然后传播状态变化 到主链上。 为了实现 rollups,锚点 smart contract SCa 存储实际状态的紧凑表示 Rstate(例如 Merkle 根)。要同步,exec 发送 τsync = (T,R′ 状态)到 SCa,其中 T 是自上次以来处理的事务集同步和R′ state 是通过应用计算出的新状态的紧凑表示 T 中的交易到先前状态 Rstate。 有两种流行的变体,它们在 SCa 验证 τsync 中状态更新的方式上有所不同。 第一个,(zk-)rollups,附加一个简洁的正确性论证,有时称为 有效性证明,用于转换 Rstate →R′ 状态。要实现此变体,请执行 计算并提交有效性证明(例如,zk-SNARK 证明)以及 τsync, 证明R′ state 是将 T 应用到 SCa 当前状态的结果。锚 合约仅在验证证明后才接受状态更新。 乐观的 rollup 不包括正确性的论点,但有 staking 和 促进状态转换的分布式验证的挑战程序。为此 rollup 变体,SCa 暂时接受 τsync 假设它是正确的(因此乐观) 但 τsync 直到挑战期结束后才生效,在此期间任何一方 监控 MAINCHAIN 可以识别错误的状态更新并通知 SCa 采取措施 必要的行动(例如,回滚状态并对exec施加惩罚。) 随着交易的发布,两个 rollup 变体都实现了链上数据可用性 链上,可以从中构建完整的状态。 zk-rollups 的延迟为 主要由生成有效性证明所需的时间决定,这通常是在 现有系统 [16] 中的分钟顺序,并且随着时间的推移可能会得到改进。 另一方面,乐观的 rollups 具有更高的延迟(例如,几天或几周) 因为挑战期需要足够长才能使欺诈证明发挥作用。的 缓慢确认的含义是微妙的,有时特定于该方案,因此 彻底的分析超出了范围。例如,某些计划考虑付款 在确认状态更新之前,交易作为“无信任最终”[109],因为 普通用户可以比主链更快地验证 rollup。 有效: Validium 是 (zk-)rollup 的一种形式,使数据仅在链外可用 并且不维护主链上的所有数据。具体来说,exec 只发送新的 状态和证明,但不向 SCa 发送交易。使用 Validium 风格的同步,执行 并且执行它的 DON 是唯一存储完整状态和 执行交易。与 zk-rollups 一样,同步延迟主要由有效性决定 证明生成时间。然而,与 zk-rollups 不同的是,Validium 风格的同步减少了 存储成本并增加吞吐量。 DON 的阈值签名: 假设 DON 个节点的阈值是诚实的, 简单而快速的同步选项是让 DON 节点共同签署新状态。 这种方法可以支持链上和链下数据的可用性。请注意,如果 用户信任 DON 的 oracle 更新,他们不需要更信任它来接受 状态更新,因为它们已经处于阈值信任模型中。 另一个好处是 阈值签名是低延迟的。支持新的交易签名格式 EIP-2938 [70] 中提出并称为帐户抽象将产生阈值 签名更容易实施,因为它将消除门槛的需要 ECDSA,涉及相当复杂的协议(例如,[116,117,118])比阈值 Schnorr [202] 或 BLS [55] 签名等替代方案更好。 可信执行环境 (TEE): TEE是隔离的执行环境(通常由硬件实现),旨在提供强大的安全保护 用于内部运行的程序。一些 TEE(例如 Intel SGX [84])可以生成证明, 称为证明,输出是由特定程序正确计算的 特定的输入12。 TEF 同步的基于 TEE 的变体可以通过以下方式实现 使用技术将 (zk-)rollups 或 Validium 中的证明替换为 TEE 证明 来自 [80]。 与 rollups 和 Validium 中使用的零知识证明相比,TEE 更 性能更高。与阈值签名相比,TEE 消除了以下复杂性: 生成阈值 ECDSA 签名,因为原则上只需要一个 TEE 参与。然而,使用 TEE 确实会引入额外的依赖于硬件的信任假设。人们还可以将 TEE 与阈值签名结合起来以创建弹性 防止一小部分 TEE 实例受到损害,尽管这种保护措施 重新引入了生成阈值 ECDSA 签名的复杂性。 额外的灵活性: 可以通过以下方式改进这些同步选项以提供更大的灵活性。 • 灵活的触发:TEF 应用程序可以确定触发条件 同步被触发。例如,同步可以是基于批处理的,例如,在 每 N 个交易、基于时间的交易(例如每 10 个区块)或基于事件的交易(例如)发生 每当目标资产价格大幅变动时。 • 部分同步:这是可能的,并且在某些情况下是可取的(例如,对于 rollups, 部分同步可以减少延迟)以提供小数据的快速同步 状态量,可能仅定期执行完全同步。例如, exect 可以通过更新 SCa 中用户的余额来批准提款请求 无需另外更新 MAINCHAIN 状态。 6.4 重组 由于网络不稳定甚至 51% 攻击而导致的区块链重组 可能对主链的完整性构成威胁。在实践中,对手已经使用了 他们发起双花攻击[34]。虽然此类针对主要区块链的攻击 安装具有挑战性,但它们对于某些链条 [88] 仍然可行。 因为它独立于主链运行,所以 DON 提供了有趣的功能 观察并提供一些针对与相关重组相关的保护的可能性 攻击。 例如,DON 可以向主链上的依赖合约 SC 报告某个阈值长度 τ 的竞争分叉的存在。 DON 还可以 12 补充细节可见附录 B.2.1。他们不需要理解。

在 PoW 或 PoS 设置中提供此类分叉存在的证据。的 合约 SC 可以实施适当的防御行动,例如在一段时间内暂停进一步的交易执行(例如,允许交易所将双花列入黑名单) 资产)。请注意,尽管对手发起 51% 攻击可以寻求审查 来自 DON 的报告,SC 的一项对策是要求来自 DON 的定期报告 DON 为了处理交易(即心跳)或需要新的报告 验证高价值交易。 虽然此类分叉警报原则上是 DON 可以提供的一般服务 出于多种目的中的任何一个,我们的计划是将它们纳入 TEF。

Trust Minimization

Trust Minimization

As a decentralized system with participation from a heterogeneous set of entities, the Chainlink network provides strong protection against failures in both liveness (availability) and safety (report integrity). Most decentralized systems, however, vary in the degree to which their constituent components are themselves decentralized. This is true even of large systems, where limited decentralization among miners [32] and intermediaries [51] has long been present. The goal of any decentralization effort is trust minimization: We seek to reduce the adverse effects of systemic corruption or failure within the Chainlink network, even that due to a malicious DON. Our guiding principle is the Principle of Least Privilege [197]. System components and actors within the system should have privileges strictly scoped to allow only for the successful completion of their assigned roles. Here we lay out several concrete mechanisms for Chainlink to adopt in its drive toward ever-greater trust minimization. We characterize these mechanisms in terms of the loci, i.e., system components, in which they are rooted, shown in Fig. 14. We address each locus in a respective subsection. 7.1 Data-Source Authentication Current operating models for oracles are constrained by the fact that few data sources digitally sign the data they omit, in large part because TLS does not natively sign data. TLS does make use of digital signatures in its “handshake” protocol (to establish a shared key between a server and client). HTTPS-enabled servers thus have certificates on public keys that can in principle serve to sign data, but they do not generally use these certificates to support data signing. Consequently, the security of a DON, as in today’s oracle networks, relies on oracle nodes faithfully relaying data from a data source to a contract. An important long-term component of our vision for trust minimization in Chainlink involves stronger data-source authentication through support of tools and standards for data signing. Data signing can help enforce end-to-end integrity guarantees. In principle, if a contract accepts as input a piece of data D signed directly by a data

Loci of trust-minimizing mechanisms in the Chainlink network showing data quality, node selection, and oracle report verification

Figure 14: Loci of trust-minimizing mechanisms discussed in this section. 1⃝Data sources provide data to the 2⃝DON, which relays a function of the data to a dependent 3⃝smart contract. Additionally, the DON or the oracle network includes 4⃝node management smart contracts on MAINCHAIN for, e.g., compensating nodes, guard rails, and so forth. source, then the oracle network cannot feasibly tamper with D. Various encouraging efforts to enable such signing of data have emerged, including OpenID Connect, which is designed primarily for user authentication [9], TLS-N, an academic project aiming to extend TLS [191] by repurposing TLS certificates, and TLS Evidence Extensions [63]. While OpenID Connect has seen some adoption, however, TLS Evidence Extensions and TLS-N have yet to see adoption. Another potential avenue of data-source authentication is to use publishers’ own Signed HTTP Exchanges (SXG) [230], which they can cache on content-delivery networks as part of the Accelerated Mobile Pages (AMP) protocol [225]. The Chrome mobile browser displays the content from AMP-cached SXGs as if they were served from their publishers’ own network domains instead of the cache-server domain. This branding incentive, coupled with the relative ease of enabling it using services like CloudFlare’s Real URL [83] and Google’s amppackager [124], may lead to widespread adoption of SXGs in cached news content, which would enable a simple, tamper-resistant way for Chainlink oracles to trigger on newsworthy events reported in valid SXGs. While AMP-cached SXGs from news publishers would not be useful for high-tempo applications like reports on trading data, they could be a secure source for custom contracts pertaining to real-world events like extreme weather or election outcomes. We believe that simple deployment, mature tools, and flexibility will be vital to accelerating data-source signing. Enabling data providers to use Chainlink nodes as an authenticated API front end seems a promising approach. We intend to create an

option for nodes to function in this mode, with or without participation in the network as a full-blown oracle. We refer to this capability as authenticated data origination (ADO). By using Chainlink nodes with ADO, data sources will be able to benefit from the experience and tools developed by the Chainlink community in adding digital signing capabilities to their existing suite of off-chain APIs. Should they choose to run their nodes as oracles, they can additionally open up potential new revenue streams under the same model as existing data providers, e.g., Kraken [28], Kaiko [140], and others, that run Chainlink nodes to sell API data on chain. 7.1.1 The Limitations of Authenticated Data Origination Digital signing by data sources, while it can help strengthen authentication, isn’t sufficient per se to accomplish all of the natural security or operational goals of an oracle network. To begin with, a given piece of data D must still be relayed in a robust and timely way from a data source to smart contract or other data consumer. That is, even in an ideal setting in which all data is signed using keys pre-programmed into dependent contracts, a DON would still be needed to communicate the data reliably from sources to contracts. Additionally, there are a number of cases in which contracts or other oracle-data consumers want access to authenticated output of various functions computed over source data for two main reasons: • Confidentiality: A data source API may provide sensitive or proprietary data that needs to be redacted or sanitized before it is made publicly visible on chain. Any modification to signed data, however, invalidated the signature. Put another way, na¨ıve ADO and data sanitization are incompatible. We show in Example 3 how the two can be reconciled through an enhanced form of ADO. • Data source faults: Both errors and failures can affect data sources, and digital signatures address neither problem. From its inception [98], Chainlink has already included a mechanism to remediate such faults: redundancy. The reports issued by oracle networks typically represent the combined data of multiple sources. We now discuss schemes we are exploring in the ADO setting to enhance the confidentiality of source data and to combine data from multiple sources securely. 7.1.2 Confidentiality Data sources may not anticipate and make available the full gamut of APIs desired by users. Specifically, users may wish to access pre-processed data to help ensure confidentiality. The following example illustrates the problem.

Example 3. Alice wishes to obtain a decentralized identity (DID) credential stating that she is over 18 years of age (and thus can, for instance, take out a loan). To do so, she needs to prove this fact about her age to a DID credential issuer. Alice hopes to use data from her state’s Department of Motor Vehicles (DMV) website for the purpose. The DMV has a record of her birthdate and will emit a digitally signed attestation A on it of the following form: A = {Name: Alice, DoB: 02/16/1999}. In this example, the attestation A may be sufficient for Alice to prove to the DID credential issuer that she’s over 18. But it needlessly leaks sensitive information: Alice’s exact DoB. Ideally, what Alice would like from the DMV instead is a signature on a simple statement A′ that “Alice is over 18 years of age.” In other words, she wants the output of a function G on her birthdate X, where (informally), A′ = G(X) = True if CurrentDate −X ≥18 years; otherwise, G(X) = False. To generalize, Alice would like to be able to request from the data source a signed attestation A′ of the form: A′ = {Name: Alice, Func:G(X), Result: True}, where G(X) denotes a specification of a function G and its input(s) X. We envision that a user should be able to provide a desired G(X) as input with her request for a corresponding attestation A′. Note that the data source’s attestation A′ must include the specification G(X) to ensure that A′ is correctly interpreted. In the above example, G(X) defines the meaning of the Boolean value in A′ and thus that True signifies the subject of the attestation is over 18 years of age. We refer to flexible queries in which a user can specify G(X) as functional queries. In order to support use cases like that in Example 3, as well as those involving queries directly from contracts, we intend to include support for functional queries involving simple functions G as part of ADO. 7.1.3 Combining Source Data To reduce on-chain costs, contracts are generally designed to consume combined data from multiple sources, as illustrated in the following example. Example 4 (Medianizing price data). To provide a price feed, i.e., the value of one asset (e.g., ETH) with respect to another (e.g., USD), an oracle network will generally obtain current prices from a number of sources, such as exchanges. The oracle network typically sends to a dependent contract SC the median of these values. In an environment with data signing, a correctly functioning oracle network obtains from data sources \(S = \{S_1, \ldots, S_{n_S}\}\) a sequence of values \(V = \{v_1, v_2, \ldots, v_{n_S}\}\) from \(n_S\) sources with accompanying source-specific signatures \(\Sigma = \{\sigma_1, \sigma_2, \ldots, \sigma_{n_S}\}\). Upon verifying the signatures, it transmits the price \(v = \text{median}(V)\) to SC.

Unfortunately, there is no simple way for an oracle network to transmit the median value \(v\) in Example 4 to SC along with a succinct proof \(\sigma^*\) that \(v\) was correctly computed over signed inputs. A na¨ıve approach would be to encode in SC the public keys of all \(n_S\) data sources. The oracle network would then relay \((V, \Sigma)\) and allow SC to compute the median of \(V\). This, however, would result in a proof \(\sigma\) of size \(O(n_S)\)—i.e., \(\sigma^*\) would not be succinct. It would also incur high gas costs for SC, which would need to verify all signatures in \(\Sigma\). Use of SNARKs, in contrast, enables a succinct proof of correctly combined authenticated source values. It may be workable in practice, but imposes fairly high computational costs on the prover, and somewhat high gas costs on chain. Use of Town Crier is also a possibility, but requires the use of TEEs, which does not suit all users’ trust models. A helpful concept in which to frame solutions to the general problem of signing combined data from sources is a cryptographic tool known as functional signatures [59, 132]. Briefly, functional signatures allow a signer to delegate signing capability, such that the delegatee can only sign messages in the range of a function F chosen by the signer. We show in Appendix D how this functional constraint can serve to bound the range of report values emitted by a DON as a function of the values signed by data sources. We also introduce a new primitive, called a discretized functional signature, that includes a relaxed requirement for accuracy, but is potentially much more performant than approaches such as SNARKs. The problem of combining data sources in a way that includes source authentication of outputs also applies to data aggregators, e.g., CoinCap, CoinMarketCap, CoinGecko, CryptoCompare, etc., which obtain data from a multiplicity of exchanges, which they weight based on volumes, using methodologies that they in some cases make public and are in other cases proprietary. An aggregator that wishes to publish a value with source authentication faces the same challenge as a collection of nodes aggregating source data. 7.1.4 Processing Source Data Sophisticated smart contracts are likely to depend on custom aggregate statistics over primary data sources, such as volatility in recent price history over many assets, or text and photographs from news about pertinent events. Because computation and bandwidth are relatively cheap in a DON, these statistics— even complex machine-learning models with many inputs—can be processed economically, as long as any output value destined for a blockchain is sufficiently concise. For computationally intensive jobs where DON participants may have differing views on complex inputs, extra rounds of communication between the DON participants may be required to establish consensus on the inputs before computing the result. As long as the final value is fully determined by the inputs, once input consensus is established each participant can simply compute the value and broadcast it to the other

participants with their partial signature, or send it to an aggregator. 7.2 DON Trust Minimization We envision two main ways of minimizing the trust placed in components of the DON: failover clients and minority reports. 7.2.1 Failover Clients Adversarial models in the cryptography and distributed systems literature typically consider an adversary capable of corrupting (i.e., compromising) a subset of nodes, e.g., fewer than one-third for many BFT protocols. It is commonly observed, however, that if all nodes run identical software, an adversary that identifies a fatal exploit could in principle compromise all nodes more or less simultaneously. This setting is often referred to as a software monoculture [47]. Various proposals for automatically diversifying software and software configurations have been put forth to address the problem, e.g., [47, 113]. As noted in [47], however, software diversity is a complex issue and requires careful consideration. Software diversification, for example, can result in worse security than a monoculture if it increases a system’s attack surface and thus its possible vectors of attack in excess of the security benefits it offers. We believe that support for robust failover clients—i.e., clients to which nodes can switch in the face of a catastrophic event—is an especially attractive form of software diversification. Failover clients do not increase the number of potential vectors of attack, as they are not deployed as mainline software. They offer clear benefits, however, as a second line of defense. We intend to support failover clients in DONs as a key means of reducing their dependence for security on a single client. Chainlink already has in place a robust system of failover clients. Our approach involves maintaining previous, battle-tested client versions. Today, for example, Chainlink nodes with Off-Chain Reporting (OCR) as their primary client include support for Chainlink’s previous FluxMonitor system if needed. Having been in use for some time, FluxMonitor has received security audits and field testing. It provides the same functionality as OCR, just at higher cost—a cost only incurred on an as-needed basis. 7.2.2 Minority Reports Given a sufficiently large minority set \(O_{\text{minority}}\)—a fraction of honest nodes that observe malfeasance by the majority—it can be helpful for them to generate a minority report. This is a parallel report or flag, relayed to a dependent contract SC on-chain by \(O_{\text{minority}}\). SC can make use of this flag according to its own contract-specific policy. For example, for a contract in which safety is more important than liveness or responsiveness, a minority report might cause the contract to request supplementary reports from another DON, or trigger a circuit breaker (see the next section).

Minority reports can play an important role even when the majority is honest, because any report-aggregation scheme, even if it uses functional signatures, must operate in a threshold manner, to ensure resilience against oracle or data failure. In other words, it must be possible to produce a valid report based on the inputs of \(k_S < n_S\) oracles, for some threshold \(k_S\). This means a corrupted DON has some latitude in manipulating report values by selecting its preferred \(k_S\) values among the \(n_S\) reported in \(V\) by the full set of oracles, even if all sources are honest. For example, suppose that nS = 10 and kS = 7 in a system that uses a functional signature to authenticate computation of median over V for the USD price of ETH. Suppose that five sources report a price of \(500, while the other five report \)1000. Then by medianizing the lowest 7 reports, the DON can output a valid value v = $500, and by medianizing the highest, it can output v = $1000. By enhancing the DON protocol so that all nodes are aware of which data was available, and which data was used to construct a report, nodes could detect and flag statistically significant tendencies to favor one set of reports over another, and produce a minority report as a result. 7.3 Guard Rails Our trust model for DONs treats MAINCHAIN as a higher-security, higher-privilege system than DONs. (While this trust model may not always hold true, it is easier to adapt the resulting mechanism to situations where the DON is the higher security platform than vice versa.) A natural trust minimization strategy thus involves the implementation of monitoring and failsafe mechanisms in smart contracts—either in a MAINCHAIN front end for a DON or directly in a dependent contract SC. We refer to these mechanisms as guard rails, and enumerate some of the most important here: • Circuit breakers: SC may pause or halt state updates as a function either of characteristics of the state updates themselves (e.g., large variance across sequential reports) or based on other inputs. For example, a circuit breaker might trip in cases where oracle reports vary implausibly over time. A circuit breaker might also be tripped by a minority report. Thus, circuit breakers can prevent DONs from making grossly erroneous reports. Circuit breakers can provide time for additional interventions to be considered or exercised. One such intervention is escape hatches. • Escape hatches: Under adverse circumstances, as identified by a set of custodians, community token holders, or other bodies of trustees, a contract may invoke an emergency facility sometimes called an escape hatch [163]. An escape hatch causes SC to shut down in some manner and/or terminates pending and possibly future transactions. For example, it may return custodied funds to users [17]),

may terminate contract terms [162], or may cancel pending and/or future transactions [173]. Escape hatches can be deployed in any type of contract, not just one that relies on a DON, but they are of interest as a potential buffer against DON malfeasance. • Failover: In systems where SC relies on the DON for essential services, it is possible for SC to provide failover mechanisms that ensure service continuation even in the case of DON failure or misbehavior. For example, in the TEF (Section 6), the anchor contract SCa may provide dual interfaces where both on-chain and off-chain execution interfaces are supported for certain critical operations (e.g., withdrawal), or for ordinary transactions, with a suitable delay to prevent frontrunning of DON transactions. In cases where data sources sign data, users could also furnish reports to SCa when the DON fails to do so. Fraud proofs, as proposed for various forms of optimistic rollup (see Section 6.3), are similar in flavor and complementary to the mechanisms we enumerate above. They too provide a form of on-chain monitoring and protection against potential failures in off-chain system components. 7.4 Trust-Minimized Governance Like all decentralized systems, the Chainlink network requires governance mechanisms to adjust parameters over time, respond to emergencies, and guide its evolution. Some of these mechanisms currently reside on MAINCHAIN, and may continue to do so even with the deployment of DONs. One example is the payment mechanism for oracle node providers (DON nodes). DON front end contracts on MAINCHAIN contain additional mechanisms, such as guard rails, that may be subject to periodic modification. We foresee two classes of governance mechanisms: evolutionary and emergency. Evolutionary governance: Many modifications to the Chainlink ecosystem are such that their implementation is not a matter of urgency: Performance improvements, feature enhancements, (non-urgent) security upgrades, and so forth. As Chainlink progressively moves toward even more participants in its governance, we expect many or most such changes to be ratified by the community of a specific DON affected by those changes. In the interim, and perhaps ultimately as a parallel mechanism, we believe that a notion of temporal least privilege can be a useful means of implementing evolutionary governance. Very simply, the idea is for changes to deploy gradually, ensuring the community an opportunity to respond to them. For example, migration to a new MAINCHAIN contract can be constrained so that the new contract must be deployed at least thirty days before activation.

Emergency governance: Exploitable or exploited vulnerabilities in MAINCHAIN contracts or other forms of liveness or safety failures may require immediate intervention to ensure against catastrophic outcomes. Our intention is to support a multisig intervention mechanism in which, to ensure against malfeasance by any organization, signers will be dispersed across organizations. Ensuring consistent availability of signers and timely access to appropriate chains of command for authorization of emergency changes will clearly require careful operational planning and regular review. These challenges are similar to those involved in testing other cybersecurity incident-response capabilities [134], with a similar need to combat common problems like vigilance decrement [223]. The governance of DONs differs from that of many decentralized systems in its potential degree of heterogeneity. Each DON may have distinct data sources, executables, service-level requirements such as uptime, and users. The Chainlink network’s governance mechanisms must be flexible enough to accommodate such variations in operational goals and parameters. We are actively exploring design ideas and plan to publish research on this topic in the future. 7.5 Public-Key Infrastructure With progressive decentralization will come the need for a robust identification of network participants, including DON nodes. In particular, Chainlink requires a strong Public-Key Infrastructure (PKI). A PKI is a system that binds keys to identities. For example, a PKI undergirds the Internet’s system of secure connections (TLS): When you connect to a website via HTTPS (e.g., https://www.chainlinklabs.com) and a lock appears in your browser, that means that the public key of the domain owner has been bound to that owner by an authority—specifically, through a digital signature in a so-called certificate. A hierarchical system of certificate authorities (CAs), whose toplevel root authorities are hardwired into popular browsers, helps ensure that certificates are issued only to the legitimate owners of domains. We expect that Chainlink will eventually make use of decentralized name services, initially the Ethereum Name Service (ENS) [22], as the foundation for our PKI. As its name suggests, ENS is analogous to DNS, the Domain Name System that maps (human-readable) domain names to IP addresses on the internet. ENS, however, instead maps human-readable Ethereum names to blockchain addresses. Because ENS operates on the Ethereum blockchain, barring key compromise, tampering with its namespace is in principle as difficult as tampering with the contract administering it and/or the underlying blockchain. (DNS, in contrast, has historically been vulnerable to spoofing, hijacking, and other attacks.) We have registered data.eth with ENS on the Ethereum mainnet, and intend to establish it as a root namespace under which the identities of oracle data services and other Chainlink network entities reside. Domains in ENS are hierarchical, meaning that each domain may contain references to other names under it. Subdomains in ENS can serve as a way to organize and

delegate trust. The main role of data.eth will be to serve as an on-chain directory service for data feeds. Traditionally, developers and users of oracles have used off-chain sources (e.g., websites like docs.chain.link or data.chain.link, or social networks such as Twitter) to publish and obtain oracle data feed addresses (such as the ETH-USD price feed). With a highly trustworthy root namespace such as data.eth, it is possible instead to establish a mapping of eth-usd.data.eth to, e.g., the smart contract address of an on-chain oracle network aggregator for the ETH-USD price feed. This would create a secure path for anyone to refer to the blockchain as the source of truth for that data feed of that price/name pair (ETH-USD). Consequently, such use of ENS realizes two benefits unavailable in off-chain data sources: • Strong security: All changes and updates to the domain are recorded immutably and secured cryptographically, as opposed to text addresses on a website, which enjoy neither of these two security properties. • Automated on-chain propagation: Updates to the underlying address of a datafeed’s smart contract can trigger notifications that propagate to dependent smart contracts and can, for example, automatically update dependent contracts with the new addresses.13 Namespaces like ENS, however, do not automatically validate legitimate ownership of asserted names. Thus, for example, if the namespace includes the entry ⟨“Acme Oracle Node Co.”, addr⟩, then a user obtains the assurance that addr belongs to the claimant of the name Acme Oracle Node Co. Without additional mechanisms around namespace administration, however, she does not obtain assurance that the name belongs to an entity legitimately called Acme Oracle Node Co. in a meaningful real world sense. Our approach to validation of names, i.e., ensuring their ownership by corresponding, legitimate real-world entities, relies on several components. Today, Chainlink Labs effectively acts as a CA for the Chainlink network. While Chainlink Labs will continue to validate names, our PKI will evolve into a more decentralized model in two ways: • Web-of-trust model: The decentralized counterpart of a hierarchical PKI is often referred to as a web-of-trust.14 Variants have been proposed since the 1990s, e.g., [98], and a number of researchers have observed that blockchains can facilitate use of the idea, e.g., [227] by recording certificates in a globally consistent ledger. We are exploring variants of this model to validate the identities of entities in the Chainlink network in a more decentralized way. 13A dependent contract can optionally include a predetermined delay to allow for manual inspection and intervention by dependent-contract administrators. 14A term coined by Phil Zimmermann for PGP [238].

• Linkage to validating data: Today, a substantial amount of oracle node performance data is visible on-chain, and thus archivally bound to node addresses. Such data may be viewed as enriching an identity in the PKI by providing historical evidence of its (reliable) participation in the network. Additionally, tools for decentralized identity based on DECO and Town Crier [160] enable nodes to accumulate credentials derived from real-world data. As just one example, a node operator can attach a credential to its PKI identity that proves possession of a Dun and Bradstreet rating. These supplementary forms of validation can supplement staking in creating assurance of the security of the network. An oracle node with an established real-world identity may be viewed as having stake in a system deriving from its reputation. (See Section 4.3 and Section 9.6.3.) A final requirement for the Chainlink PKI is secure bootstrapping, i.e., securely publishing the root name for the Chainlink network, currently data.eth (analogously to hardwiring of top-level domains in browsers). In other words, how do Chainlink users determine that data.eth is indeed the top-level domain associated with the Chainlink project? The solution to this problem for the Chainlink network is multi-pronged and may involve: • Adding a TXT record [224] to our domain record for chain.link that specifies data.eth as the root domain for the Chainlink ecosystem. (Chainlink thus implicitly leverages the PKI for internet domains to validate its root ENS domain.) • Linking to data.eth from Chainlink’s existing website, e.g., from https://docs.chain.link. (Another implicit use of the PKI for internet domains.) • Making the use of data.eth known via various documents, including this whitepaper. • Posting data.eth publicly on our social-media channels, such as Twitter, and the Chainlink blog [18]. • Placing a large quantity of LINK under the control of the same registrant address as data.eth.

信任最小化

作为一个由一组异构实体参与的去中心化系统, Chainlink 网络在活性(可用性)和安全性(报告完整性)方面提供了针对故障的强大保护。然而,大多数去中心化系统在以下方面有所不同: 它们的组成部分本身分散的程度。这个 即使对于大型系统也是如此,矿工之间的权力下放有限 [32] 和 中介 [51] 早已存在。 任何去中心化努力的目标都是信任最小化:我们寻求减少 Chainlink 网络内系统性腐败或故障的不利影响,即使如此 由于恶意 DON。我们的指导原则是最小特权原则 [197]。 系统内的系统组件和参与者应具有严格范围内的权限 只允许成功完成分配给他们的角色。 这里我们列出了 Chainlink 在其驱动中采用的几种具体机制 走向更大程度的信任最小化。我们用以下术语来描述这些机制 基因座,即它们所扎根的系统组件,如图 14 所示。 解决相应小节中的每个基因座。 7.1 数据源认证 oracles 当前的操作模型受到以下事实的限制:数据源很少 对他们忽略的数据进行数字签名,很大程度上是因为 TLS 本身并不签名 数据。 TLS 确实在其“握手”协议中使用了数字签名(以建立 服务器和客户端之间的共享密钥)。因此启用 HTTPS 的服务器拥有证书 原则上可以用于签署数据的公钥,但它们通常不使用 这些证书支持数据签名。因此,DON 的安全性为 在当今的 oracle 网络中,依赖于 oracle 节点忠实地从数据中继数据 合同来源。 我们在 Chainlink 中实现信任最小化愿景的一个重要长期组成部分涉及通过支持数据签名工具和标准来加强数据源身份验证。数据签名可以帮助实施端到端的完整性保证。 原则上,如果合约接受由数据直接签名的一段数据 D 作为输入

Loci of trust-minimizing mechanisms in the Chainlink network showing data quality, node selection, and oracle report verification

图 14:本节讨论的信任最小化机制的轨迹。 1⃝数据 源向 2⃝DON 提供数据,该 2⃝DON 将数据功能中继到依赖项 3⃝smart contract。 此外,DON 或 oracle 网络包括 4⃝节点 主链上的管理 smart contracts,例如补偿节点、保护 导轨等。 源,则 oracle 网络无法切实篡改 D. 各种鼓励 实现此类数据签名的努力已经出现,其中包括 OpenID Connect,它 主要设计用于用户身份验证[9],TLS-N,一个学术项目,旨在 通过重新利用 TLS 证书和 TLS 证据扩展 [63] 来扩展 TLS [191]。 尽管 OpenID Connect 已经得到了一些采用,但是 TLS 证据扩展 和 TLS-N 尚未得到采用。 数据源身份验证的另一个潜在途径是使用发布者自己的 签名 HTTP 交换 (SXG) [230],它们可以将其缓存在内容交付网络上,作为加速移动页面 (AMP) 协议 [225] 的一部分。 Chrome 移动浏览器显示 AMP 缓存的 SXG 中的内容,就好像它们是从 他们的发布者自己的网络域而不是缓存服务器域。这种品牌激励,加上使用 CloudFlare 的 Real URL [83] 和 Google 的 amppackager [124] 等服务相对容易地启用它,可能会导致 SXG 在缓存的新闻内容中得到广泛采用,这将实现简单、防篡改的功能。 Chainlink oracles 触发有效 SXG 中报告的有新闻价值的事件的方式。 虽然来自新闻出版商的 AMP 缓存 SXG 对于快节奏内容没有用 像交易数据报告这样的应用程序,它们可以成为自定义的安全来源 与极端天气或选举结果等现实世界事件相关的合同。 我们相信简单的部署、成熟的工具和灵活性对于 加速数据源签名。使数据提供者能够使用 Chainlink 节点作为 经过身份验证的 API 前端似乎是一种很有前途的方法。我们打算创建一个节点在此模式下运行的选项,无论是否参与网络 作为一个成熟的oracle。我们将此功能称为经过身份验证的数据源 (阿杜)。通过将 Chainlink 节点与 ADO 结合使用,数据源将能够受益 来自 Chainlink 社区在添加数字方面的经验和开发的工具 为其现有的链外 API 套件提供签名功能。他们是否应该选择跑步 他们的节点为 oracles,他们还可以开辟潜在的新收入来源 与现有数据提供商采用相同的模型,例如 Kraken [28]、Kaiko [140],以及 其他运行 Chainlink 节点来在链上出售 API 数据。 7.1.1 经过身份验证的数据来源的局限性 数据源的数字签名虽然可以帮助加强身份验证,但其本身不足以实现 oracle 的所有自然安全或操作目标 网络。 首先,给定的数据 D 仍必须以稳健且及时的方式中继 从数据源到 smart contract 或其他数据使用者的方式。也就是说,即使在 理想的设置,其中所有数据都使用预编程为依赖项的密钥进行签名 合同,仍然需要 DON 来可靠地从来源传递数据 到合同。 此外,在许多情况下,合同或其他 oracle-数据 消费者希望访问经过身份验证的各种函数计算的输出 源数据主要有两个原因: • 保密性:数据源 API 可能提供敏感或专有数据 在链上公开可见之前需要对其进行编辑或清理。 然而,对签名数据的任何修改都会使签名无效。再放一个 这样,简单的 ADO 和数据清理是不兼容的。我们在示例 3 中展示 如何通过增强形式的 ADO 协调两者。 • 数据源故障:错误和故障都会影响数据源,而数字签名无法解决这两个问题。自 [98] 成立以来,Chainlink 已 已经包含了一种修复此类故障的机制:冗余。 oracle 网络发布的报告通常代表多个网络的组合数据 来源。 现在我们讨论在 ADO 设置中探索的方案,以增强源数据的机密性并安全地组合来自多个源的数据。 7.1.2 保密性 数据源可能无法预测并提供所需的全部 API 由用户。 具体来说,用户可能希望访问预处理的数据以帮助确保 保密性。下面的例子说明了这个问题。示例 3. Alice 希望获得去中心化身份 (DID) 凭证 她已年满 18 岁(例如,因此可以申请贷款)。要做的事 因此,她需要向 DID 凭证颁发者证明有关她年龄的事实。 Alice 希望使用她所在州机动车辆管理局 (DMV) 的数据 网站为此目的。 DMV 有她的出生日期记录,并将发出 其上的数字签名证明 A 的形式如下: A = {姓名:Alice,DoB:02/16/1999}。 在此示例中,证明 A 可能足以让 Alice 向 DID 证明 凭证颁发者表示她已超过 18 岁。但这不必要地泄露了敏感信息:Alice 的 确切的 DoB。理想情况下,Alice 希望 DMV 提供的是在 简单陈述 A',“Alice 已年满 18 岁”。换句话说,她想要的是 函数 G 在她的生日 X 上的输出,其中(非正式地),A′ = G(X) = True if 当前日期−X ≥18 年;否则,G(X) = False。 概括而言,Alice 希望能够从数据源请求签名的 证明 A′ 的形式: A′ = {名称:Alice,功能:G(X),结果:True}, 其中 G(X) 表示函数 G 及其输入 X 的规范。我们设想 用户应该能够提供所需的 G(X) 作为她的请求的输入 相应的证明A′。 请注意,数据源的证明 A′ 必须包含规范 G(X) 确保 A′ 被正确解释。在上面的例子中,G(X)定义了含义 A′ 中的布尔值,因此 True 表示证明的主题 已年满 18 岁。 我们将用户可以指定 G(X) 的灵活查询称为函数查询。 为了支持示例 3 中的用例以及涉及查询的用例 直接来自合约,我们打算包括对涉及的功能查询的支持 作为 ADO 一部分的简单函数 G。 7.1.3 合并源数据 为了降低链上成本,合约通常被设计为消耗组合数据 来自多个来源,如以下示例所示。 示例 4(价格数据中值化)。提供价格信息,即一个的价值 资产(例如,ETH)相对于另一种资产(例如,美元),oracle 网络通常会 从多种来源(例如交易所)获取当前价格。 oracle 网络 通常将这些值的中值发送给从属合约 SC。 在具有数据签名的环境中,正常运行的 oracle 网络可以获得 来自数据源 S = {S1, . 。 。 , SnS} 值序列 V = {v1, v2, . 。 。 , vnS} 来自 带有特定源签名的 nS 源 Σ = {σ1, σ2, . 。 。 ,σnS}。之上 验证签名后,它将价格 v = mid(V ) 传输给 SC。不幸的是,没有简单的方法让 oracle 网络传输中值 将示例 4 中的 v 值传递给 SC,并提供 v 计算正确的简洁证明 σ 过度签名的输入。 一种简单的方法是在 SC 中对所有 nS 数据源的公钥进行编码。 然后 oracle 网络将中继 (V, Σ) 并允许 SC 计算 V 的中值。 然而,这将导致证明 σ 的大小为 O(nS),即 σ 不会简洁。 它还会给 SC 带来高昂的 Gas 成本,因为 SC 需要验证中的所有签名 Σ。 相比之下,使用 SNARK 可以简洁地证明正确组合的经过身份验证的源值。在实践中可能可行,但要求相当高 证明者的计算成本,以及链上较高的天然气成本。使用 Town Crier 也是一种可能性,但需要使用 TEE,这并不适合所有人 用户的信任模型。 一个有用的概念是一种称为功能签名的加密工具,它可以解决对来自源的组合数据进行签名的一般问题。 [59, 132]。 简而言之,功能签名允许签名者委托签名能力,这样 受委托者只能对签名者选择的函数F范围内的消息进行签名。 我们在附录 D 中展示了这个功能约束如何用于限制范围 DON 发出的报告值作为数据源签名值的函数。 我们还引入了一种新的原语,称为离散函数签名,它包括对准确性的宽松要求,但可能具有更高的性能 比 SNARK 等方法更有效。 以包括源身份验证的方式组合数据源的问题 输出也适用于数据聚合器,例如 CoinCap、CoinMarketCap、CoinGecko、 CryptoCompare 等,它们从多个交易所获取数据, 基于体积的重量,使用他们在某些情况下公开的方法 在其他情况下是专有的。希望发布值的聚合器 源认证面临与节点聚合相同的挑战 源数据。 7.1.4 处理源数据 复杂的 smart contract 可能依赖于自定义聚合统计数据 主要数据源,例如许多资产近期价格历史的波动性,或 相关事件新闻中的文字和照片。 由于 DON 中的计算和带宽相对便宜,因此这些统计数据 — 即使是具有许多输入的复杂机器学习模型,也可以经济地进行处理,只要指定给 blockchain 的任何输出值都足够简洁。 对于计算密集型工作,DON 参与者可能有不同的 对于复杂输入的看法,可能需要 DON 参与者之间进行额外的沟通,以便在计算结果之前就输入达成共识。 只要最终值完全由输入决定,一旦建立输入共识,每个参与者就可以简单地计算该值并将其广播给其他参与者参与者的部分签名,或将其发送给聚合器。 7.2 DON 信任最小化 我们设想了两种主要方法来最大限度地减少对 DON 组件的信任: 故障转移客户端和少数派报告。 7.2.1 故障转移客户端 密码学和分布式系统文献中的对抗模型通常 考虑一个能够破坏(即损害)节点子集的对手, 例如,对于许多 BFT 协议来说,不到三分之一。然而,人们普遍观察到, 如果所有节点都运行相同的软件,那么识别出致命漏洞的对手就可以 原则上或多或少同时危害所有节点。这个设置经常 称为软件单一文化 [47]。 为了解决这个问题,已经提出了自动多样化软件和软件配置的各种建议,例如[47, 113]。如 [47] 中所述, 然而,软件多样性是一个复杂的问题,需要仔细考虑。例如,如果软件多样化,可能会导致比单一文化更糟糕的安全性 增加系统的攻击面,从而增加其可能的攻击向量 它提供的安全优势。 我们相信,对强大的故障转移客户端(即节点的客户端)的支持 可以在面对灾难性事件时进行转换——是一种特别有吸引力的形式 软件多样化。故障转移客户端不会增加潜在向量的数量 攻击,因为它们没有部署为主线软件。他们提供了明显的好处, 然而,作为第二道防线。我们打算在 DONs 中支持故障转移客户端 减少安全对单个客户端的依赖的关键方法。 Chainlink 已经建立了一个强大的故障转移客户端系统。我们的方法 涉及维护以前的、经过实战检验的客户端版本。例如,今天,以链外报告(OCR)作为主要客户端的 Chainlink 节点包括支持 如果需要,可用于 Chainlink 之前的 FluxMonitor 系统。已经使用了一些 目前,FluxMonitor 已经接受了安全审核和现场测试。它提供了相同的 OCR 等功能,只是成本较高——仅根据需要产生成本。 7.2.2 少数派报告 给定足够大的少数集 Ominority(观察到大多数人不法行为的诚实节点的一小部分),这对他们生成少数派可能会有所帮助 报告。这是一个并行报告或标志,转发到链上的依赖合约 SC 由少数派。 SC 可以根据其自己的合约特定策略来使用该标志。 例如,对于安全性比活性或响应性更重要的合同,少数报告可能会导致合同要求补充报告 来自另一个 DON,或触发断路器(请参阅下一节)。即使大多数人是诚实的,少数派报告也可以发挥重要作用, 因为任何报告聚合方案,即使它使用功能签名,也必须 以阈值方式操作,以确保针对 oracle 或数据故障的恢复能力。在 换句话说,必须能够根据以下人员的输入生成有效的报告: kS < nS oracles,对于某个阈值 kS。 这意味着损坏的 DON 有一些 通过在其中选择首选 kS 值来操纵报告值的自由度 nS 在 V 中由全套 oracle 报告,即使所有来源都是诚实的。 例如,假设在使用泛函的系统中 nS = 10 且 kS = 7 签名以验证 ETH 美元价格 V 上中位数的计算。 假设五个来源报告的价格为 \(500, while the other five report \)1000。 然后通过对最低 7 个报告进行中值化,DON 可以输出有效值 v = $500, 通过对最高值进行中值化,可以输出 v = $1000。 通过增强 DON 协议,使所有节点都知道哪些数据是 以及哪些数据用于构建报告,节点可以检测并标记 倾向于一组报告而不是另一组报告的统计显着趋势,并产生 结果是一份少数派报告。 7.3 护栏 我们针对 DON 的信任模型将主链视为更高安全性、更高特权 系统比DONs。 (虽然这种信任模型可能并不总是成立,但它更容易 使生成的机制适应 DON 具有更高安全性的情况 平台,反之亦然。) 因此,自然的信任最小化策略涉及在 smart contract 中实施监控和故障安全机制——无论是在主链前端 对于 DON 或直接在从属合同 SC 中。我们将这些机制称为 护栏,并在此列举一些最重要的: • 断路器:SC 可以根据状态更新本身的特征(例如,顺序更新之间的较大差异)暂停或停止状态更新。 报告)或基于其他输入。例如,断路器可能会跳闸 oracle 报告随时间变化令人难以置信的情况。断路器可能 也会被少数派报告绊倒。因此,断路器可以防止 DONs 以免做出严重错误的报告。 断路器可以为考虑额外干预措施提供时间 或锻炼。其中一种干预措施是逃生舱口。 • 逃生舱口:在不利情况下,由一组托管人、社区 token 持有者或其他受托人团体确定,合同可以援引 有时称为逃生舱口 [163] 的紧急设施。逃生舱口 导致 SC 以某种方式关闭和/或终止挂起,并且可能 未来的交易。例如,它可能会将托管资金返还给用户[17]),可以终止合同条款[162],或者可以取消待处理和/或未来的交易[173]。逃生舱口可以部署在任何类型的合同中,而不仅仅是 依赖于 DON 的一个,但它们作为潜在的缓冲区很有趣 DON 渎职行为。 • 故障转移:在 SC 依赖 DON 提供基本服务的系统中,SC 可以提供故障转移机制来确保服务连续性,即使 在 DON 失败或行为不当的情况下。例如,在 TEF(第 6 节)中, 锚定合约SCa可以提供双接口,链上和链上都可以 某些关键操作支持链外执行接口(例如, 提款),或对于普通交易,有适当的延迟以防止 DON 交易的抢先交易。在数据源签署数据的情况下,用户可以 当 DON 未能这样做时,还需向 SCa 提供报告。 欺诈证明,如针对各种形式的乐观 rollup 所提议的(参见第 6.3 节), 与我们上面列举的机制相似且互补。他们 也提供了一种形式的链上监控和保护,防止潜在的故障 链下系统组件。 7.4 信任最小化治理 与所有去中心化系统一样,Chainlink 网络需要治理机制 随着时间的推移调整参数、响应紧急情况并指导其演变。 其中一些机制目前驻留在主链上,并且可能会继续存在 即使部署了 DONs,也要这样做。支付机制就是一个例子 对于 oracle 节点提供商(DON 节点)。 DON 主链上的前端合约 包含额外的机制,例如护栏,可能会受到定期检查 修改。 我们预见了两类治理机制:进化机制和紧急机制。 进化治理: 对 Chainlink 生态系统的许多修改是 这样它们的实施就不是一个紧迫的问题:性能改进, 功能增强、(非紧急)安全升级等。随着 Chainlink 逐渐吸引更多参与者参与其治理,我们预计许多或 大多数此类更改均需由受这些影响的特定 DON 社区批准 变化。在此期间,也许最终作为一个并行机制,我们相信 暂时最小特权的概念可以成为实施进化治理的有用手段。很简单,这个想法是逐步部署变革,确保 社区有机会回应他们。例如,迁移到新的 MAINCHAIN 合约可以受到约束,因此必须部署新合约 激活前至少三十天。应急治理: MAINCHAIN 中可利用或被利用的漏洞 合同或其他形式的活动或安全故障可能需要立即干预,以确保避免灾难性后果。我们的目的是支持多重签名 干预机制,以确保防止任何组织的不当行为, 签名者将分散在各个组织中。确保签名者的一致性可用性 并及时联系适当的指挥系统以授权紧急情况 变革显然需要仔细的运营规划和定期审查。这些 挑战与测试其他网络安全事件响应所涉及的挑战类似 能力 [134],具有类似的需要来解决常见问题,例如警惕性降低 [223]。 DONs 的治理不同于许多去中心化系统的治理 潜在的异质性程度。每个 DON 可能具有不同的数据源、可执行文件、服务级别要求(例如正常运行时间)和用户。 Chainlink 网络的 治理机制必须足够灵活,以适应这些变化 运营目标和参数。我们正在积极探索设计思路并计划 将来发表有关该主题的研究。 7.5 公钥基础设施 随着权力下放的逐步推进,将需要对 网络参与者,包括 DON 节点。特别是,Chainlink 需要强大的 公钥基础设施 (PKI)。 PKI 是将密钥与身份绑定的系统。对于 例如,PKI 巩固了互联网的安全连接系统 (TLS): 您通过 HTTPS(例如 https://www.chainlinklabs.com)连接到网站,并且 浏览器中出现锁,这意味着域所有者的公钥已被锁定 已通过权威机构(具体来说,通过数字签名)与该所有者绑定 所谓的证书。证书颁发机构 (CA) 的分层系统,其顶级根颁发机构硬连线到流行的浏览器中,有助于确保证书 仅颁发给域名的合法所有者。 我们预计 Chainlink 最终将使用去中心化的名称服务, 最初是 Ethereum 名称服务 (ENS) [22],作为我们 PKI 的基础。作为 顾名思义,ENS 类似于 DNS,即映射的域名系统 (人类可读的)域名到互联网上的 IP 地址。然而,ENS 将人类可读的 Ethereum 名称映射到 blockchain 地址。因为ENS 在 Ethereum blockchain 上运行,禁止密钥泄露、篡改其 原则上命名空间与篡改管理它的合约一样困难 和/或底层 blockchain。 (相比之下,DNS 历史上一直很脆弱 欺骗、劫持和其他攻击。) 我们已在 Ethereum 主网上向 ENS 注册了 data.eth,并打算 将其建立为根命名空间,在该根命名空间下 oracle 数据服务和 其他 Chainlink 网络实体驻留。 ENS 中的域是分层的,这意味着每个域都可能包含引用 其下的其他名称。 ENS 中的子域名可以作为组织和委托信任。 data.eth 的主要作用是作为链上目录服务 数据馈送。传统上,oracle 的开发者和用户使用链外资源 (例如,docs.chain.link 或 data.chain.link 等网站,或社交网络,例如 Twitter)发布并获取 oracle 数据源地址(例如 ETH-USD 价格 饲料)。使用高度可信的根命名空间(例如 data.eth),可以建立 eth-usd.data.eth 到例如 smart contract 地址的映射 用于 ETH-USD 价格反馈的链上 oracle 网络聚合器。这会 为任何人创建一条安全路径,将 blockchain 作为事实来源 该价格/名称对 (ETH-USD) 的数据源。因此,ENS 的这种使用 实现了链下数据源无法实现的两个好处: • 强大的安全性:对域的所有更改和更新都被永久记录 并以加密方式进行保护,而不是网站上的文本地址,这 不享有这两个安全属性。 • 自动链上传播:更新数据源的 smart contract 的底层地址可以触发传播到依赖智能的通知。 合同,例如可以自动更新相关合同 新地址.13 然而,像 ENS 这样的命名空间不会自动验证合法所有权 断言的名称。因此,例如,如果名称空间包含条目 ⟨“Acme Oracle Node Co.”,addr⟩, 那么用户就可以保证 addr 属于名称为 Acme 的声明者 Oracle Node Co. 没有围绕命名空间管理的额外机制, 然而,她无法保证该名称合法属于某个实体 在现实世界中,我们将其称为 Acme Oracle Node Co.。 我们验证名称的方法,即确保相应的、合法的现实世界实体拥有它们的所有权,依赖于几个组件。今天,Chainlink 实验室 实际上充当 Chainlink 网络的 CA。虽然 Chainlink 实验室将继续 为了验证名称,我们的 PKI 将通过两种方式演变成更加去中心化的模型: • 信任网络模型:分层 PKI 的去中心化版本通常被称为信任网络。14 自 20 世纪 90 年代以来就已经提出了各种变体, 例如,[98],并且许多研究人员观察到 blockchain 可以通过以全局一致的方式记录证书来促进该想法的使用,例如 [227] 分类帐。我们正在探索该模型的变体来验证实体的身份 以更加去中心化的方式存在于 Chainlink 网络中。 13从属合同可以选择包括预定的延迟,以允许手动检查 以及依赖合同管理员的干预。 14 Phil Zimmermann 为 PGP [238] 创造的术语。• 与验证数据的链接:如今,大量oracle 节点性能数据在链上可见,因此存档绑定到节点地址。 此类数据可被视为通过提供其(可靠)参与网络的历史证据来丰富 PKI 中的身份。另外,工具 用于基于 DECO 和 Town Crier [160] 启用节点的去中心化身份 积累来自现实世界数据的凭证。仅举一个例子, 节点操作员可以将凭证附加到其 PKI 身份以证明拥有权 邓白氏评级。这些补充形式的验证可以 补充 staking 以确保网络安全。具有既定现实世界身份的 oracle 节点可能被视为拥有权益 在一个源于其声誉的系统中。 (参见第 4.3 节和第 9.6.3 节。) Chainlink PKI 的最终要求是安全引导,即安全地 发布 Chainlink 网络的根名称,当前为 data.eth (类似地 到浏览器中顶级域的硬连线)。换句话说,Chainlink 用户如何 确定 data.eth 确实是与 Chainlink 关联的顶级域 项目? Chainlink 网络解决这个问题的方法是多管齐下的 可能涉及: • 将 TXT 记录 [224] 添加到指定的 chain.link 域记录中 data.eth 作为 Chainlink 生态系统的根域。 (Chainlink 因此隐式利用互联网域的 PKI 来验证其根 ENS 域。) • 从 Chainlink 的现有网站链接到 data.eth,例如来自 https://docs.chain.link. (另一种隐式使用 PKI 的互联网域。) • 通过各种文档(包括本白皮书)让人们了解 data.eth 的使用。 • 在我们的社交媒体渠道(例如 Twitter)上公开发布 data.eth,以及 Chainlink 博客 [18]。 • 将大量LINK置于同一注册者地址的控制之下 作为 data.eth。

DON Deployment Considerations

DON Deployment Considerations

While not a part of our core design, there are several important technical considerations in the realization of DONs that deserve treatment here.

8.1 Rollout Approach This paper lays out an ambitious vision of advanced Chainlink functionality whose realization will require solutions to many challenges along the way. This whitepaper identifies some challenges, but unanticipated ones are sure to arise. We plan to implement elements of this vision in an incremental fashion over an extended period of time. Our expectation is that DONs will initially launch with support for specific pre-built components built collaboratively by teams within the Chainlink community. The intention is that broader uses of DONs, e.g., the ability to launch arbitrary executables, will see support at a later time. One reason for such caution is that composition of smart contracts can have complex, unintended, and dangerous side effects, as recent flash-loan-based attacks have for instance shown [127, 189]. Similarly, composition of smart contracts, adapters, and executables will require extreme care. In our initial deployment of DONs, we plan to include only a pre-built set of templatized executables and adapters. This will enable study of the compositional security of these functionalities using formal methods [46, 170] and other approaches. It will also simplify pricing: Functionality pricing can be established by DON nodes on a perfunctionality basis, rather than through generalized metering, an approach adopted in, e.g., [156]. We also expect the Chainlink community to take part in the creation of additional templates, combining various adapters and executables into increasingly useful decentralized services that can be run by hundreds, if not thousands of individual DONs. Additionally, this approach can help prevent state bloat, i.e., the need for DON nodes to retain an unworkable amount of state in working memory. This problem is already arising in permissionless blockchains, motivating approaches such as “stateless clients” (see, e.g., [206]). It can be more acute in higher throughput systems, motivating an approach in which a DON deploys only state-size-optimized executables. As DONs evolve and mature and include robust guard rails, as discussed in Section 7, cryptoeconomic and reputation-based security mechanisms as discussed in Section 9, and other features that provide a high degree of assurance for DON users, we also expect to develop a framework and tools to facilitate broader launch and use of DONs by the community. Ideally, these tools will enable a collection of node operators to come together as an oracle network and launch their own DONs in a permissionless or self-service manner, meaning that they can do so unilaterally. 8.2 Dynamic DON Membership The set of nodes running a given DON may change over time. There are two approaches to key management for skL given dynamic membership in O. The first is to update shares of skL held by the nodes upon changes in membership, while keeping pkL unchanged. This approach, explored in [41, 161, 198], has the merit of not requiring that relying parties update pkL.

The classical technique of share resharing, introduced in [122], provides a simple and efficient way of realizing such share updates. It enables a secret to be transferred between one set of nodes O(1) and a second, possibly intersecting one O(2). In this approach, each node O(1) i performs a (k(2), n(2)) secret sharing of its secret share across nodes in O(2) for n(2) = |O(2)| and desired (possibly new) threshold k(2). Various verifiable secret sharing (VSS) schemes [108] can provide security against an adversary that actively corrupts nodes, i.e., introduces malicious behavior into the protocol. Techniques in [161] aim to do so while reducing communication complexity and providing resilience against failures in cryptographic hardness assumptions. A second approach is to update the ledger key pkL. This has the benefit of forward security: Compromise of old shares of pkL (i.e., former committee nodes) would not result in compromise of the current key. Updates to pkL, however, carry two drawbacks: (1) Data encrypted under pkL needs to be re-encrypted during a key refresh and (2) Key updates need to be propagated to relying parties. We intend to explore both approaches, as well as hybridizations of the two. 8.3 DON Accountability As with existing Chainlink oracle networks, DONs will include mechanisms for accountability, i.e., recording, monitoring, and enforcing correct node behavior. DONs will have much more substantial data capacity than many existing permissionless blockchains, particularly given their ability to connect to external decentralized storage. Consequently, they will be able to record nodes’ performance history in detail, allowing for more fine-grained accountability mechanisms. For example, off-chain computation of asset prices may involve inputs that are discarded before a median result is sent on chain. In a DON, these intermediate results could be recorded. Misbehavior or performance lapses by individual nodes in a DON can thus be remedied or penalized on the DON in a fine-grained way. We have additionally discussed approaches to building guard rails in Section 7.3 that address the contract-specific impact of systemic failures. It is also important, however, to have failsafe mechanisms for DONs themselves, i.e., protections against systemic, potentially catastrophic DON failures, specifically forking / equivocation and service-level agreement (SLA) failures, as we now explain. Forking / equivocation: Given sufficiently many faulty nodes, a DON can fork or equivocate, producing two distinct, inconsistent blocks or sequences of blocks in L. Because a DON digitally signs the contents of L, however, it is possible to leverage a main chain MAINCHAIN to prevent and/or penalize equivocation. The DON can periodically checkpoint state from L in an audit contract on MAINCHAIN. If its future state deviates from a checkpointed state, a user / auditor can present proof of this misbehavior to the audit contract. Such proof can be used to generate an alert or penalize DON nodes via slashing in the contract. This latter approach introduces an incentive design problem similar to that for specific oracle feeds, and can build on our work outlined in Section 9.

Enforcing service-level agreements: While DONs are not necessarily meant to run indefinitely, it is important that they adhere to service level agreements (SLAs) with their users. Basic SLA enforcement is possible on a main chain. For example, DON nodes might commit to maintaining the DON until a certain date, or to providing advance notice of service termination (e.g., three months’ notice). A contract on MAINCHAIN can provide basic cryptoeconomic SLA enforcement. For example, the SLA contract can slash DON-deposited funds if checkpoints are not provided at required intervals. A user can deposit funds and challenge the DON to prove that a checkpoint correctly represents a sequence of valid blocks (in a manner analogous to, e.g. [141]). Of course, block production does not equate with transaction processing, but the SLA contract can also serve to enforce the latter. For example, in the legacy-compatible version of FSS in which transactions are fetched from the mempool (see Section 5.2), transactions are eventually mined and placed on chain. A user can prove DON malfeasance by furnishing the SLA contract with a transaction that was mined but wasn’t transmitted by the DON for processing by the target contract within the appropriate interval of time.15 It is also possible to prove the existence of and penalize more fine-grained SLA failures, including errors in computation using executables (via, e.g., the mechanisms for proving correct off-chain state transactions outlined in Section 6.3) or failure to run executables based on initiators visible on a DON, failure to relay data on the DON to MAINCHAIN in a timely way, and so forth.

DON 部署注意事项

虽然不是我们核心设计的一部分,但有几个重要的技术考虑因素 实现 DON 值得在这里处理。

8.1 推出方法 本文提出了先进 Chainlink 功能的雄心勃勃的愿景,其 实现这一目标需要解决沿途的许多挑战。本白皮书 指出了一些挑战,但肯定会出现意想不到的挑战。 我们计划以渐进的方式实施这一愿景的要素 延长的一段时间。 我们的期望是 DONs 最初将与 支持由内部团队协作构建的特定预构建组件 Chainlink 社区。目的是更广泛地使用 DONs,例如能够 启动任意可执行文件,稍后会看到支持。 如此谨慎的原因之一是 smart contract 的组成可能会产生复杂的、意想不到的和危险的副作用,因为最近基于闪电贷的攻击已经 例如[127, 189]所示。同样,smart contract、适配器和 可执行文件需要格外小心。 在 DONs 的初始部署中,我们计划仅包含一组预构建的模板化可执行文件和适配器。这将使成分安全性的研究成为可能 使用形式化方法 [46, 170] 和其他方法来构建这些功能。它将 还简化了定价:功能定价可以由 DON 节点在功能基础上建立,而不是通过通用计量(采用的一种方法) 例如,[156]。我们还期望 Chainlink 社区参与创建 额外的模板,将各种适配器和可执行文件组合成越来越多的 有用的去中心化服务可以由数百甚至数千个人运行 DONs。 此外,这种方法可以帮助防止状态膨胀,即需要 DON 节点在工作内存中保留无法工作的状态量。这个问题是 已经在无许可的 blockchain 中出现,激励诸如“无状态 客户”(例如,参见 [206])。在吞吐量较高的系统中,它可能会更加严重,从而激励 DON 仅部署状态大小优化的可执行文件的方法。 随着 DON 的发展和成熟,并包括第 7 节中讨论的强大护栏、第 9 节中讨论的加密经济和基于声誉的安全机制,以及为 DON 用户提供高度保证的其他功能,我们 还期望开发一个框架和工具,以促进更广泛的启动和使用 社区的 DONs。理想情况下,这些工具将支持节点运营商的集合 作为一个 oracle 网络聚集在一起,并在未经许可的情况下启动他们自己的 DON 或自助服务方式,这意味着他们可以单方面这样做。 8.2 动态 DON 会员资格 运行给定 DON 的节点集可能会随时间而变化。有两种方法 给定 O 中的动态成员资格的 skL 的密钥管理。 第一个是在成员资格发生变化时更新节点持有的 skL 份额, 同时保持 pkL 不变。 [41,161,198]中探讨的这种方法具有以下优点 不要求依赖方更新 pkL。[122] 中介绍的共享重新共享的经典技术提供了一种简单的方法 以及实现此类共享更新的有效方法。它可以传输秘密 在一组节点 O(1) 和第二组节点之间,可能与一个 O(2) 相交。在这个 方法,每个节点 O(1) 我 执行 (k(2), n(2)) 秘密共享其秘密共享 n(2) = |O(2)| 的 O(2) 中的节点和期望的(可能是新的)阈值 k(2)。各种可验证秘密共享 (VSS) 方案 [108] 可以针对以下对手提供安全保护: 主动破坏节点,即在协议中引入恶意行为。 [161] 中的技术旨在做到这一点,同时降低通信复杂性并提供 针对密码硬度假设失败的弹性。 第二种方法是更新账本密钥 pkL。这样做的好处是可以向前推进 安全性:pkL 的旧份额(即前委员会节点)不会受到损害 导致当前密钥的泄露。然而,pkL 的更新有两个缺点: (1) 在 pkL 下加密的数据需要在密钥刷新期间重新加密,并且 (2) 密钥更新需要传播给依赖方。 我们打算探索这两种方法以及两者的混合。 8.3 DON 责任 与现有的 Chainlink oracle 网络一样,DON 将包括问责机制,即记录、监控和强制执行正确的节点行为。 DONs 将有 比许多现有的无需许可的 blockchain 拥有更多的数据容量, 特别是考虑到它们连接到外部分散存储的能力。因此,他们将能够详细记录节点的性能历史记录,从而允许 更细粒度的问责机制。例如,链外计算 资产价格可能涉及在发送中值结果之前被丢弃的输入 链。在 DON 中,可以记录这些中间结果。因此,DON 中各个节点的不当行为或性能失误可以在 DON 以细粒度的方式。我们还讨论了构建方法 第 7.3 节中的防护栏解决了系统故障的特定于合约的影响。 然而,为 DON 本身提供故障安全机制也很重要, 即针对系统性、潜在灾难性 DON 故障的保护,特别是 正如我们现在所解释的,分叉/模棱两可和服务级别协议 (SLA) 失败。 分叉/模棱两可: 给定足够多的故障节点,DON 可以分叉 或模棱两可,在 L 中产生两个不同的、不一致的块或块序列。 然而,因为 DON 对 L 的内容进行数字签名,所以可以利用 主链 MAINCHAIN 来防止和/或惩罚模棱两可。 DON 可以定期检查主链上审计合约中 L 的状态。 如果其未来状态偏离检查点状态,用户/审计员可以提供证据 审计合同中的这种不当行为。此类证据可用于生成警报 或者通过合约中的削减来惩罚 DON 节点。后一种方法引入了 类似于特定 oracle feed 的激励设计问题,并且可以建立在 我们的工作在第 9 节中概述。执行服务级别协议: 虽然 DONs 并不一定意味着 无限期运行,遵守服务级别协议 (SLA) 非常重要 与他们的用户。在主链上可以执行基本的 SLA。例如, DON 节点可能承诺维护 DON 直到某个日期,或提前提供服务终止通知(例如,提前三个月通知)。合同于 MAINCHAIN 可以提供基本的加密经济 SLA 执行。 例如,如果检查点是,SLA 合约可以削减 DON 存入的资金 未按要求的时间间隔提供。用户可以存入资金并质疑 DON 证明检查点正确地表示一系列有效块(以某种方式 类似于,例如[141])。当然,出块并不等于交易 处理,但 SLA 合同也可以用于执行后者。例如,在 FSS 的传统兼容版本,其中交易从内存池中获取(参见第 5.2 节),交易最终被挖掘并放置在链上。一个用户 可以通过向 SLA 合约提供以下交易来证明 DON 渎职行为: 已开采,但未由 DON 传输以供目标合约处理 在适当的时间间隔内。15 还可以证明更细粒度的 SLA 的存在并对其进行惩罚 失败,包括使用可执行文件的计算错误(例如,通过机制 用于证明第 6.3 节中概述的正确的链下状态交易)或运行失败 基于 DON 上可见的启动器的可执行文件,无法将 DON 上的数据中继到 及时进行MAINCHAIN等等。

Economics and Cryptoeconomics

Economics and Cryptoeconomics

For the Chainlink network to achieve strong security within a decentralized trust model, it is essential that nodes collectively exhibit correct behavior, meaning that they adhere a majority of the time exactly to DON protocols. In this section, we discuss approaches to helping enforce such behavior by means of economic incentives, a.k.a. cryptoeconomic incentives. These incentives fall into two categories: explicit and implicit, realized respectively through staking and future fee opportunity (FFO). Staking: Staking in Chainlink, as in other blockchain systems, involves network participants, i.e., oracle nodes, depositing locked funds in the form of LINK tokens. These funds, which we also refer to as stake or explicit stake are an explicit incentive. They are subject to forfeiture upon node failure or malfeasance. In the blockchain context, this procedure is often called slashing. Staking by oracle nodes in Chainlink, however, differs fundamentally from staking by validators in permissionless blockchains. Validators can misbehave by equivocating or adversarially ordering transactions. The underlying consensus protocol in a 15As users can replace transactions in the mempool, care is required to ensure a correct correspondence between the mined and DON-submitted transactions.

permissionless blockchain, though, uses hard-and-fast block-validation rules and cryptographic primitives to prevent validators from generating invalid blocks. In contrast, programmatic protections cannot prevent a cheating oracle network from generating invalid reports. The reason is a key difference between the two types of system: transaction validation in blockchains is a property of internal consistency, while the correctness of oracle reports on a blockchain is a property of external, i.e., off-chain data. We have designed a preliminary staking mechanism for the Chainlink network based on an interactive protocol among oracle nodes that may make use of external data. This mechanism creates financial incentives for correct behavior using explicit rewards and penalties (slashing). As the mechanism is economic, it is designed to prevent node corruption by an adversary that uses financial resources to corrupt nodes by means of bribery. (Such an adversary is very general, and extends, e.g., to nodes cooperating to extract value from their collective misbehavior.) The Chainlink staking mechanism we have designed has some powerful and novel features.16 The main such feature is super-linear staking impact (specifically, quadratic). An adversary must have resources considerably in excess of nodes’ deposited funds in order to subvert the mechanism. Our staking mechanism additionally provides protection against a stronger adversary than previously considered in similar systems, namely an adversary that can create bribes conditioning on nodes’ future behavior. Additionally, we discuss how Chainlink tools such as DECO can help strengthen our staking mechanism by facilitating correct adjudication in the case of faulty node behavior. Future fee opportunity (FFO): Permissionless blockchains—of both the PoW and PoS variety—today rely critically on what we call implicit incentives. These are economic incentives for honest behavior that derive not from explicit rewards, but from platform participation itself. For example, the Bitcoin miner community is incentivized against mounting a 51% attack by the risk of undermining confidence in Bitcoin, depressing its value, and consequently eroding the value of their collective capital investments in mining infrastructure [150]. The Chainlink network benefits from a similar implicit incentive that we refer to as future fee opportunity (FFO). Oracle nodes with strong performance histories or reputations attract fees from users. Misbehavior by an oracle node jeopardizes future fee payments and thus penalizes the node with an opportunity cost in terms of potential revenue earned through participation in the network. By analogy with explicit stake, FFO may be viewed as a form of implicit stake, an incentive for honest behavior that derives from the shared benefit of maintaining confidence in the platform on which node operators’ business depends, i.e., the positive performance and reputation of the network. This incentive is inherent in but not explicitly expressed in Chainlink network protocols. In Bitcoin, maintaining the value of mining operations as mentioned above 16The staking mechanism we describe here currently aims only to enforce delivery of correct reports by oracle networks. We expect in future work to extend it to ensure correct execution of the many other functionalities DONs will provide.

may similarly be viewed as a form of implicit stake. We emphasize that FFO already exists in Chainlink and helps secure the network today. Our main contribution in the further development of Chainlink will be a principled, empirically driven approach to evaluating implicit incentives such as FFO through what we call the Implicit-Incentive Framework (IIF). To estimate quantities such as the future fee opportunity of nodes, the IIF will draw continuously on the comprehensive performance and payment data amassed by the Chainlink network. Such estimates will enable IIF-based parameterization of staking systems that reflects node incentives with greater accuracy than current heuristic and/or static models. To summarize, then, the two main economic incentives for correct oracle node behavior in the developing Chainlink network will be: • Staking (deposited stake) o Explicit incentive • Future fee opportunity (FFO) o Implicit incentive These two forms of incentive are complementary. Oracle nodes can simultaneously participate in the Chainlink staking protocol, enjoy an ongoing revenue stream from users, and collectively benefit from their continued good behavior. Thus both incentives contribute to the cryptoeconomic security provided by an oracle network. Additionally, the two incentives can reinforce and/or be traded offagainst one another. For example, a new oracle operator without a performance history and revenue stream can stake a large quantity of LINK as a guarantee of honest behavior, thereby attracting users and fees. Conversely, an established oracle operator with a long, relatively fault-free performance history can charge substantial fees from a large user base and thus rely more heavily on its FFO as a form of implicit incentive. In general, the approach we consider here aims for a given amount of oracle-network resource to create the greatest possible economic incentives in Chainlink for rational agents—i.e., nodes maximizing their financial utility—to behave honestly. Put another way, the goal is to maximize the financial resources required for an adversary to attack the network successfully. By formulating a staking protocol with mathematically well defined economic security and also using the IIF, we aim to measure the strength of Chainlink’s incentives as accurately as possible. The creators of relying contracts will then be able to determine with strong confidence whether an oracle network meets their required levels of cryptoeconomic security. The virtuous cycle of economic security: The incentives we discuss in this section, staking and FFO, have an impact beyond their reinforcement of the security of DONs. They promise to induce what we call a virtuous cycle of economic security. Super-linear staking impact (and other economies of scale) result in lower operational cost as a DON’s security grows. Lower cost attracts additional users to the DON,

boosting fee payments. A rise in fee payments continues to incentivize growth of the network, which perpetuates the virtuous cycle. We believe that the virtuous cycle of economic security is just one example of an economy of scale and network effect among others that we discuss later in this section. Section organization: Staking presents notable technical and conceptual challenges for which we have designed a mechanism with novel features. Staking will therefore be our main focus in this section. We give an overview of the staking approach we introduce in this paper in Section 9.1, followed by detailed discussion in Sections 9.2 to 9.5. We present the IFF in Section 9.6. We present a summary view of Chainlink network incentives in Section 9.7. In Section 9.8, we discuss the virtuous cycle of economic security our proposed staking approach can bring to oracle networks. Finally, we briefly describe other potential effects propelling growth of the Chainlink network in Section 9.9. 9.1 Staking Overview The staking mechanism design we introduce here, as noted above, involves an interactive protocol among oracle nodes allowing for resolution of inconsistencies in the reporting of external data. Staking aims to ensure honest behavior from rational oracle nodes. We can therefore model an adversary attacking a staking protocol as a briber: The adversary’s strategy is to corrupt oracle nodes using financial incentives. The adversary may derive financial resources prospectively from successfully tampering with an oracle report, e.g., offer to share the resulting profit with corrupted nodes. We aim in our staking mechanism design simultaneously at two ambitious goals: 1. Resisting a powerful adversary: The staking mechanism is designed to protect oracle networks against a broad class of adversaries that are capable of complex, conditional bribing strategies, including prospective bribery, which offers bribes to oracles whose identities are determined after the fact (e.g., offers bribes to oracles randomly selected for high-priority alerting). While other oracle designs have considered a narrow set of attacks without the full capabilities of a realistic adversary, to the best of our knowledge the adversarial mechanism we introduce here is the first to explicitly address a broad set of bribing strategies and show resistance in this model. Our model assumes that nodes besides the attacker are economically rational (as opposed to honest), and we assume the existence of a source of truth that is prohibitively expensive for typical usage but is available in case of disagreement (discussed further below). 2. Achieving super-linear staking impact: Our aim is to ensure that an oracle network composed of rational agents reports truthfully even in the presence of an attacker with a budget that is super-linear

in the total stake deposited by the entire network. In existing staking systems, if each of n nodes stakes $d, an attacker can issue a credible bribe which requests that nodes behave dishonestly in exchange for a payment of slightly more than \(d to each node, using a total budget of about \)dn. This is already a high bar as the attacker has to have a liquid budget on the order of the combined deposits of all stakers in the network. Our goal is a still stronger degree of economic security than this already substantial hurdle. We aim to design the first staking system that can achieve security for a general attacker with a budget super-linear in n. While practical considerations may achieve a lower impact, as we discuss below, our preliminary design achieves an adversarial budget requirement greater than $dn2/2, i.e., scaling quadratic in n, rendering bribery largely impractical even when nodes stake only moderate amounts. Reaching these two goals requires an innovative combination of incentive design and cryptography. Key ideas: Our staking approach hinges on an idea we call watchdog priority. A report generated by a Chainlink oracle network and sent to a relying contract (e.g., on an asset price) is aggregated from individual reports contributed by participating nodes (e.g., by taking the median). Typically a service-level agreement (SLA) specifies acceptable bounds of deviation for reports, i.e., how far a node’s report can deviate from the aggregate report and how far the aggregate should be permitted to deviate from the true value to be considered correct. In our staking system, for a given reporting round, each oracle node can act as a watchdog to raise an alert if it believes the aggregate report is incorrect. In each reporting round, each oracle node is assigned a public priority that determines the order in which its alert (if any) will be processed. Our mechanism aims at reward concentration, meaning that the highest-priority watchdog to raise an alert earns the entire reward yielded by confiscating the deposits of faulty nodes. Our staking system designs involve two tiers: the first, default tier, and the second, backstop tier. The first tier is the oracle network itself, a set of n nodes. (For simplicity, we assume n is odd.) If a majority of nodes report incorrect values, a watchdog in the first tier is strongly incentivized to raise an alert. If an alert is raised, the reporting decision of the network is then escalated to a second tier—a high-cost, maximumreliability system that can be user-specified in the network service-level agreement. This could be a system which, for example, is composed only of nodes with strong historical reliability scores, or one that has an order of magnitude more oracles than the first tier. Additionally, as discussed in Section 9.4.3, DECO or Town Crier can serve as powerful tools to help ensure efficient and conclusive adjudication in the second tier. For simplicity we thus assume that this second-tier system arrives at a correct report value. While it might seem attractive just to rely on the second tier to generate all reports, the benefit of our design is that it consistently achieves the security properties of the

second-tier system while only paying the operating cost, in the typical case, of the first-tier system. Watchdog priority results in super-linear staking impact in the following way: if the first-tier oracle network outputs an incorrect result and a number of watchdog nodes alert, the staking incentive mechanism rewards the highest-priority watchdog with more than $dn/2 drawn from the deposits of the (majority) misbehaving nodes. The total reward is thus concentrated in the hands of this single watchdog, which therefore determines the minimum that an adversary must promise a potential watchdog to incentivize it not to alert. Since our mechanism ensures that every oracle gets the chance to act as watchdog if the higher-priority watchdogs have accepted their bribes (and chosen not to alert), the adversary must therefore offer a bribe of more than $dn/2 to every node to prevent any alert being raised. Since there are n nodes, the adversary’s requisite budget for a successful bribe amounts to more than $dn2/2, which is quadratic in the number n of nodes in the network. 9.2 Background Our approach to staking draws on research in the fields of game theory and mechanism design (MD) (for a textbook reference, see [177]). Game theory is the mathematically formalized study of strategic interaction. In this context, a game is a model of such an interaction, typically in the real world, that codifies sets of actions available to participants in the game, known as players. A game also specifies the payoffs obtained by the individual players—rewards that depend on a player’s chosen actions and the actions of the other players. Perhaps the best known example of a game studied in game theory is the Prisoners’ Dilemma [178]. Game theorists generally aim to understand the equilibrium or equilibria (if any) represented in a given game. An equilibrium is a set of strategies (one for each player) such that no one player can obtain a higher payoffby unilaterally deviating from its strategy. Mechanism design, meanwhile, is the science of designing incentives such that the equilibrium of an interaction (and its associated game) has some desirable property. MD may be viewed as the inverse of game theory: The canonical question in game theory is, “given the incentives and model, what will the equilibrium be?” In MD, the question is instead, “what incentives will result in a game with a desirable equilibrium?” A typical goal of a mechanism designer is to create an ‘incentive compatible’ mechanism, meaning that participants in the mechanism (e.g., an auction or other information elicitation system [228]) are incentivized to report the truth on some matter (e.g., how much they value a particular item). The Vickrey (second-price) auction is perhaps the best known incentive compatible mechanism, in which participants submit sealed bids for an item and the highest bidder wins the item but pays the second-highest price [214]. Cryptoeconomics is a domain-specific form of MD that leverages cryptographic techniques to create desirable equilibria within decentralized systems. Bribery and collusion create significant challenges throughout the field of MD. Almost all mechanisms break in the presence of collusion, defined as side contracts be-

tween the parties participating in a mechanism [125, 130]. Bribery, in which an external party introduces novel incentives into the game, presents an even tougher problem than does collusion; collusion may be viewed as a special case of bribery among game participants. Blockchain systems can often be conceptualized as games with monetary (cryptocurrencybased) payoffs. A simple example is Proof-of-Work mining: miners have an action space in which they can choose the hashrate with which to mine for blocks. The payoffof mining is a guaranteed negative reward (cost of electricity and equipment) plus a stochastic positive reward (mining subsidy) that depends on the number of other active miners [106, 172] and transaction fees. Crowdsourced oracles like SchellingCoin [68] are another example: the action space is the set of possible reports an oracle may send, while the payoffis the reward specified by the oracle mechanism, e.g., payment might depend on how close an oracle’s report is to the median of the other reports [26, 68, 119, 185]. Blockchain games offer ripe opportunities for collusion and bribery attacks; indeed, smart contracts can even facilitate such attacks [96, 165]. Perhaps the best known bribery attack on crowdsourced oracles is the p-plus-epsilon attack [67]. This attack arises in the context of a SchellingCoin-like mechanism in which players submit booleanvalued reports (i.e., false or true) and are rewarded with p if they agree with the majority submission. In a p-plus-epsilon attack, the attacker credibly promises to, e.g., pay users $p + ϵ for voting false if and only if the majority submission is true. The result is an equilibrium, in which all players are incentivized to report false irrespective of what other players do; consequently, the briber can induce the nodes through its promised bribe to report false without actually paying the bribe (!). Exploration of other briber strategies in the context of oracles, however—and particularly oracles that are not crowdsourced—has been limited to fairly weak adversarial models. For example, in the PoW setting, researchers have studied outcome-contingent bribes, i.e., bribes paid only if a target message is successfully censored and does not appear in a block, irrespective of an individual miner’s action [96, 165]. In the case of oracles, however, other than the p-plus-epsilon attack, we are aware only of work in a strictly limited model of bribery in which a briber sends a bribe conditioned on an individual player’s action, not on the resulting outcome. Here we sketch designs of information-elicitation mechanisms that remain incentive compatible even in a strong adversarial model, as described in the next subsection. 9.3 Modeling Assumptions In this subsection, we explain how we model the behavior and capabilities of players in our system, specifically first-tier oracle nodes, nodes in the second-tier (adjudication) layer, and adversaries.

9.3.1 First-Tier Incentive Model: Rational Actors Many blockchain systems rely for security on the assumption of some number of honest participating nodes. Nodes are defined to be honest if they follow the protocol even when it is not in their financial interest to do so. Proof-of-Work systems typically require the majority of hash power to be honest, Proof-of-Stake systems typically require \(2/3\) or more of all participating stake to be honest, and even layer-2 systems like Arbitrum [141] require at least a single honest participant. In modeling for our staking mechanism, we make a much weaker assumption. (To be clear, weaker assumptions mean stronger security properties and are therefore preferable.) We assume that the adversary has corrupted, i.e., controls, some (minority) fraction of first-tier oracle nodes. We model the remaining nodes not as honest agents, but as rational expected-utility maximizers. These nodes act entirely according to selfinterested financial incentives, choosing actions that result in an expected financial gain. For example, if a node is offered a bribe larger than the reward resulting from honest behavior, it will accept the bribe. Note on adversarial nodes: In accordance with the trust modeling common for decentralized systems, we assume that all nodes are rational, i.e., seeking to maximize net revenue, rather than controlled by a malicious adversary. Our claims, however— specifically super-linear or quadratic staking impact—hold asymptotically provided that the set of adversarially controlled nodes is at most \((1/2 - c)n\), for some positive constant \(c\). 9.3.2 Second-Tier Adjudication Model: Correctness by Assumption Recall that a critical feature of our staking mechanism that helps achieve security against rational nodes is its second-tier system. In our proposed staking mechanism, any oracle may raise an alert indicating that it believes the output of the mechanism is incorrect. An alert results in a high-trust second-tier system activating and reporting the correct result. Thus, a key modeling requirement for our approach is correct adjudication, i.e., correct reporting by the second-tier system. Our staking model assumes a second-tier system that acts as an incorruptible, maximally reliable source of truth. Such a system is likely to be expensive and slow, and thus inappropriate for use for the typical case. In the equilibrium case, however, i.e., when the first-tier system functions correctly, the second-tier system will not be invoked. Instead, its existence boosts the security of the whole oracle system by providing a high-assurance backstop. The use of a high-trust, high-cost adjudication layer resembles the appeals process at the heart of most judicial systems. It is also already common in the design of oracle systems, e.g., [119, 185]. We briefly discuss approaches to realization of the second tier in our mechanism in Section 9.4.3.

Our staking protocol uses the assumed correct adjudication of the second-tier system as a credible threat to enforce correct reporting by oracle nodes. The protocol confiscates part or all of the stake of oracle nodes that generate reports identified by the second-tier system as incorrect. Oracle nodes are thus deterred from misbehaving by the resulting financial penalty. This approach is similar in flavor to that used in optimistic rollups, e.g., [141, 10]. 9.3.3 Adversarial Model Our staking mechanism is designed to elicit truthful information while achieving security against a broad, well-defined class of adversaries. It improves upon prior works, which either omit an explicit adversarial model or focus on narrow sub-classes of adversaries, e.g., the p-plus-epsilon adversary discussed above. Our goal is to design a staking mechanism with formally proven security against the full spectrum of adversaries likely to be encountered in practice. We model our adversary as having a fixed (parameterizable) budget, denoted by $B. The adversary can communicate individually and confidentially with each oracle in the network, and can secretly offer any individual oracle guaranteed payment of a bribe contingent on publicly observable outcomes of the mechanism. Outcomes determining bribes can include, for example, the value reported by the oracle, any public messages sent by any oracle to the mechanism (e.g., an alert), the values reported by other oracles, and the value output by the mechanism. No mechanism can secure against an attacker with unlimited capabilities. We therefore consider some behaviors as unrealistic or out-of-scope. We assume our attacker cannot break standard cryptographic primitives, and, as noted above, has a fixed (if potentially large) budget $B. We further assume that the adversary does not control communication in the oracle network, specifically that it cannot substantially delay traffic between first-tier and/or second-tier nodes. (Whether the adversary can observe such communication depends on the particular mechanism, as we explain below.) Informally, however, as noted above, we assume that the adversary can: (1) Corrupt a fraction of oracle nodes (\((1/2 - c)\)-fraction for some constant \(c\)), i.e., fully control them, and (2) Offer bribes to any desired nodes, with guaranteed payment contingent on outcomes specified by the adversary, as described above. While we don’t offer a formal model or complete taxonomy of the adversary’s full range of bribing capabilities in this whitepaper, here are examples of the kinds of bribers encompassed by our model. For simplicity, we assume that oracles emit Boolean reports whose correct value (w.l.o.g.) is true, and that a final outcome is computed as an aggregate of these reports to be used by a consuming smart contract. The briber’s aim is for the final outcome to be incorrect, i.e., false. • Unconditional briber: Briber offers bribe $b to any oracle that reports false. • Probabilistic briber: Briber offers bribe $b with some probability q to any oracle that reports false.

• false-outcome conditioned briber: Briber offers bribe $b to any oracle that reports false provided that the final outcome is false. • No-alert-conditioned briber: Briber offers bribe $b to any oracle that reports false as long as no alert is raised. • p-plus-epsilon Briber: Briber offers bribe $b to any oracle that reports false as long as the majority of oracles do not report false. • Prospective briber: Briber offers bribe $b in advance to whichever oracle is selected for a randomized role and reports false. In our proposed staking protocol, all nodes act as potential watchdogs, and we are able to show that randomization of watchdog priorities does not lend itself to prospective bribery. Many proofof-work, proof-of-stake, and permissioned systems are susceptible to prospective bribery, however, which shows the importance of considering it in our adversarial model and ensuring that our staking protocols are resilient to it. See Appendix E for more details. 9.3.4 How Much Cryptoeconomic Security Is Enough? A rational adversary will only spend money to attack a system if it can obtain a profit larger than its expenditure. Thus for our adversarial model and proposed staking mechanism, $B may be viewed as a measure of the potential profit an adversary is able to extract from relying smart contracts by corrupting an oracle network and causing it to generate an incorrect report or set of reports. In deciding whether an oracle network offers a sufficient degree of cryptoeconomic security for their purposes, a user should assess the network from this perspective. For plausible adversaries in practical settings, we expect that $B will generally be substantially smaller than the total assets in relying smart contracts. In most cases, it is infeasible for an adversary to extract these assets in their totality. 9.4 Staking Mechanism: Sketch Here we present the main ideas and general structure of the staking mechanism we are currently considering. For ease of presentation, we describe a simple but slow (multi-round) protocol in this subsection. We note, however, that this scheme is quite practical. Given the economic assurances provided by the mechanism, i.e., the penalization of and consequent incentive against faulty nodes, many users may be willing to accept reports optimistically. In other words, such users may accept reports prior to potential adjudication by the second tier. Users unwilling to accept reports optimistically can choose to wait until the protocol execution terminates, i.e., until any potential escalation to the second tier occurs. This, however, can substantially slow the confirmation time for reports. We therefore briefly

Schematic of Chainlink staking scheme with alerting showing watchdog escalation and penalty mechanisms

Figure 15: Schematic of staking scheme with alerting. In this example, 1⃝a majority of nodes are corrupted / bribed and emit an incorrect value ˜r, rather than the correct report value r. The watchdog node 2⃝sends an alert to the second-tier committee, which 3⃝determines and emits the correct report value r, resulting in corrupted nodes forfeiting their deposits—each $d to the watchdog node 4⃝. outline some optimizations that result in a faster (single-round) if somewhat more complex design in Section 9.5. Recall that the first tier in our staking mechanism consists of the basic oracle network itself. The main structure of our mechanism, as described above, is that in each round, each node can act as a “watchdog” with some priority, and it thus has the ability to raise an alert if the mechanism arrives at an incorrect output ˜r, rather than a correct one r. This alert causes second-tier resolution, which we assume arrives at a correct report. Nodes with incorrect reports are punished, in the sense that their stakes are slashed and awarded to watchdogs. This basic structure is common in oracle systems, as in, e.g., [119, 185]. The key innovation in our design, mentioned briefly above, is that every node is assigned a distinct priority in the ordering of potential watchdogs. That is, watchdogs are given opportunities to alert in priority sequence. Recall that if a node has the highest priority to raise an alert, it receives the slashed deposit $d of every misbehaving node, for a total of more than \(dn/2 = \)d × n/2, as an incorrect report implies a majority of bad nodes. Consequently, the adversary must pay at least this reward to bribe an arbitrary node. Thus, to bribe a majority of nodes, the adversary must pay a large bribe to a majority of nodes, namely, strictly more than $dn2/2. We show schematically how alerting and watchdog escalation works in Fig. 15.

9.4.1 Further Mechanism Details The bribery-resistant system we now describe in further detail is a simplified sketch of the two-tiered construction we intend to build. Most of our focus will be on describing the first-tier network (henceforth simply “network” where clear from context) along with its incentive mechanism and the procedure for escalation to the second tier. Consider a Chainlink network composed of n oracle nodes that are responsible for regularly (e.g., once a minute) reporting a boolean value (e.g., whether the market capitalization of BTC exceeds that of ETH). As part of the staking mechanism, nodes must provide two deposits: a deposit $d subject to slashing in the event of disagreement with the majority and a watchdog deposit $dw subject to slashing in the event of a faulty escalation. We assume that the nodes cannot copy the submissions of other nodes, e.g., through a commit-reveal scheme as discussed in Section 5.3. In each round, nodes first commit to their report, and once all nodes have committed (or a timeout has expired), nodes reveal their reports. For each report to be generated, every node is also given a watchdog priority between 1 and n chosen at random, with 1 being top priority. This priority enables the concentration of reward in the hands of one watchdog. After all reports are public, an alerting phase ensues. Over a sequence of n (synchronous) rounds, the node with priority i has the opportunity to alert in round i. Let us consider the possible outcomes for the mechanism after nodes have revealed their reports. Again assuming a binary report, suppose the correct value is true and the incorrect one is false. Suppose also that the first-tier mechanism outputs the majority value output by nodes as the final report r. There are three possible outcomes in the mechanism: • Complete agreement: In the best case, nodes are in complete agreement: all nodes are available and have provided a timely report of the same value r (either true or false). In this case, the network need only forward r to relying contracts and reward each node with a fixed per-round payment $p, which is much smaller than $d. • Partial agreement: It is possible that some nodes are offline or there is disagreement about which value is correct, but most nodes report true and only a minority reports false. This case is also straightforward. The majority value (true) is computed, resulting in a correct report r. All nodes that reported r are rewarded with $p while the oracles that reported incorrectly have their deposits slashed modestly, e.g., by $10p. • Alert: In the event that a watchdog believes the output of the network is incorrect, it publicly triggers an alert, escalating the mechanism to the second-tier network. There are then two possible results: – Correct alert: If the second-tier network confirms that the output of the

Diagram showing how concentrated alerting rewards amplify the cost for a briber attempting to corrupt the oracle network

Figure 16: Amplifying briber’s cost through concentrated alerting rewards. A bribing adversary must bribe each node with more than the reward it stands to gain by alerting (shown as a red bar). If alerting rewards are shared, then this reward may be relatively small. Concentrated alerting rewards increase the reward that any single node may obtain (tall red bar). Consequently the total payout by the adversary for a viable bribe (gray regions) is much larger with concentrated than shared alerting rewards. first-tier network was incorrect, the alerting watchdog node receives a reward consisting of all slashed deposits, and thus more than $dn/2. – Faulty alert: If the second-tier and first-tier oracles agree, the escalation is deemed faulty and the alerting node loses its $dw deposit. In the case of optimistic acceptance of reports, watchdog alerts do not cause any change in execution of relying contracts. For contracts designed to await potential arbitration by the second-tier committee, watchdog alerts delay but do not freeze contract execution. It is also possible for contracts to designate a failover DON for periods of adjudication. 9.4.2 Quadratic Staking Impact The ability for every node to act as a watchdog, combined with strict node priority ensuring concentrated rewards, enables the mechanism to achieve quadratic staking impact for each kind of bribing attacker described in Section 9.3.3. Recall that this means specifically in our setting that, for a network with n nodes each with deposit $d, a successful briber (of any of the kinds above) must have a budget of bigger than $dn2/2. To be precise, the briber must corrupt at least (n+1)/2 nodes, since the briber must corrupt a majority of n nodes (for odd n, by assumption). Thus, a watchdog stands to earn a reward of $d(n + 1)/2. The briber consequently must pay this amount to every

node to ensure that none acts as a watchdog. We are working to show formally that if the briber has a budget of at most $d(n2 + n)/2, then the subgame perfect equilibrium of the game between the bribers and the oracles—in other words, the equilibrium at any point during the play of the game—is for the briber not to issue the bribe and for each oracle to report its true values honestly. We have explained above how it is possible that a successful briber could require a budget significantly larger than that of the sum of the node deposits. To illustrate this intuitive result, Fig. 16 shows the impact of concentrated alert rewards graphically. As we see there, if the reward for watchdog alerting—namely the deposits of bribed nodes reporting false)—were split among all potential alerting, the total amount that any individual alerting node could expect would be relatively small, on the order of $d. A briber, knowing that a payout of larger than $d was improbable, could use a false-outcome conditional bribe to bribe each of n nodes with slightly more than $d + ϵ. Counterintuitively, Fig. 16 shows that a system that distributes a reward broadly among nodes signaling an alert is far weaker than one that concentrates the reward in the hands of a single watchdog. Example parameters: Consider a (first-tier) network with n = 100 nodes, each depositing \(d = \)20K. This network would have a total of $2M deposited but would be protected against a briber with budget \(100M = \)dn2/2. Increasing the number of oracles is more effective than increasing $d, of course, and can have a dramatic effect: a network with n = 300 nodes and deposits \(d = \)20K would be protected against a briber with budget up to $900M. Note that a staking system can in many cases protect smart contracts representing more value than the offered level of bribery protection. This is because an adversary attacking these contracts cannot extract the full value in many cases. For example, a Chainlink-powered contract securing $1B in value may only require security against a briber with $100M in resource because such an adversary can feasibly extract a profit of only 10% of the value of the contract. Note: The idea that the value of a network can grow quadratically is expressed in the well known Metcalfe’s Law [167, 235], which states that the value of a network grows quadratically in the number of connected entities. Metcalfe’s Law, however, arises from growth in the number of potential pairwise network connections, a different phenomenon than that underlying quadratic staking impact in our incentive mechanism. 9.4.3 Realization of Second Tier Two operational features facilitate realization of a high-reliability second tier: (1) Second-tier adjudication should be a rare event in oracle networks and therefore can be significantly more costly than normal operation of the first tier and (2) Assuming

optimistically accepted reports—or contracts whose execution can await arbitration— the second tier need not execute in real time. These features result in a range of configuration options for the second tier to meet the requirements of particular DONs. As an example approach, a second tier committee can consist of nodes selected by a DON (i.e., first tier) from the longest-serving and most reliable nodes in the Chainlink network. In addition to considerable relevant operational experience, the operators of such nodes have a considerable implicit incentive in FFO that motivates a desire to ensure that the Chainlink network remains highly reliable. They also have publicly available performance histories that provide transparency into their reliability. Secondtier nodes, it is worth noting, need not be participants in the first-tier network, and may adjudicate faults across multiple first-tier networks. Nodes in a given DON can pre-designate and publicly commit to a set of n′ such nodes as constituting the second-tier committee for that DON. Additionally, DON nodes publish a parameter k′ ≤n′ that determines the number of second-tier votes required to penalize a first-tier node. When an alert is generated for a given report, the members of the second tier vote on the correctness of the values provided by each of the first-tier nodes. Any first-tier node that receives k′ negative votes forfeits its deposits to the watchdog node. Because of the rareness of adjudication and opportunity for extended-time execution noted above, in contrast to the first tier, nodes in the second tier can: 1. Be highly compensated for conducting adjudication. 2. Draw on additional data sources, beyond even the diverse set used by the firsttier. 3. Rely on manual and/or expert inspection and intervention, e.g., to identify and reconcile errors in source data and distinguish between an honest node relaying faulty data and a misbehaving node. We emphasize that the approach we have just described for selection of secondtier nodes and policy governing adjudication represents just a point within a large design space of possible realizations of the second tier. Our incentive mechanism offers complete flexibility as to how the second tier is realized. Individual DONs can thus constitute and set rules for their second tiers that meet the particular requirements and expectations of participating nodes and users. DECO and Town Crier as adjudication tools: It is essential for the second tier in our mechanism to be able to distinguish between adversarial first-tier nodes that intentionally produce incorrect reports and honest first-tier nodes that unintentionally relay data that is incorrect at the source. Only then can the second tier implement slashing to disincentivize cheating, the goal of our mechanism. DECO and Town Crier are powerful tools that can enable second-tier nodes to make this critical distinction reliably.

Second-tier nodes may in some cases be able to directly query the data source used by a first-tier node or use ADO Section 7.1 in order to check whether an incorrect report resulted from a faulty data source. In other cases, however, second tier nodes may lack direct access to a first-tier node’s data source. In such cases, correct adjudication would appear to be infeasible or require a reliance on subjective judgment. Previous oracle dispute systems have relied upon inefficient, escalating rounds of voting to address such challenges. Using DECO or Town Crier, however, a first tier node can prove correct behavior to second-tier nodes. (See Section 3.6.2 for details on the two systems.) Specifically, if the second tier node identifies a first-tier node as having output a faulty report value ˜r, the first-tier node can use DECO or Town Crier to generate tamperproof evidence for second-tier nodes that it is correctly relaying ˜r correctly from a (TLS-enabled) source recognized as authoritative by the DON. Critically, the first-tier node can do this without second-tier nodes requiring direct access to the data source.17 Consequently, correct adjudication is feasible in Chainlink for any desired data source. 9.4.4 Misreporting Insurance The strong bribery resistance achieved by our staking mechanism relies fundamentally on slashed funds being awarded to alerters. Without a monetary reward, alerters would have no direct incentive to reject bribes. As a result, however, slashed funds are not available to compensate users harmed by incorrect reports, e.g., users that lose money when incorrect price data is relayed to a smart contract. By assumption, incorrect reports don’t pose a problem if reports are accepted by a contract only after potential adjudication, i.e., action by the second tier. As explained above, though, to achieve the best possible performance, contracts may instead rely optimistically on the mechanism to enforce correct reporting, meaning that they accept reports before potential second-tier adjudication. Indeed, such optimistic behavior is safe in our model assuming rational adversaries whose budgets do not exceed the staking impact of the mechanism. Users concerned about the improbable event of a mechanism failure resulting from, e.g., adversaries with overwhelming financial resources, may wish to employ an additional layer of economic security in the form of misreporting insurance. We know of multiple insurers already intending to offer smart-contract-backed policies of this kind for Chainlink-secured protocols in the near future, including through innovative mechanisms such as DAOs, e.g., [7]. The existence of performance history for Chainlink nodes and other data about nodes such as their stake amounts provides an exceptionally strong basis for actuarial assessments of risk, making it possible to price policies in ways that are inexpensive for policyholders yet sustainable for insurers. 17With Town Crier, it is additionally possible for first-tier nodes to locally generate attestations of correctness for the reports they output and provide these attestations to second-tier nodes on an as-needed basis.

Basic forms of misreporting insurance can be implemented in a trustworthy and efficient manner using smart contracts. As a simple example, a parametric insurance contract SCins can compensate policyholders automatically if our incentive mechanism’s second tier identifies an error in a report generated in the first tier. A user U that wishes to purchase an insurance policy, e.g., the creator of a target contract SC, can submit a request to a decentralized insurer for an policy amount $M on the contract. On approving U, the insurer can set an ongoing (e.g., monthly) premium of $P in SCins. While U pays the premium, her policy remains active. If a reporting failure occurs in SC, the result will be the emission of a pair (r1, r2) of conflicting reports for SC, where r1 is signed by the first tier in our mechanism and r2, the corresponding corrected report, is signed by the second tier. If the U furnishes such a valid pair (r1, r2) to SCins, the contract automatically pays her $M, provided her premium payments are up-to-date. 9.5 Single-Round Variant The protocol described in the previous subsection requires that the second-tier committee wait n rounds to determine whether a watchdog has raised an alert. This requirement holds even in the optimistic case, i.e., when the first tier is functioning correctly. For users unwilling to accept reports optimistically, i.e., prior to potential adjudication, the delay associated with that approach would be unworkable. For this reason, we are also exploring alternative protocols that require just one round. In this approach, all oracle nodes submit secret bits indicating whether or not they wish to raise an alert. The second-tier committee then checks these values in priority order. To provide a rough sketch, such a scheme might involve the following steps: 1. Watchdog bit submission: Each node Oi secret-shares a one-bit watchdog value wi ∈{no alert, alert} among nodes in the second tier for every report it generates. 2. Anonymous tips: Any oracle node can submit an anonymous tip α to the secondtier committee in the same round that watchdog bits are submitted. This tip α is a message indicating that an alert has been raised for the current report. 3. Watchdog bit checking: The second-tier committee reveals oracle nodes’ watchdog bits in priority order. Note that nodes must send no alert watchdog bits when they don’t alert: otherwise, traffic analysis reveals all nodes’ bits. The protocol does reveal the no alert watchdog bits of nodes with higher priority than the highest-priority alerting watchdog. Observe that what is revealed is identical with that of our n-round protocol. Rewards are also distributed identically with that scheme, i.e., the first identified watchdog receives the slashed deposits of nodes that have submitted incorrect reports.

The use of anonymous tips enables the second-tier committee to remain noninteractive in cases where no alert has been raised, reducing communication complexity in the common case. Note that any watchdog that raises an alert has an economic incentive to submit an anonymous tip: If no tip is submitted, no reward is paid to any node. To ensure that the sender Oi of an anonymous tip α cannot be identified by the adversary based on network data, the anonymous tip can be sent over an anonymous channel, e.g, via Tor, or, more practically, proxied via a cloud service provider. To authenticate the tip as originating with O, Oi can sign α using a ring signature [39, 192]. Alternatively, to prevent unattributable denial-of-service attacks against the secondtier committee by a malicious oracle node, α can be an anonymous credential with revocable anonymity [73]. This protocol, while practically achievable, has somewhat heavyweight engineering requirements (which we are exploring ways to reduce). First-tier nodes, for instance, must communicate directly with second-tier nodes, requiring maintenance of a directory. The need for anonymous channels and ring signatures adds to the engineering complexity of the scheme. Finally, there is a special trust requirement briefly discussed in the note below. We are therefore also exploring simpler schemes that still achieve super-linear staking impact, but perhaps less than quadratic, in which a briber asymptotically needs resources of at least $n log n, for example. Some of the schemes under consideration involve random selection of a strict subset of nodes to act as watchdogs, in which case prospective bribery becomes an especially powerful attack. Remark: The security of this single-round staking mechanism requires untappable channels between oracle and second-tier nodes—a standard requirement in coercionresistant systems, e.g., voting [82, 138], and a reasonable one in practice. Additionally, however, a node Oi that seeks to cooperate with a briber can construct its secret shares in such a way as to show the briber that it has encoded a particular value. For example, if Oi does not know which nodes the briber controls, then Oi can submit 0-valued shares to all committee members. The briber can then verify Oi’s compliance probabilistically. To avoid this problem in any single-round protocol, we require that Oi know the identity of at least one honest second-tier node. With an interactive protocol in which each second-tier node adds a randomization factor to shares, the best the briber can do is enforce selection by Oi of a random watchdog bit. 9.6 Implicit-Incentive Framework (IIF) FFO is a form of implicit incentive for correct behavior in the Chainlink network. It functions like explicit stake, i.e., deposits, in that it helps enforce economic security for the network. In other words, FFO should be included as part of the (effective) deposit $d of a node in the network.

The question is: How do we measure FFO and other forms of implicit incentive within the Chainlink network? The Implicit-Incentive Framework (IIF) is a set of principles and techniques that we plan to develop for this purpose. Blockchain systems provide many forms of unprecedented transparency, and the high-trust records of node performance they create are a springboard for our vision of how the IIF will work. Here we very briefly sketch ideas on key elements of the IIF. The IIF itself will consist of a set of factors we identify as important in evaluating implicit incentives, along with mechanisms for publishing relevant data in a highassurance form for consumption by analytics algorithms. Different Chainlink users may wish to use the IIF in different ways, e.g., giving different weighting to different factors. We expect analytics services to arise in the community that help users apply the IIF according to their individual risk-evaluation preferences, and our goal is to facilitate such services by ensuring their access to high-assurance and timely supporting data, as we discuss below (Section 9.6.4). 9.6.1 Future Fee Opportunity Nodes participate in the Chainlink ecosystem to earn a share of the fees that the networks pay out for any of the various services we have described in this paper, from ordinary data feeds to advanced services such as decentralized identity, fair sequencing, and confidentiality-preserving DeFi. Fees in the Chainlink network support node operators’ costs for, e.g., running servers, acquiring necessary data licenses, and maintaining a global staffto ensure high uptime. FFO denotes the service fees, net of expenses, that a node stands to gain in the future—or lose should it demonstrate faulty behavior. FFO is a form of stake that helps secure the network. A helpful feature of FFO is the fact that on-chain data (supplemented by off-chain data) establish a high-trust record of a node’s history, enabling computation of FFO in a transparent, empirically driven manner. A simple, first-order measure of FFO can derive from the average net revenue of a node over a period of time (i.e., gross revenue minus operating expenses). FFO may then be calculated as, e.g., the net present value [114] of cumulative future net revenue, in other words, the time-discounted value of all future earnings. Node revenue can be volatile, however, as shown for example in Fig. 17. More importantly, node revenue may not follow a distribution that is stationary over time. Consequently, other factors we plan to explore in estimating FFO include: • Performance history: An operator’s performance history—including the correctness and timeliness of its reports, as well as its up time—provides an objective touchstone for users to evaluate its reliability. Performance history will thus provide a critical factor in users’ selection of oracle nodes (or, with the advent of DONs, their selection of DONs). A strong performance history is likely to correlate with high ongoing revenue.18 18An important research question we intend to address is detection of falsified service volumes.

Revenue earned by Chainlink nodes on a single ETH-USD data feed showing correlation with price volatility

Figure 17: Revenue earned by Chainlink nodes on a single data feed (ETH-USD) during a representative week in March 2021. • Data access: While oracles may obtain many forms of data from open APIs, certain forms of data or certain high-quality sources may be available only on a subscription basis or through contractual agreements. Privileged access to certain data sources can play a role in creating a stable revenue stream. • DON participation: With the advent of DONs, communities of nodes will come together to provide particular services. We expect that many DONs will include operators on a selective basis, establishing participation in reputable DONs as a privileged market position that helps ensure a consistent source of revenue. • Cross-platform activity: Some node operators may have well-established presences and performance track records in other contexts, e.g., as PoS validators or data providers in non-blockchain contexts. Their performance in these other systems (when data on it is available in a trustworthy form) can inform evaluation of their performance history. Similarly, faulty behavior in the Chainlink network can jeopardize revenue in these other systems by driving away users, i.e., FFO can extend across platforms. 9.6.2 Speculative FFO Node operators participate in the Chainlink network not just to generate revenue from operations, but to create and position themselves to take advantage of new opportunities to run jobs. In other words, expenditure by oracle nodes in the network is also a positive statement about the future of DeFi and other smart-contract application domains as well as emerging non-blockchain applications of oracle networks. Node operators today earn the fees available on existing Chainlink networks and simultaneously These are loosely analogous to fake reviews on internet sites, except that the problem is easier in the oracle setting because we have a definitive record of whether the goods, i.e., reports, were ordered and delivered—as opposed to, e.g., physical goods ordered in online shops. Put another way, in the oracle setting, performance can be validated, even if customer veracity can’t.

build a reputation, performance history, and operational expertise that will position them advantageously to earn fees available in future networks (contingent, of course, on honest behavior). The nodes operating in the Chainlink ecosystem today will in this sense have an advantage over newcomers in earning the fees as additional Chainlink services become available. This advantage applies to new operators, as well as technology companies with established reputations; for example, T-Systems, a traditional technology provider (subsidiary of Deutsche Telekom), and Kraken, a large centralized exchange, have established early presences in the Chainlink ecosystem [28, 143]. Such participation by oracle nodes in future opportunities may be regarded itself as a kind of speculative FFO, and thus constitutes a form of stake in the Chainlink network. 9.6.3 External Reputation The IIF as we have described it can operate in a network with strictly pseudonymous operators, i.e., without disclosure of the people or real-world entities involved. One potentially important factor for user selection of providers, however, is external reputation. By external reputation, we mean the perception of trustworthiness attaching to real-world identities, rather than pseudonyms. Reputational risk attaching to real-world identities can be viewed as a form of implicit incentive. We view reputation through the lens of the IIF, i.e., in a cryptoeconomic sense, as a means of establishing cross-platform activity that may be incorporated into FFO estimates. The benefit of using external reputation as a factor in estimates of FFO, as opposed to pseudonymous linkage, is that external reputation links performance not just to an operator’s existing activities, but also to future ones. If, for instance, a bad reputation attaches to an individual person, it can taint that person’s future enterprises. Put another way, external reputation can capture a broader swath of FFO than pseudonymous performance records, as the impact of malfeasance attaching to a person or established company is harder to escape than that associated with a pseudonymous operation. Chainlink is compatible with decentralized identity technologies (Section 4.3) that can provide support for the use of external reputation in the IIF. Such technologies can validate and thereby help ensure the veracity of operators’ asserted real-world identities.19 9.6.4 Open IIF Analytics The IIF, as we have noted, aims to provide reliable open-source data and tools for implicit-incentive analytics. The goal is to enable providers within the community to develop analytics tailored to the risk-assessment needs of different parts of the Chainlink user base. 19Decentralized identity credentials can also, where desired, embellish pseudonyms with validated supplementary information. For example, a node operator could in principle use such credentials to prove that it is a Fortune 500 company, without revealing which one.

A considerable amount of historical data regarding nodes’ revenue and performance resides on chain in a high-trust, immutable form. Our goal, however, is to provide the most comprehensive possible data, including data on behaviors that are visible only off chain, such as Off-Chain Reporting (OCR) or DON activity. Such data can potentially be voluminous. The best way to store it and ensure its integrity, i.e., protect it from tampering, we believe, will be with the help of DONs, using techniques discussed in Section 3.3. Some incentives lend themselves to direct forms of measurement, such as staking deposits and basic FFO. Others, such as speculative FFO and reputation, are harder to measure in an objective manner, but we believe that supporting forms of data, including historical growth of the Chainlink ecosystem, social-media metrics of reputation, etc., can support IIF analytics models even for these harder-to-quantify elements. We can imagine that dedicated DONs arise specifically to monitor, validate, and record data relating to off-chain performance records of nodes, as well as other data used in the IIF, such as validated identity information. These DONs can provide uniform, high-trust IIF data for any analytics providers serving the Chainlink community. They will also provide a golden record that makes the claims of analytics providers independently verifiable by the community. 9.7 Putting It All Together: Node Operator Incentives Synthesizing our discussions above on explicit and implicit incentives for node operators provides a holistic view of the ways that node operators participate in and benefit from the Chainlink network. As a conceptual guide, we can express the total assets at stake by a given Chainlink node operator $S in a rough, stylized form as: \(S ≈\)D + \(F + \)FS + $R, where: • $D is the aggregate of all explicitly deposited stake across all networks in which the operator participates; • $F is the net present value of the aggregate of all FFO across all networks in which the operator participates; • $FS is the net present value of the speculative FFO of the operator; and • $R is the reputational equity of the operator outside the Chainlink ecosystem that might be jeopardized by identified misbehavior in its oracle nodes. While largely conceptual, this rough equality helpfully shows that there is a multiplicity of economic factors favoring high-reliability performance by Chainlink nodes. All of these factors other than $D are present in today’s Chainlink networks.

9.8 The Virtuous Cycle of Economic Security The combination of super-linear staking impact with representation of fee payments as future fee opportunity (FFO) in the IIF can lead to what we call the virtuous cycle of economic security in an oracle network. This can be seen as a kind of economy of scale. As the total amount secured by a particular network rises, the amount of additional stake it takes to add a fixed amount of economic security decreases as does the average per-user cost. It’s therefore cheaper, in terms of fees, for a user to join an already-existing network than to achieve the same increase in network economic security by creating a new network. Importantly, the addition of each new user lowers the cost of the service for all previous users of that network. Given a particular fee structure (e.g. a particular yield rate on the amount staked), if the total fees earned by a network increases, this incentivizes the flow of additional stake into the network to secure it at a higher rate. Specifically, if the total stake an individual node may hold in the system is capped, then when new fee payments enter the system, raising its FFO, the number of nodes n will increase. Thanks to the super-linear staking impact of our incentive system design, the economic security of the system will rise faster than n, e.g., as n2 in the mechanism we sketch in Section 9.4. As a result, the average cost for economic security—i.e., amount of stake contributing a dollar of economic security—will drop. The network can therefore charge its users lower fees. Assuming that demand for oracle services is elastic (see, e.g., [31] for a brief explanation), demand will rise, generating additional fees and FFO. We illustrate this point with the following example. Example 5. Since the economic security of an oracle network with our incentive scheme is \(dn2 for stake \)dn, the economic security contributed by a dollar of stake is n and thus the average cost per dollar of economic security—i.e, amount of stake contributing to a dollar of economic security—is 1/n. Consider a network in which the economic incentives consist entirely of FFO, capped at \(d ≤\)10K per node. Suppose the network has n = 3 nodes. Then the average cost per dollar of economic security is about $0.33. Suppose that the total FFO of the network rises above \(30K (e.g., to \)31K). Given the cap on per-node FFO, the network grows to (at least) n = 4. Now the average cost per dollar of economic security drops to about $0.25. We illustrate the full virtuous cycle of economic security in oracle networks schematically in Fig. 18. We emphasize that the virtuous cycle of economic security derives from the effect of users pooling their fees. It is their collective FFO that works in favor of larger network sizes and thus greater collective security. We also note that the virtuous cycle of economic security works in favor of DONs achieving financial sustainability. Once created, DONs that address user needs should grow to and beyond the point at which revenue from fees exceed operational costs for oracle nodes.

Schematic of the virtuous cycle of Chainlink staking showing how user fees drive security and value capture

Figure 18: Schematic of the virtuous cycle of Chainlink staking. A rise in user fee payments to an oracle network 1⃝causes it to grow, leading to growth in its economic security 2⃝. This super-linear growth realizes economies of scale in Chainlink networks 3⃝. Specifically, it means a reduction in the average cost of economic security , i.e., the per-dollar economic security arising from fee payments or other sources of stake increases. Lower costs, passed along to users, stimulate increased demand for oracle services 4⃝. 9.9 Additional Factors Driving Network Growth As the Chainlink ecosystem continues to expand, we believe that its attractiveness to users and importance as infrastructure for the blockchain economy will accelerate. The value provided by oracle networks is super-linear, meaning that it grows faster

than the size of the networks themselves. This growth in value derives from both economies of scale—greater per-user cost efficiency as service volumes increase—and network effects—an increase of network utility as users adopt DONs more widely. As existing smart contracts continue to see more value secured and entirely new smart contract applications are made possible by more decentralized services, the total use of and aggregate fees paid to DONs should grow. Increasing pools of fees in turn translate into the means and incentive to create even more decentralized services, resulting in a virtuous cycle. This virtuous cycle solves a critical chicken-and-egg problem in the hybrid smart contract ecosystem: Innovative smart contract features often require decentralized services that don’t yet exist (e.g., new DeFi markets often require new data feeds) yet need sufficient economic demand to come into existence. The pooling of fees by various smart contracts for existing DONs will signal demand for additional decentralized services from a growing user base, giving rise to their creation by DONs and an ongoing enablement of new and varied hybrid smart contracts. In summary, we believe that the growth in network security driven by virtuous cycles in the Chainlink staking mechanism exemplifies larger patterns of growth that the Chainlink network can help bring about in an on-chain economy for decentralized services.

经济学和加密经济学

为了让 Chainlink 网络在去中心化信任模型中实现强大的安全性, 节点共同表现出正确的行为至关重要,这意味着它们遵守 大多数时候完全符合 DON 协议。在本节中,我们讨论方法 通过经济激励(又名加密经济)来帮助实施这种行为 激励措施。 这些激励分为两类:显性激励和隐性激励 分别通过 staking 和未来费用机会 (FFO)。 质押: 与其他 blockchain 系统一样,在 Chainlink 中进行质押涉及网络参与者,即 oracle 节点,以 LINK token 的形式存入锁定资金。这些 资金,我们也称为股权或显性股权,是一种显性激励。他们 因节点故障或不当行为而被没收。在 blockchain 上下文中, 这个过程通常被称为削减。 然而,Chainlink 中 oracle 节点的质押与 staking 有根本不同 由 validators 在未经许可的 blockchains 中编写。验证者可能会通过模棱两可或对抗性地排序交易来做出不当行为。 底层共识协议 15由于用户可以替换内存池中的交易,因此需要注意确保挖掘的交易和 DON 提交的交易之间的正确对应。不过,无需许可的 blockchain 使用严格快速的块验证规则和加密原语来防止 validator 生成无效块。相比之下, 程序保护无法阻止作弊 oracle 网络生成 无效报告。原因是两种类型的系统之间的一个关键区别:blockchains 中的事务验证是内部一致性的属性,而正确性 关于 blockchain 的 oracle 报告是外部数据(即链下数据)的属性。 我们为基于 Chainlink 的网络设计了初步的 staking 机制 基于可能使用外部数据的 oracle 节点之间的交互协议。这个 机制使用明确的奖励和措施为正确的行为创造经济激励 处罚(削减)。由于该机制是经济的,因此旨在防止节点 对手使用金融资源通过以下方式腐败节点: 贿赂。 (这样的对手是非常普遍的,并且可以扩展到例如与 从他们的集体不当行为中获取价值。) 我们设计的Chainlink staking机制具有一些强大且新颖的功能 16 主要的此类特征是超线性 staking 影响(具体来说,二次影响)。 对手所拥有的资源必须远远超过节点存入的资金 从而达到颠覆机制的目的。我们的 staking 机制还提供了针对比之前在类似系统中考虑的更强大对手的保护,即 一个可以根据节点未来行为进行贿赂的对手。此外,我们还讨论了 Chainlink 工具(例如 DECO)如何帮助加强我们的 staking 通过在节点行为出现故障的情况下促进正确裁决的机制。 未来费用机会(FFO): 两个 PoW 的未经许可的 blockchains 和 PoS 多样性——如今严重依赖我们所说的隐性激励。这些是 对诚实行为的经济激励不是来自明确的奖励,而是来自 从平台参与本身来看。例如,Bitcoin 矿工社区受到激励,不会发起 51% 攻击,因为这可能会破坏人们对比特币的信心。 Bitcoin,压低其价值,从而侵蚀其集体的价值 采矿基础设施资本投资[150]。 Chainlink 网络受益于我们提到的类似隐性激励 作为未来费用机会(FFO)。具有良好性能历史记录的 Oracle 节点或 声誉会吸引用户付费。 oracle 节点的不当行为会危及未来 费用支付,从而以潜在的机会成本来惩罚节点 通过参与网络获得的收入。与显性权益类比, FFO 可以被视为一种隐性股权形式,是对诚实行为的激励, 源于对平台保持信心的共同利益 节点运营商的业务取决于节点运营商的积极绩效和声誉 网络。这种激励是 Chainlink 网络所固有的,但没有明确表达 协议。在 Bitcoin 中,维持上述采矿作业的价值 16我们在此描述的 staking 机制目前仅旨在强制提供正确的报告 由 oracle 网络提供。我们希望在未来的工作中对其进行扩展,以确保许多任务的正确执行 DONs 将提供的其他功能。同样可以被视为隐性股权的一种形式。 我们强调 FFO 已存在于 Chainlink 中并有助于保护网络 今天。我们对 Chainlink 进一步发展的主要贡献将是一种有原则的、经验驱动的方法,通过以下方式评估 FFO 等隐性激励: 我们称之为隐性激励框架(IIF)。估计数量,例如 节点未来的收费机会,IIF将持续借鉴综合 Chainlink 网络收集的绩效和付款数据。这样的估计 将启用反映节点激励的 staking 系统基于 IIF 的参数化 比当前的启发式和/或静态模型具有更高的准确性。 总结一下,正确的 oracle 节点的两个主要经济激励措施 正在发展的 Chainlink 网络中的行为将是: • 质押(存入的质押) 哦 明确的激励 • 未来收费机会 (FFO) 哦 隐性激励 这两种形式的激励是相辅相成的。 Oracle节点可以同时 参与 Chainlink staking 协议,享受持续的收入来源 用户,并从他们持续的良好行为中集体受益。因此这两种激励措施 为 oracle 网络提供的加密经济安全做出贡献。另外, 这两种激励措施可以相互加强和/或相互抵消。例如, 没有业绩历史记录和收入来源的新 oracle 运营商可以抵押 大量的LINK作为诚实行为的保证,从而吸引用户 和费用。相反,一个已建立的 oracle 运算符具有长且相对无故障的 性能历史记录可能会向大量用户收取大量费用,因此依赖 更重视 FFO 作为隐性激励的一种形式。 一般来说,我们在这里考虑的方法旨在实现给定量的 oracle-网络 资源以在 Chainlink 中创造最大可能的经济激励 代理——即最大化其财务效用的节点——诚实行事。再放一个 方式,目标是最大化对手攻击所需的金融资源 网络成功。通过数学上良好地制定 staking 协议 定义经济安全并使用 IIF,我们的目标是衡量经济实力 Chainlink 的激励措施尽可能准确。依赖合约的创建者将 然后能够充满信心地确定 oracle 网络是否满足 他们所需的加密经济安全级别。 经济安全的良性循环: 我们在本节中讨论的激励措施 staking 和 FFO 的影响超出了其增强安全性的范围 DONs。它们承诺会引发我们所说的经济安全的良性循环。 超线性 staking 影响(和其他规模经济)导致运营成本降低 随着 DON 安全性的增长而增加成本。较低的成本吸引更多用户使用 DON,增加费用支付。费用支付的增加继续刺激行业的增长 网络,形成良性循环。 我们认为,经济安全的良性循环只是一个例子 规模经济和网络效应等,我们将在本节后面讨论。 部门组织:质押给以下组织带来了显着的技术和概念挑战 我们设计了一种具有新颖功能的机制。因此,质押将是 我们本节的主要重点。 我们在第 9.1 节中概述了本文中介绍的 staking 方法,然后在第 9.2 节到第 9.5 节中进行了详细讨论。我们介绍 IFF 在第 9.6 节中。我们在第 9.7 节中总结了 Chainlink 网络激励措施。 在第 9.8 节中,我们讨论了我们提出的 staking 方法可以给 oracle 网络带来的经济安全的良性循环。最后,我们简单描述一下其他的潜力 影响第 9.9 节中 Chainlink 网络的增长。 9.1 质押概览 如上所述,我们在这里介绍的 staking 机制设计涉及 oracle 节点之间的交互协议,允许解决 外部数据报告。质押旨在确保理性 oracle 节点的诚实行为。因此,我们可以将攻击 staking 协议的对手建模为 行贿者:对手的策略是利用经济激励来腐蚀 oracle 节点。 对手可能会通过成功篡改来获取未来的金融资源 带有 oracle 报告,例如,提出与损坏的节点分享由此产生的利润。 我们的 staking 机制设计同时致力于实现两个雄心勃勃的目标: 1. 抵御强大的对手:staking机制旨在保护 oracle 网络针对广泛的对手,这些对手能够进行复杂的、 有条件的贿赂策略,包括提供贿赂的预期贿赂 至 oracle ,其身份是在事后确定的(例如,向 随机选择 oracles 进行高优先级警报)。而其他 oracle 设计 考虑了一组狭窄的攻击,但没有实际的全部功能 对手,据我们所知,我们引入的对抗机制 这是第一个明确阐述一系列广泛的贿赂策略并表明 该模型中的电阻。我们的模型假设除了攻击者之外的节点 经济上理性的(相对于诚实的),我们假设存在一个 对于典型使用来说价格昂贵但可用的事实来源 如有分歧(下文进一步讨论)。 2. 实现超线性staking影响: 我们的目标是确保由理性代理组成的 oracle 网络报告 即使存在预算超线性的攻击者,也能如实进行整个网络存入的总权益。在现有的 staking 系统中,如果 每个 n 个节点都持有 $d,攻击者可以发出可信的贿赂请求 节点以不诚实的行为换取略高于 \(d to each node, using a total budget of about \)dn。这已经是一个很高的标准了 攻击者必须拥有相当于存款总和的流动预算 网络中的所有利益相关者。我们的目标是更强的经济安全 这已经是一个很大的障碍了。我们的目标是设计第一个 staking 系统 可以通过 n 的预算超线性实现一般攻击者的安全性。 虽然实际考虑可能会产生较小的影响,但正如我们下面讨论的, 我们的初步设计达到了对抗性预算要求大于 $dn2/2,即以 n 为单位进行二次缩放,即使行贿行为在很大程度上也是不切实际的 当节点仅抵押适量时。 实现这两个目标需要激励设计的创新组合 和密码学。 主要想法: 我们的 staking 方法取决于我们称之为“看门狗优先”的想法。 由 Chainlink oracle 网络生成并发送到依赖合约的报告 (例如,资产价格)是从参与节点贡献的各个报告中汇总的(例如,通过取中位数)。通常是服务级别协议 (SLA) 指定报告偏差的可接受范围,即节点的报告可以走多远 与汇总报告的偏差以及应允许汇总报告的偏差程度 偏离真实值才被认为是正确的。 在我们的 staking 系统中,对于给定的报告轮次,每个 oracle 节点可以充当 如果监管机构认为汇总报告不正确,则会发出警报。在每个 在报告轮中,每个 oracle 节点都被分配一个公共优先级,该优先级决定了 其警报(如果有)的处理顺序。我们的机制旨在奖励 集中度,这意味着发出警报的最高优先级的看门狗将获得 没收故障节点的存款所产生的全部奖励。 我们的 staking 系统设计涉及两层:第一层,默认层,第二层, 后挡板层。第一层是 oracle 网络本身,一组 n 个节点。 (为简单起见, 我们假设 n 是奇数。)如果大多数节点报告不正确的值,则 第一层有强烈的动机发出警报。如果发出警报,则报告 然后网络的决策被升级到第二层——一个高成本、最大可靠性的系统,可以由用户在网络服务级别协议中指定。 例如,这可能是一个仅由具有强大功能的节点组成的系统 历史可靠性分数,或者其数量级大于 oracles 第一层。此外,如第 9.4.3 节中所述,DECO 或 Town Crier 可以服务 作为强大的工具,帮助确保第二层的高效和结论性裁决。 为了简单起见,我们假设第二层系统得出了正确的报告 值。 虽然仅依靠第二层来生成所有报告似乎很有吸引力, 我们设计的好处是它始终如一地实现了在典型情况下,只需支付第二层系统的运营成本 第一层系统。 看门狗优先级会通过以下方式产生超线性 staking 影响:如果 第一层 oracle 网络输出错误结果和多个看门狗节点 警报,staking 激励机制奖励最高优先级的看门狗 从(大多数)行为不当节点的存款中提取的金额超过 $dn/2。的 因此,总奖励集中在这个单一看门狗手中,因此 确定对手必须承诺潜在看门狗的最低限度 激励它不发出警报。由于我们的机制确保每个 oracle 都获得 如果更高优先级的监管机构接受了贿赂,则有机会担任监管机构 (并且选择不发出警报),因此对手必须提供超过 $dn/2 到每个节点以防止引发任何警报。由于有n个节点, 对手成功行贿所需的预算超过 dn2/2 美元,其中 是网络中节点数量 n 的二次方。 9.2 背景 我们对 staking 的方法借鉴了博弈论和机制领域的研究 设计 (MD)(有关教科书参考,请参阅 [177])。博弈论是数学上的 战略互动的正式研究。在这种情况下,游戏就是这样的模型 一种交互,通常是在现实世界中,将可用的操作集编纂成 游戏的参与者,称为玩家。博弈还指定了所获得的收益 由个别玩家决定——奖励取决于玩家选择的行动和 其他玩家的行动。也许是游戏中研究的最著名的游戏例子 理论是囚徒困境[178]。博弈论学家通常旨在理解 给定博弈中所代表的均衡或均衡(如果有)。平衡是 一组策略(每个玩家一个),这样没有一个玩家可以获得更高的分数 单方面偏离其战略所带来的回报。 与此同时,机制设计是设计激励措施的科学,使得 交互(及其相关博弈)的平衡具有一些理想的特性。 MD 可以被视为博弈论的逆:博弈中的典型问题 理论是,“给定激励和模型,均衡将会是什么?”在马里兰州, 相反,问题是“什么激励措施会导致博弈达到理想的均衡?” 机制设计者的一个典型目标是创建一个“激励兼容”机制,这意味着该机制的参与者(例如,拍卖或其他信息) 启发系统[228])被激励去报告某些事情的真相(例如,如何 他们非常看重某个特定的物品)。维克里(第二价)拍卖也许是 最著名的激励兼容机制,其中参与者提交密封投标 对于某件商品,出价最高者赢得该商品,但支付第二高的价格 [214]。加密经济学是 MD 的一种特定领域形式,它利用密码学 在去中心化系统中创造理想平衡的技术。 贿赂和共谋给整个医学博士领域带来了重大挑战。几乎所有的机制都会在共谋的存在下崩溃,共谋被定义为附带合同。参与机制的各方之间 [125, 130]。贿赂是指外部一方在游戏中引入新颖的激励措施,这提出了一个更棘手的问题 比串通更重要;串通可以被视为游戏行贿的特例 参与者。 区块链系统通常可以被概念化为具有货币(基于加密货币)回报的游戏。一个简单的例子是工作量证明挖矿:矿工有一个行动空间 他们可以选择 hash 速率来开采区块。挖矿的回报是有保证的负奖励(电力和设备成本)加上随机 正奖励(挖矿补贴)取决于其他活跃矿工的数量 [106, 172] 和交易费用。像 SchellingCoin [68] 这样的众包 oracle 是另一个例子:操作空间是 oracle 可能发送的一组可能的报告,而 收益是 oracle 机制指定的奖励,例如,付款可能取决于 oracle 的报告与其他报告的中位数有多接近 [26, 68, 119, 185]。 区块链游戏为串通和贿赂攻击提供了成熟的机会;确实, smart contracts 甚至可以促进此类攻击 [96, 165]。也许最有名的 对众包 oracle 的贿赂攻击是 p-plus-epsilon 攻击 [67]。这次攻击 出现在类似 SchellingCoin 的机制中,在该机制中,玩家提交布尔值报告(即假或真),如果他们同意,则获得 p 奖励 多数提交。 在 p-plus-epsilon 攻击中,攻击者可信地承诺: 例如,当且仅当多数提交为真时,才向投票错误的用户支付 $p + ϵ 费用。 结果是一种均衡,其中所有参与者都被激励报告虚假信息 无论其他玩家做什么;因此,行贿者可以诱导节点 通过其承诺的贿赂举报虚假信息,而无需实际支付贿赂(!)。 然而,在 oracle 背景下(特别是非众包的 oracle )对其他贿赂策略的探索仅限于相当弱的对抗性 模型。例如,在 PoW 环境中,研究人员研究了结果偶然性 贿赂,即只有在目标消息被成功审查并且没有被审查的情况下才行贿。 出现在一个区块中,无论单个矿工的行为如何[96, 165]。在这种情况下 然而,除了 p-plus-epsilon 攻击之外,我们只知道 oracles 中的工作 一种严格限制的贿赂模式,其中行贿者以以下条件进行贿赂: 个人玩家的行动,而不是最终的结果。 在这里,我们概述了保持激励的信息获取机制的设计 即使在强对抗模型中也是兼容的,如下一小节所述。 9.3 建模假设 在本小节中,我们将解释如何对玩家的行为和能力进行建模 我们的系统,特别是第一层 oracle 节点,第二层节点(裁决) 层和对手。9.3.1 第一层激励模型:理性参与者 许多 blockchain 系统的安全性依赖于一定数量诚实的假设 参与节点。如果节点遵循协议,则被定义为诚实的 当这样做不符合他们的经济利益时。通常是工作量证明系统 需要大多数 hash 权力才能诚实,权益证明系统通常需要所有参与权益的 2/3 或更多才能诚实,甚至像这样的第 2 层系统 仲裁 [141] 需要至少一个诚实的参与者。 在我们的 staking 机制建模中,我们做出了一个更弱的假设。 (成为 清晰、较弱的假设意味着更强的安全属性,因此更可取。)我们假设对手已经腐败,即控制了一些(少数) 第一层 oracle 节点的一部分。我们将其余节点建模为不诚实的代理, 而是作为理性预期效用最大化者。这些节点完全根据自利的财务激励措施行事,选择导致预期财务的行动 增益。例如,如果一个节点收到的贿赂金额大于其所获得的奖励 行为诚实,就会收受贿赂。 关于对抗节点的注意事项: 根据常见的信任建模 去中心化系统中,我们假设所有节点都是理性的,即寻求最大化 净收入,而不是被恶意对手控制。然而我们的主张—— 特别是超线性或二次 staking 影响——渐近地保持 对于某些正的情况,对抗性控制的节点集至多为 (1/2 −c)n 常数 c. 9.3.2 第二层裁决模型:假设的正确性 回想一下,我们的 staking 机制的一个关键功能有助于实现安全性 对抗理性节点的是它的第二层系统。 在我们提出的 staking 机制中,任何 oracle 都可能发出警报,表明 它认为该机制的输出是不正确的。警报会带来高度信任 第二层系统激活并报告正确的结果。因此,关键建模 我们的方法的要求是正确的裁决,即正确的报告 第二层系统。 我们的 staking 模型假设第二层系统充当廉洁、最可靠的事实来源。这样的系统可能既昂贵又缓慢,因此 不适合用于典型情况。然而,在平衡情况下,即当 第一层系统正常工作,第二层系统不会被调用。 相反,它的存在通过提供一个增强了整个 oracle 系统的安全性 高保证的后盾。 使用高信任度、高成本的裁决层类似于上诉流程 大多数司法系统的核心。它在 oracle 的设计中也很常见 系统,例如[119, 185]。我们简要讨论第二层的实现方法 在我们第 9.4.3 节的机制中。我们的 staking 协议使用第二层系统的假设正确裁决作为可信威胁,强制执行 oracle 节点的正确报告。协议 没收 oracle 节点的部分或全部权益,这些节点生成由 第二层系统不正确。从而阻止 Oracle 节点出现不当行为 由此产生的经济处罚。这种方法在风格上类似于 乐观的 rollups,例如 [141, 10]。 9.3.3 对抗模型 我们的 staking 机制旨在获取真实信息,同时实现针对广泛、明确类别的对手的安全。它改进了以前的作品, 它要么省略明确的对抗模型,要么专注于对手的狭窄子类,例如上面讨论的 p+epsilon 对手。我们的目标是设计一个 staking 具有正式证明的安全机制,可以抵御各种对手 实践中会遇到。 我们将对手建模为具有固定(可参数化)预算,表示为 $B。对手可以与每个 oracle 进行单独且保密的通信 网络,并可以秘密向任何个人 oracle 提供贿赂保证 取决于该机制的可公开观察的结果。结果决定 例如,贿赂可以包括 oracle 报告的价值、任何公共消息 由任何 oracle 发送到该机制(例如,警报),其他报告的值 oracles,以及机制输出的值。 没有任何机制可以抵御具有无限能力的攻击者。因此,我们认为某些行为不切实际或超出范围。我们假设我们的攻击者 不能破坏标准加密原语,并且如上所述,有一个固定的(如果 可能很大)预算$B。我们进一步假设对手无法控制 oracle 网络中的通信,特别是它不能大幅延迟 第一层和/或第二层节点之间的流量。 (对手是否可以观察到这种通信取决于特定的机制,我们将在下面解释。) 然而,非正式地,如上所述,我们假设对手可以: (1) 腐败 oracle 节点的一部分((1/2 −c)-某个常数 c 的分数),即完全控制 (2) 向任何想要的节点提供贿赂,并保证付款 如上所述,取决于对手指定的结果。 虽然我们没有提供对手完整的正式模型或完整分类 本白皮书中列出了一系列贿赂能力,以下是各种类型的示例 我们的模型涵盖了行贿者。为了简单起见,我们假设 oracles 发出布尔值 报告其正确值 (w.l.o.g.) 为 true,并且最终结果计算为 消费 smart contract 使用的这些报告的汇总。行贿者的 目标是最终结果不正确,即错误。 • 无条件贿赂者:贿赂者向任何报告虚假信息的oracle 提供贿赂$b。 • 概率贿赂者:贿赂者以某种概率 q 向任何 oracle 提供贿赂 $b 报告错误。• 以虚假结果为条件的行贿者:行贿者向任何报告虚假信息的oracle 行贿$b,只要最终结果是虚假的。 • 无警报条件的行贿者:行贿者向任何举报的oracle 提供贿赂$b 只要没有发出警报,就为 false。 • p-plus-epsilon 贿赂者:贿赂者向任何报告错误的 oracle 提供贿赂 $b 只要大多数 oracle 不报告虚假信息即可。 • 潜在行贿者:行贿者提前向选定的 oracle 行贿 $b 对于随机角色并报告错误。在我们提出的 staking 协议中,所有 节点充当潜在的看门狗,我们能够证明随机化 监管机构的优先事项并不适合潜在的贿赂。许多工作量证明、proof-of-stake 和许可系统都容易受到预期影响 然而,贿赂表明了在我们的对手中考虑这一问题的重要性 模型并确保我们的 staking 协议能够适应它。参见附录E 了解更多详情。 9.3.4 多少加密经济安全才足够? 理性的对手只有在能够获取利润的情况下才会花钱攻击系统 大于其支出。 因此,对于我们的对抗模型和提议的 staking 机制中,$B 可以被视为对手能够获得的潜在利润的衡量标准 通过破坏 oracle 网络并导致其从依赖 smart contract 中提取 生成不正确的报告或一组报告。在决定是否存在 oracle 网络时 为其目的提供足够程度的加密经济安全性,用户应该 从这个角度来评估网络。 对于实际环境中看似合理的对手,我们预计 $B 通常会是 远小于依赖 smart contract 的总资产。在大多数情况下,它 对手不可能全部提取这些资产。 9.4 质押机制:草图 在这里,我们介绍了staking机制的主要思想和总体结构。 目前正在考虑。 为了便于演示,我们描述了一个简单但缓慢的 本小节中的(多轮)协议。但我们注意到,这个方案相当 实用。鉴于该机制提供的经济保证,即对故障节点的惩罚和随之而来的激励,许多用户可能愿意 乐观地接受报告。换句话说,此类用户可以在之前接受报告 可能由第二层进行裁决。 不愿意乐观接受报告的用户可以选择等待协议 执行终止,即直到发生任何潜在的升级到第二层的情况。这个, 然而,这会大大减慢报告的确认时间。因此我们简单地图 15:带警报的 staking 方案示意图。在这个例子中,1⃝多数 的节点被损坏/贿赂并发出不正确的值〜r,而不是正确的值 报告值河看门狗节点2⃝向二级委员会发送警报, 3⃝确定并发出正确的报告值r,导致节点损坏 没收他们的存款——每 d 美元交给看门狗节点 4⃝。 概述一些优化,这些优化会导致更快(单轮)(如果更多的话) 第 9.5 节中的复杂设计。 回想一下,我们的 staking 机制中的第一层由基本的 oracle 组成。 网络本身。 如上所述,我们机制的主要结构是在每一轮中, 每个节点都可以充当具有一定优先级的“看门狗”,因此它有能力 如果该机制得到不正确的输出,而不是正确的输出,则发出警报 奥恩河此警报会导致第二层解决方案,我们假设达到了正确的结果 报告。报告不正确的节点会受到惩罚,因为他们的权益 削减并奖励给监管机构。这种基本结构在 oracle 系统中很常见, 例如,[119, 185]。 我们设计中的关键创新,如上面简要提到的,是每个节点都是 在潜在看门狗的排序中分配了不同的优先级。也就是看门狗 有机会按优先顺序发出警报。回想一下,如果一个节点有 发出警报的最高优先级,每次不当行为都会收到减少的押金 $d 节点,总共超过 \(dn/2 = \)d × n/2,因为不正确的报告意味着 大多数坏节点。因此,对手必须至少支付这个奖励 贿赂任意节点。因此,要贿赂大多数节点,对手必须支付 对大多数节点进行大额贿赂,即严格超过 $dn2/2。 我们在图 15 中示意性地展示了警报和看门狗升级的工作原理。9.4.1 进一步的机制细节 我们现在更详细描述的反贿赂系统是一个简化的草图 我们打算建造的两层建筑。我们的大部分重点将放在描述 第一层网络(以下简称“网络”,从上下文中可以清楚地看出) 及其激励机制和升级到第二层的程序。 考虑一个由 n 个 oracle 节点组成的 Chainlink 网络,这些节点负责 定期(例如,每分钟一次)报告布尔值(例如,市场是否 BTC 的市值超过了 ETH)。作为 staking 机制的一部分,节点 必须提供两笔押金:押金 $d 如有分歧,将被削减 多数和看门狗押金 $dw 会在出现故障时被削减 升级。我们假设节点无法复制其他节点的提交,例如, 通过第 5.3 节中讨论的提交-显示方案。每轮中,节点优先 提交他们的报告,一旦所有节点都已提交(或超时已过期), 节点公布他们的报告。 对于要生成的每个报告,每个节点还被赋予随机选择的 1 到 n 之间的看门狗优先级,其中 1 为最高优先级。该优先级使 奖励集中在一个看门狗手中。所有报告公开后, 随后进入警报阶段。在一系列 n(同步)轮中,节点 优先级 i 有机会在第一轮中发出警报。 让我们考虑一下节点揭示后该机制可能产生的结果 他们的报告。再次假设二进制报告,假设正确的值为 true 并且 不正确的是假的。还假设第一层机制输出 节点输出的多数值作为最终报告r。 该机制可能产生三种结果: • 完全一致:在最好的情况下,节点完全一致:所有节点 可用并已提供相同值 r 的及时报告(无论是真实的 或假)。在这种情况下,网络只需将 r 转发给依赖合约 并用固定的每轮支付 $p 奖励每个节点,该支付要小得多 比 $d。 • 部分一致:有可能某些节点处于离线状态,或者对于哪个值正确存在分歧,但大多数节点报告真实,并且只有一个 少数报告虚假。这个案例也很简单。多数值 (true) 被计算,产生正确的报告 r。所有报告 r 的节点都是 奖励 $p,而报告错误的 oracle 则拥有存款 适度削减,例如削减 10 美元。 • 警报:如果看门狗认为网络输出不正确, 它公开触发警报,将该机制升级到第二层网络。 那么就有两种可能的结果: – 正确警报:如果第二层网络确认图 16:通过集中警报奖励放大行贿者的成本。行贿 对手必须用超过其通过警报获得的奖励来贿赂每个节点 (显示为红色条)。如果警报奖励是共享的,那么这个奖励可能会相对 小。集中的警报奖励增加了任何单个节点可能获得的奖励 获得(高红色条)。因此,对手为可行的贿赂支付的总金额 (灰色区域)集中的警报奖励比共享的警报奖励大得多。 第一层网络错误,报警看门狗节点获得奖励 包括所有削减的存款,因此超过 $dn/2。 – 错误警报:如果第二层和第一层 oracle 一致,则升级 被认为有故障,并且警报节点失去 $dw 押金。 在乐观接受报告的情况下,看门狗警报不会导致 依赖合同执行的任何变化。对于旨在等待的合同 第二层委员会可能进行仲裁,监管机构发出延迟警报,但 不要冻结合同执行。合同也可以指定一个 裁决期间的故障转移 DON。 9.4.2 二次质押影响 每个节点都可以充当看门狗,并结合严格的节点优先级 确保集中奖励,使该机制实现二次staking 第 9.3.3 节中描述的每种贿赂攻击者的影响。回想一下,这个 具体来说,在我们的设置中,对于具有 n 个节点的网络,每个节点都有存款 $d,成功的贿赂者(上述任何一种)的预算必须大于 $dn2/2。 准确地说,行贿者必须至少破坏 (n+1)/2 个节点,因为行贿者必须 损坏大多数 n 个节点(对于奇数 n,根据假设)。因此,看门狗代表 获得 $d(n + 1)/2 的奖励。因此,行贿者必须向每个人支付这笔金额节点以确保没有人充当看门狗。我们正在努力正式证明,如果 行贿者的预算至多为 $d(n2 + n)/2,则子博弈完美均衡 行贿者和 oracle 之间的博弈——换句话说,平衡点为 游戏进行期间的任何一点——行贿者不得行贿,并且 每个 oracle 诚实地报告其真实值。 我们在上面已经解释了成功的行贿者如何可能需要 预算明显大于节点存款总和。为了说明这一点 直观的结果,图 16 以图形方式显示了集中警报奖励的影响。 正如我们所看到的,如果监管机构警报的奖励——即受贿的存款 报告错误的节点)—分为所有潜在警报,即警报的总量 任何单独的警报节点预计都会相对较小,大约为 $d。 行贿者知道不可能支付超过 d 美元的款项,因此可以使用 一个虚假结果的有条件贿赂,贿赂 n 个节点中的每一个节点,其金额略高于 $d + ϵ。 与直觉相反,图 16 显示了一个广泛分配奖励的系统 发出警报的节点之间的强度远弱于集中奖励的节点 单一看门狗的手中。 参数示例: 考虑一个(第一层)网络,其中 n = 100 个节点,每个节点 存入 \(d = \)20K。该网络将总共存入 200 万美元,但 免受预算为 \(100M = \)dn2/2 的贿赂。增加数量 当然,oracles 比增加 $d 更有效,并且可以产生戏剧性的效果: 具有 n = 300 个节点和存款 \(d = \)20K 的网络将受到保护 预算高达 9 亿美元的行贿者。 请注意,staking 系统在许多情况下可以保护代表 smart contract 的 比提供的贿赂保护水平更有价值。这是因为对手 在许多情况下,攻击这些合约并不能获取全部价值。例如,一个 Chainlink 支持价值 10 亿美元的合约可能只需要针对 拥有 1 亿美元资源的贿赂者,因为这样的对手可以切实地获取利润 仅占合同价值的10%。 注意: 网络的价值可以呈二次方增长的想法表达为 众所周知的梅特卡夫定律 [167, 235],该定律指出网络的价值 连接实体的数量呈二次方增长。然而,梅特卡夫定律 来自潜在成对网络连接数量的增长,这是与我们激励中潜在的二次 staking 影响不同的现象 机制。 9.4.3 第二层的实现 两个操作特性有助于实现高可靠性第二层:(1) 二级裁决在 oracle 网络中应该是罕见的事件,因此可以 比第一层正常运行的成本要高得多,并且 (2) 假设乐观地接受的报告——或可以等待仲裁执行的合同—— 第二层不需要实时执行。 这些功能导致了一系列 第二层的配置选项以满足特定 DONs 的要求。 作为示例方法,第二层委员会可以由由 DON(即第一层)来自 Chainlink 中服务时间最长且最可靠的节点 网络。运营商除了拥有丰富的相关运营经验外, 的此类节点在 FFO 中具有相当大的隐性激励,从而激发了欲望 确保 Chainlink 网络保持高度可靠。他们还公开 可用的性能历史记录可提供其可靠性的透明度。值得注意的是,第二层节点不必是第一层网络的参与者,并且 可以裁决多个第一层网络的故障。 给定 DON 中的节点可以预先指定并公开提交一组 n' 这样的 节点构成该 DON 的第二级委员会。此外,DON 节点发布一个参数k′≤n′,该参数决定第二层投票的数量 需要惩罚第一层节点。当针对给定报告生成警报时, 第二层成员对每个人提供的值的正确性进行投票 第一层节点。任何收到 k′ 反对票的第一层节点将丧失其地位 存款到看门狗节点。 由于审判和延长执行时间的机会很少 如上所述,与第一层相比,第二层中的节点可以: 1. 因审判而获得高额报酬。 2. 利用额外的数据源,甚至超出第一层使用的各种数据源。 3. 依靠人工和/或专家检查和干预,例如识别和 协调源数据中的错误并区分诚实节点中继 错误的数据和行为不当的节点。 我们强调,我们刚才描述的选择第二层节点和政策管理裁决的方法仅代表了一个大问题中的一个点。 第二层可能实现的设计空间。我们的激励机制提供 关于如何实现第二层的完全灵活性。因此,各个 DON 可以 为满足特定要求的第二层制定并制定规则 以及参与节点和用户的期望。 DECO 和 Town Crier 作为裁决工具: 对于第二层来说这是必不可少的 在我们的机制中能够区分敌对的第一层节点 故意产生不正确的报告和无意中诚实的第一层节点 中继源处不正确的数据。只有这样第二层才能实现 削减是为了抑制作弊行为,这是我们机制的目标。德科和城市公告员 是强大的工具,可以使第二层节点做出这一关键区分 可靠。第二层节点在某些情况下可能能够直接查询所使用的数据源 由第一层节点或使用ADO第7.1节来检查是否有错误的报告 由错误的数据源导致。然而,在其他情况下,第二层节点可能缺乏 直接访问第一层节点的数据源。在这种情况下,正确的判决将 似乎不可行或需要依赖主观判断。上一页 oracle 争议系统依赖于低效且不断升级的投票来解决此类问题 挑战。 然而,使用 DECO 或 Town Crier,第一层节点可以证明正确的行为 到第二层节点。 (有关这两个系统的详细信息,请参见第 3.6.2 节。)具体来说,如果 第二层节点将第一层节点识别为输出了错误的报告值~r, 第一层节点可以使用DECO或Town Crier来生成防篡改证据 第二层节点正确地从(启用 TLS 的)源正确中继 〜r 被 DON 认可为权威。至关重要的是,第一层节点可以做到这一点 无需需要直接访问数据源的第二层节点。 17 因此, 对于任何所需的数据源,正确的裁决在 Chainlink 中都是可行的。 9.4.4 误报保险 我们的staking机制实现的强大反贿赂从根本上依赖于 削减奖励给警报者的资金。如果没有金钱奖励,警报者就会 没有拒绝贿赂的直接动机。然而,其结果是,削减的资金并没有 可用于补偿因错误报告而受到伤害的用户,例如损失金钱的用户 当错误的价格数据转发到 smart contract 时。 根据假设,如果报告被接受,不正确的报告不会造成问题。 仅在可能的裁决(即第二层采取行动)之后签订合同。正如所解释的 不过,为了实现最佳性能,合约可能会依赖 对执行正确报告的机制持乐观态度,这意味着他们接受 在潜在的二级裁决之前进行报告。 确实如此乐观的行为 在我们的模型中假设理性对手的预算不超过预算是安全的 staking 该机制的影响。 用户担心由于以下原因而导致的不太可能发生的机制故障: 例如,拥有压倒性金融资源的对手可能希望以误报保险的形式采用额外的经济安全层。我们知道 多家保险公司已经打算提供此类智能合约支持的保单 在不久的将来,针对 Chainlink 安全协议,包括通过 DAOs 等创新机制,例如 [7]。 Chainlink 的性能历史记录是否存在 节点和有关节点的其他数据(例如其权益金额)为风险精算评估提供了异常坚实的基础,从而可以为政策定价 以对投保人来说成本低廉但对保险公司来说可持续的方式。 17借助 Town Crier,第一层节点还可以在本地生成证明 他们输出的报告的正确性,并向网络上的第二层节点提供这些证明 按需基础上。误报保险的基本形式可以在值得信赖和 使用 smart contracts 的有效方式。举个简单的例子,参数保险 如果我们的激励机制有效,合同 SCins 可以自动补偿保单持有人 第二层标识第一层生成的报告中的错误。 希望购买保险的用户U,例如目标的创建者 SC 合约,可以向去中心化保险公司提交保单金额请求 合同金额为 M 美元。在批准 U 后,保险公司可以设置持续的(例如每月) SCins 中 $P 的溢价。当 U 支付保费时,她的保单仍然有效。 如果 SC 发生报告失败,结果将是一对 (r1, r2) 的发射 SC 的冲突报告,其中 r1 由我们机制中的第一层签名, r2,相应的更正报告,由第二层签署。如果U提供 这样一个有效的 SCins 对 (r1, r2),合约会自动向她支付 M 美元,前提是 她的保费是最新的。 9.5 单轮变体 上一小节中描述的协议要求第二层委员会等待 n 轮以确定看门狗是否发出警报。 这个 即使在乐观的情况下,即当第一层运行时,要求也成立 正确。对于不愿意乐观地接受报告的用户,即在潜在的 裁决,与该方法相关的拖延是行不通的。 出于这个原因,我们也在探索只需要一个的替代协议 圆形。在这种方法中,所有 oracle 节点提交秘密位,指示是否 他们希望发出警报。然后,第二层委员会检查这些值 优先顺序。为了提供一个粗略的草图,这样的方案可能涉及以下内容 步骤: 1.看门狗位提交:每个节点Oi秘密共享一位看门狗值 对于它生成的每个报告,第二层中的节点之间 wi 属于{无警报,警报}。 2. 匿名提示:任何oracle节点都可以在提交看门狗位的同一轮中向二级委员会提交匿名提示α。这个提示α 是一条消息,指示已针对当前报告发出警报。 3. 看门狗位检查:第二层委员会揭示oracle节点的看门狗 按优先级顺序排列的位。 请注意,节点在不发出警报时不得发送警报看门狗位:否则,流量分析会显示所有节点的位。该协议确实显示无警报 优先级高于最高优先级警报看门狗的节点的看门狗位。 观察到所揭示的内容与我们的 n 轮协议相同。奖励的分配也与该方案相同,即第一个识别的看门狗 收到提交错误报告的节点的被削减的存款。使用匿名提示使二级委员会能够在没有发出警报的情况下保持非互动,从而降低沟通复杂性 在常见情况下。请注意,任何提出警报的监管机构都有提交匿名举报的经济动机:如果没有提交举报,则不会向任何人支付任何奖励 节点。 确保匿名提示 α 的发送者 Oi 不能被 根据网络数据,攻击者可以通过匿名方式发送匿名提示 通道,例如通过 Tor,或者更实际地,通过云服务提供商代理。至 验证 Tip 源自 O,Oi 可以使用环签名对 α 进行签名 [39, 192]。 或者,为了防止恶意 oracle 节点对第二层委员会进行不可归因的拒绝服务攻击,α 可以是一个匿名凭证, 可撤销的匿名[73]。 该协议虽然实际上是可以实现的,但具有一定的重量级工程 要求(我们正在探索减少的方法)。以第一层节点为例, 必须直接与第二层节点通信,需要维护目录。对匿名通道和环签名的需求增加了工程量 方案的复杂性。最后,简要讨论了一个特殊的信任要求 在下面的注释中。因此,我们也在探索更简单的方案,但仍能实现 超线性 staking 影响,但可能小于二次影响,例如,行贿者渐近需要至少 $n log n 的资源。以下的一些计划 考虑因素涉及随机选择节点的严格子集作为看门狗, 在这种情况下,潜在的贿赂就成为一种特别有力的攻击。 备注: 这种单轮 staking 机制的安全性需要不可攻克 oracle 和第二层节点之间的通道——这是抗强制系统的标准要求,例如投票 [82, 138],并且在实践中是合理的。 然而,此外,寻求与行贿者合作的节点 Oi 可以构建 其秘密共享的方式是向行贿者表明它已对特定的内容进行了编码 值。例如,如果 Oi 不知道行贿者控制哪些节点,那么 Oi 可以 向所有委员会成员提交 0 值股票。然后行贿者可以验证 Oi 的 概率上的合规性。为了避免在任何单轮协议中出现这个问题,我们 要求 Oi 知道至少一个诚实的第二层节点的身份。 使用交互式协议,其中每个第二层节点添加随机化 股份的因素,行贿者能做的最好的事情就是强制 Oi 随机选择 看门狗位。 9.6 隐性激励框架(IIF) FFO 是对 Chainlink 网络中正确行为的隐性激励的一种形式。它 其功能类似于显性权益(即存款),因为它有助于加强经济安全 网络。换句话说,FFO 应包含在(有效)存款中 网络中节点的$d。问题是:我们如何衡量 FFO 和其他形式的隐性激励 在 Chainlink 网络内? 隐性激励框架(IIF)是一套 我们计划为此目的开发的原则和技术。区块链系统 提供多种形式前所未有的透明度,以及节点的高信任记录 他们创造的业绩是我们实现 IIF 如何运作的愿景的跳板。 在这里,我们非常简要地概述了 IIF 关键要素的想法。 IIF 本身将包含一系列我们认为在评估中重要的因素 隐性激励,以及以高保证形式发布相关数据以供分析算法使用的机制。不同的 Chainlink 用户可能 希望以不同的方式使用 IIF,例如,对不同的因素给予不同的权重。 我们期望社区中出现分析服务,帮助用户应用 IIF 根据他们个人的风险评估偏好,我们的目标是促进 通过确保他们获得高可信度和及时的支持数据来提供此类服务, 正如我们下面讨论的(第 9.6.4 节)。 9.6.1 未来的收费机会 节点参与 Chainlink 生态系统,以赚取网络为我们在本文中描述的任何各种服务支付的费用的一部分,从 将普通数据馈送到高级服务,例如去中心化身份、公平排序、 和保密DeFi。 Chainlink 网络中的费用支持节点运营商的成本,例如运行服务器、获取必要的数据许可证和维护 全球员工确保高正常运行时间。 FFO 表示扣除费用后的服务费, 节点在未来会获得收益,或者如果表现出错误行为则会损失。 FFO 是一种有助于保护网络安全的权益形式。 FFO 的一个有用功能是链上数据(由链下数据补充) 数据)建立节点历史的高信任记录,从而实现 FFO 的计算 以透明的、经验驱动的方式。 FFO 的一个简单的一阶度量可以从一个企业的平均净收入中得出 一段时间内的节点(即总收入减去运营费用)。 FFO 可能 然后计算为,例如,累计未来净收入的净现值[114], 换句话说,所有未来收益的时间贴现值。 然而,节点收入可能会波动,如图 17 所示。 更重要的是,节点收入可能不会遵循平稳的分布 随着时间的推移。因此,我们计划在估算 FFO 时探索的其他因素包括: • 绩效历史记录:操作员的绩效历史记录(包括其报告的正确性和及时性以及正常运行时间)提供了一个目标 为用户评价其可靠性的试金石。 因此,性能历史将 为用户选择 oracle 节点提供一个关键因素(或者,随着出现 DONs,他们选择的 DONs)。强劲的业绩历史可能会 与高额持续收入相关。18 18我们打算解决的一个重要研究问题是伪造服务量的检测。图 17:Chainlink 节点在单个数据源 (ETH-USD) 期间赚取的收入 2021 年 3 月具有代表性的一周。 • 数据访问:虽然oracles 可以从开放API 获取多种形式的数据, 某些形式的数据或某些高质量来源可能仅在 认购基础上或通过合同协议。对某些内容的特权访问 数据源可以在创造稳定的收入流方面发挥作用。 • DON 参与:随着 DON 的出现,节点社区将会出现 共同提供特定服务。我们预计许多 DON 将包括 选择性地运营商,参与信誉良好的 DONs 作为 优越的市场地位有助于确保稳定的收入来源。 • 跨平台活动:一些节点运营商可能在其他环境中拥有良好的存在和绩效跟踪记录,例如 PoS validators 或 非 blockchain 上下文中的数据提供者。它们在这些其他系统中的表现(当其数据以可信形式提供时)可以为评估提供信息 他们的表演历史。同样,Chainlink 网络中的错误行为 可能会通过赶走用户(即 FFO)来危及这些其他系统的收入 可以跨平台扩展。 9.6.2 投机性 FFO 节点运营商参与 Chainlink 网络不仅仅是为了从中获得收入 运营,而是创造并定位自己,以利用新的机会来开展工作。换句话说,网络中 oracle 节点的支出也是 关于 DeFi 和其他智能合约应用的未来的积极声明 域以及 oracle 网络的新兴非 blockchain 应用。如今,节点运营商赚取现有 Chainlink 网络上可用的费用,同时 这些与互联网网站上的虚假评论大致相似,只不过问题在 oracle 设置,因为我们有关于货物(即报告)是否已订购和是否已订购的最终记录。 交付——与在网上商店订购的实物商品不同。换句话说,在 oracle 中 即使无法验证客户的真实性,也可以验证性能。建立声誉、业绩历史和运营专业知识,以定位 他们有利于赚取未来网络中可用的费用(当然, 诚实行为)。今天在 Chainlink 生态系统中运行的节点将在此 感觉比新人在赚取额外 Chainlink 费用方面有优势 服务变得可用。这一优势适用于新运营商,以及享有盛誉的科技公司;例如,T-Systems,一个传统的 技术提供商(德国电信的子公司)和 Kraken(一家大型中心化公司) 交换,已在 Chainlink 生态系统中建立了早期存在 [28, 143]。 oracle 节点对未来机会的这种参与可能被视为本身 作为一种投机性 FFO,因此构成 Chainlink 的一种股权形式 网络。 9.6.3 外部声誉 正如我们所描述的,IIF 可以在严格假名的网络中运行 运营商,即不披露所涉及的人员或现实世界实体。 然而,用户选择提供商的一个潜在重要因素是外部因素。 声誉。外部声誉是指对现实世界身份而非假名的可信度的感知。声誉风险 现实世界的身份可以被视为隐性激励的一种形式。我们看信誉 通过 IIF 的视角,即在加密经济学意义上,作为建立 可能会纳入 FFO 估算的跨平台活动。 使用外部声誉作为 FFO 估计因素的好处,而不是 与假名链接相比,外部声誉不仅与绩效相关 运营商现有的活动,也包括未来的活动。例如,如果声誉不好 依附于一个人,它可能会污染这个人未来的企业。换句话说,与假名相比,外部声誉可以捕获更广泛的 FFO 绩效记录,作为个人或既定的不当行为的影响 与假名操作相比,公司更难逃脱。 Chainlink 与去中心化身份技术(第 4.3 节)兼容, 可以为 IIF 中外部声誉的使用提供支持。此类技术 可以验证并从而帮助确保运营商声称的现实世界的准确性 身份.19 9.6.4 开放 IIF 分析 正如我们所指出的,IIF 旨在为以下领域提供可靠的开源数据和工具: 隐性激励分析。 目标是使社区内的提供者能够 开发适合不同部门风险评估需求的分析 Chainlink 用户群。 19如果需要的话,去中心化的身份凭证还可以用经过验证的假名来修饰假名。 补充信息。例如,节点运营商原则上可以使用此类凭证来 证明它是一家财富 500 强公司,但没有透露是哪一家。大量关于节点收益和性能的历史数据 以高度信任、不可变的形式驻留在链上。然而,我们的目标是提供 最全面的可能数据,包括仅在外部可见的行为数据 链,例如链外报告 (OCR) 或 DON 活动。此类数据有可能 内容要丰富。存储它并确保其完整性的最佳方法,即保护它免受 我们相信,篡改将在 DONs 的帮助下,使用所讨论的技术 在第 3.3 节中。 有些激励措施适合直接的衡量形式,例如 staking 存款和基本 FFO。其他的,例如投机性 FFO 和声誉,则更难 以客观的方式进行衡量,但我们认为支持数据的形式,包括 Chainlink 生态系统的历史增长、社交媒体声誉指标等, 即使对于这些难以量化的元素,也可以支持 IIF 分析模型。 我们可以想象专门的 DON 专门用于监视、验证和 记录与节点的链外性能记录相关的数据,以及其他数据 在 IIF 中使用,例如经过验证的身份信息。这些 DON 可以为任何为 Chainlink 社区提供服务的分析提供商提供统一、高信任度的 IIF 数据。 他们还将提供黄金记录,让分析提供商声称 由社区独立验证。 9.7 综合起来:节点运营商激励 综合我们上面关于节点运营商的显性和隐性激励的讨论 提供节点运营商参与并从中受益的方式的整体视图 Chainlink 网络。 作为概念指南,我们可以通过给定的 Chainlink 来表示所涉及的总资产 节点运算符 $S 的粗略、程式化形式如下: \(S ≈\)D + \(F + \)FS + $R, 其中: • $D 是所有网络中所有明确存入的权益的总和,其中 经营者参与; • $F 是所有网络中所有 FFO 总和的净现值 运营商参与的; • $FS 是运营商的投机FFO 的净现值;和 • $R 是Chainlink 生态系统之外的运营商的声誉资产 其 oracle 节点中发现的不当行为可能会危及这一点。 虽然主要是概念性的,但这种粗略的等式有助于表明存在有多种经济因素有利于 Chainlink 节点的高可靠性性能。 除 $D 之外的所有这些因素都存在于当今的 Chainlink 网络中。9.8 经济安全的良性循环 超线性 staking 影响与费用支付表示的结合 因为 IIF 中的未来费用机会 (FFO) 可以带来我们所说的良性循环 oracle 网络中的经济安全。这可以看作是一种经济 规模。随着特定网络保护的总量增加, 增加固定数量的经济安全所需的额外股份会随着增加而减少 每个用户的平均成本。因此,就费用而言,用户加入更便宜 一个已经存在的网络比实现同样的网络经济增长 通过创建新网络来确保安全。重要的是,每个新用户的添加都会降低 该网络所有先前用户的服务成本。 给定特定的费用结构(例如,质押金额的特定收益率), 如果网络赚取的总费用增加,就会刺激额外的流量 投入网络以更高的速度保护网络。具体来说,如果总权益 单个节点在系统中的持有量是有上限的,那么当新的费用支付时 进入系统,提高其FFO,节点数n将增加。感谢 超线性 staking 我们激励制度设计的影响,经济安全 系统将比 n 上升得更快,例如,我们在第 9.4 节中概述的机制中为 n2。 因此,经济安全的平均成本,即贡献的股份数量 一美元的经济安全——将会下降。因此,网络可以向用户收费 较低的费用。假设对 oracle 服务的需求是有弹性的(例如,参见 [31] 了解简要信息) 解释),需求将会上升,产生额外费用和 FFO。 我们用下面的例子来说明这一点。 示例 5. 由于 oracle 网络在我们的激励下具有经济安全性 方案为\(dn2 for stake \)dn,一美元的权益所贡献的经济安全 是 n,因此每美元经济安全的平均成本——即股权数量 对一美元经济安全的贡献是 1/n。 考虑一个网络,其中经济激励完全由 FFO 组成,上限为 每个节点 \(d ≤\)10K。假设网络有 n = 3 个节点。那么平均成本 每美元的经济安全约为 0.33 美元。 假设网络的总 FFO 上升到 \(30K (e.g., to \)31K 以上。给定 每个节点 FFO 的上限,网络增长到(至少)n = 4。现在平均成本 每美元的经济安全下降至约 0.25 美元。 我们在图 18 中示意性地说明了 oracle 网络中经济安全的完整良性循环。 我们强调经济安全的良性循环源于 用户汇集费用。 正是他们的集体 FFO 有利于更大的 网络规模,从而提高集体安全性。我们还注意到,良性循环 经济安全有利于 DON 实现财务可持续性。曾经 创建的、满足用户需求的 DON 应该增长到并超过 oracle 节点的费用收入超过运营成本。

Revenue earned by Chainlink nodes on a single ETH-USD data feed showing correlation with price volatility

Schematic of Chainlink staking scheme with alerting showing watchdog escalation and penalty mechanisms

Schematic of the virtuous cycle of Chainlink staking showing how user fees drive security and value capture

图 18:Chainlink staking 的良性循环示意图。使用费上涨 向 oracle 网络支付 1⃝ 使其增长,从而导致其经济增长 安全2⃝。这种超线性增长在 Chainlink 网络中实现了规模经济 3⃝。具体来说,它意味着经济安全平均成本的降低,即 由费用支付或其他股权来源产生的每美元经济安全 增加。降低成本,转嫁给用户,刺激对 oracle 的需求增加 服务4⃝。 9.9 推动网络增长的其他因素 随着 Chainlink 生态系统的不断扩大,我们相信它的吸引力 对用户的重要性以及作为 blockchain 经济基础设施的重要性将会加速。 oracle 网络提供的值是超线性的,这意味着它增长得更快比网络本身的规模更大。 这种价值的增长来自于 规模经济——随着服务量的增加,每个用户的成本效率更高——以及 网络效应——随着用户更广泛地采用 DON,网络效用增加。 随着现有的 smart contract 继续获得更多价值和全新价值 smart contract 应用程序通过更加去中心化的服务而成为可能, DON 的使用和支付的总费用应该会增加。 增加收费池 转变为创造更加去中心化服务的手段和激励, 从而形成良性循环。 这种良性循环解决了关键的先有鸡还是先有蛋的问题 混合 smart contract 生态系统中的问题:创新 smart contract 功能 通常需要尚不存在的去中心化服务(例如,新的 DeFi 市场通常 需要新的数据源)但需要足够的经济需求才能存在。 各个 smart contract 对现有 DON 的费用汇集将表明对 来自不断增长的用户群的额外去中心化服务,从而催生了它们的诞生 由 DONs 和不断启用新的和多样化的混合 smart contracts。 综上所述,我们认为网络安全的增长是由良性的驱动的 Chainlink staking 机制中的循环体现了更大的增长模式 Chainlink 网络可以帮助实现去中心化的链上经济 服务。

Diagram showing how concentrated alerting rewards amplify the cost for a briber attempting to corrupt the oracle network

Conclusion

Conclusion

In this paper, we have set forth a vision for Chainlink’s evolution. The main theme in this vision is oracle networks’ ability to provide a much broader range of service for smart contracts than mere data delivery. Using DONs as a foundation for the decentralized services of the future, Chainlink will aim to provide performant, confidentialityenhanced oracle functionality. Its oracle networks will offer strong trust minimization through a combination of principled cryptoeconomic mechanisms such as staking and carefully conceived guard rails and service-level enforcement on relying main chains. DONs will also help layer-2 systems enforce flexible, fair ordering policies on transactions, as well as reduced gas costs for mempool-routed transactions. Taken together, these capabilities all drive in the direction of secure and richly functional hybrid smart contracts. The flexibility of DONs will enhance existing Chainlink services and give rise to many additional smart contract features and applications. Among these are seamless connection to a wide variety of off-chain systems, decentralized identity creation from existing data, priority channels to help ensure timely delivery of infrastructure-critical transactions, and confidentiality-preserving DeFi instruments. The vision we’ve set forth here is ambitious. In the short term, we seek to empower hybrid contracts to accomplish goals beyond the reach of smart contracts today, while in the long term we aim to realize a decentralized metalayer. Happily we can draw on new tools and ideas—ranging from consensus algorithms to zero-knowledge proof systems—that the community is developing as the fruit of rapidly evolving research.

Similarly, we expect to prioritize implementation of the ideas in this paper in response to the needs of Chainlink’s community of users. We look forward to the next stage in our quest to empower smart contracts through universal connectivity and establish decentralized technologies as the backbone of the world’s next generation of financial and legal systems. Acknowledgements Thanks to Julian Alterini and Shawn Lee for rendering the figures in this paper.

结论

在本文中,我们提出了 Chainlink 的演变愿景。主题 在这一愿景中,oracle 网络有能力为以下用户提供更广泛的服务: smart contracts 比单纯的数据传输。使用 DON 作为未来去中心化服务的基础,Chainlink 将致力于提供高性能、保密性增强的 oracle 功能。其 oracle 网络将提供强大的信任最小化 通过结合原则性的加密经济机制,例如 staking 和 精心设计的护栏和依赖主链的服务水平执行。 DONs 还将帮助第 2 层系统对交易执行灵活、公平的排序策略,并降低内存池路由交易的 Gas 成本。综合起来, 这些功能都朝着安全且功能丰富的混合智能方向发展 合同。 DON 的灵活性将增强现有的 Chainlink 服务并带来 许多附加的 smart contract 功能和应用程序。其中,无缝衔接 连接到各种链下系统,去中心化身份创建 现有数据、优先渠道有助于确保及时交付关键基础设施 交易和保密 DeFi 工具。 我们在这里提出的愿景是雄心勃勃的。在短期内,我们寻求增强能力 混合合同来实现目前 smart contract 无法实现的目标,同时 从长远来看,我们的目标是实现去中心化的元层。庆幸的是我们可以画画 新工具和想法——从共识算法到零知识证明 系统——社区正在开发该系统,作为快速发展的研究的成果。

同样,我们希望优先实施本文中的想法作为回应 满足 Chainlink 用户社区的需求。我们期待下一阶段 我们寻求通过通用连接来增强 smart contract 的能力并建立 去中心化技术是世界下一代金融的支柱 和法律制度。 致谢 感谢 Julian Alterini 和 Shawn Lee 绘制了本文中的数据。