Flare 백서

Flare

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 4쪽 중 1쪽

Flare Confidential Compute: Powering Interoperability for Flare through TEEs Flare Network Abstract Trusted Execution Environments (TEEs) open up a new avenue in blockchain devel- opment: outsourcing computation to TEEs improves scalability without the traditional compromise of decentralisation and security. This paper introduces Flare Confidential Compute, smart contract infrastructure on Flare allowing users to access TEEs by issuing on-chain instructions. Several applications of this infrastructure are exhibited: firstly, the TEE Protocol Managed Wallet. These wallets allow Flare’s users to issue transactions and manage accounts on external blockchains through Flare, all secured by a combination of the consensus of Flare’s data providers and the security of TEEs. The design of the Protocol Managed Wallet is discussed in detail, including the methods by which users control the wallet. Secondly, Flare Confidential Compute’s wider infrastructure allowing users to build custom TEE based applications, known as Flare Compute Extensions, on Flare. Finally, an upgrade to the Flare Data Connector, improving on various aspects of the FDC design by leveraging TEEs. These features work together to dramatically improve the interoperability between the Flare network and a wide range of sources, both Web 2 and Web 3. 1 Introduction The Blockchain Trilemma stands as a folklore challenge within the blockchain community: how does one appropriately manage the necessary trade-off between scalability, decentral- ization, and security? Outsourcing computations is great for scalability, but undesirable for decentralization and can undermine security by opening up specific points of failure. Recent exploration [1] of the role of Trusted Execution Environments (TEEs) in blockchain systems represents a major new frontier in outsourcing, allowing for scalability and interoperability improvements without compromising the security properties of the network. 1.1 TEEs and Blockchains To best understand the relationship between TEEs and blockchain, it is first important to understand their design. Put simply, a TEE is a hardware secure computing environment that is isolated from its parent operating system to prevent tampering or unauthorized access to its memory. More complex definitions of TEEs can be found in a variety of sources, for example [2]. In blockchain terminology, they are computing environments that support both confidentiality and cryptographically verifiable attestability. Confidentiality in the sense that memory and code running in the TEE cannot be accessed or tampered with, and attestability meaning that the TEE can prove that it is executing the correct code. These two properties enable the scalability offered to blockchains: computation can be outsourced to cloud-based TEEs [3], who can be relied upon to execute their role honestly due to attestability. Further- more, the confidentiality allows for these computations to include security- or privacy-sensitive operations that are typically hard to move off-chain without introducing uncomfortable trust assumptions, and thus avoiding the usual pitfalls of the trilemma. 1 Figure 1: Extending Flare operations to other chains using TEEs. User requests are relayed to the TEE Network by Flare’s data providers. The TEEs then sign the requested action, which can now be exported from Flare. 1.2 TEEs and Flare Flare’s vision for TEE deployment complements the network’s position as an interoperability hub: leveraging TEEs to connect Flare to other blockchains, Web 2 sources, and the wider Decentralized Finance (DeFi) ecosystem. Protocols such as the Flare Data Connector [4] already connect Flare to other blockchains, bringing information on to Flare that is secured by Flare’s data providers. TEEs allow Flare to dramatically widen the scope of its connectivity, while maintaining the fact that consensus among Flare’s providers secures the entire system. To this end, TEE based protocols on Flare will operate through its data providers. TEEs can be registered on a dedicated contract on Flare, with users able to command them through on-chain infrastructure. Users submit requests and instructions to the TEEs through smart contracts, which are picked up by Flare’s data providers. The providers then package and relay the instructions to the appropriate TEEs. Once the majority of data providers have signed-off on an instruction, the TEE will execute the command and, due to their security properties, can be trusted to do so correctly. Thus the combination of Flare’s data providers and the TEE secures the instruction; the providers are responsible for consensus and relaying, and the TEE for execution. In this way, Flare’s consensus is extended to other networks, and Flare’s protocols are empowered to execute on other chains. These two features connect Flare’s users to other blockchains, and even other data sources such as Web 2, all with Flare as a central hub for securing and managing their assets. This design is depicted in Figure 1. 1.3 Flare Deployment This whitepaper describes the first phases of the deployment of Flare’s TEE based architec- ture, known as Flare Confidential Compute (FCC). Two TEE based system protocols are defined: a TEE based protocol managed wallet (PMW) is introduced, a wallet that is si- multaneously capable of executing transactions on other chains yet hosted and managed on Flare. Additionally, a TEE based variant of the FDC, known as the Flare Data Connector v2 (FDC2), is discussed. The system protocols are built as examples of Flare Compute Ex- tensions (FCE), a structure for designing new user-defined TEE based protocols on Flare. The ability for users to design novel extensions on FCC is a primary feature of Flare’s TEE deployment, and is explained in detail in this paper. The novel protocols both function using the overarching TEE architecture highlighted 2 above: for the PMW, a TEE instructed on Flare holds the key for an account on another blockchain, and authorized users can instruct the TEE to execute transactions from this address via smart contracts on Flare. Flare’s data providers enable this by picking up the user instructions from these contracts and relaying them to the TEEs. Similarly, for the FDC2 users submit attestation requests on-chain, which are collected and confirmed by data providers then relayed with confirmations to the TEE. In either case, once a TEE has received an instruction supported by the majority of Flare’s data providers, it faithfully executes the next stage of the protocol: signing a transaction for the source chain for a PMW or preparing an attestation for the FDC2. Finally, data providers or other users relay the results to the appropriate destination. Since TEEs can attest to their state, they can be trusted to manage their duties honestly, and since their memory is confidential, they can be trusted with private keys. Furthermore, the designs do not require TEEs to perform expensive monitoring of Flare or other networks themselves, or indeed any expensive computation. Instead, they act only in response to instructions from Flare’s data providers, who are responsible for the heavy lifting; the TEEs are leveraged to provide an additional layer of security, signing off on the consensus of the data providers, but not overloaded with computations. These simple yet flexible protocols connect Flare to other blockchains, opening up a variety of DeFi opportunities such as bridging and restaking. Of particular interest is the ability to allow movement of assets from chains that do not support smart contracts, such as XRP on the XRP Ledger, to Flare’s smart contract ecosystem. Roadmap.Before describing the novel system protocols, the paper begins with Section 2 which explains how TEEs are deployed and managed on Flare, and Section 3, which explains how FCEs on FCC are defined, built, and managed, opening up both the other designs in this paper and future use cases. Following this, the TEE PMW is described in detail in Section 4, exhibiting the design that enables the wallet to be secured by both Flare’s data providers and the TEE infrastructure. Finally, Section 5 demonstrates how the FCC extension architecture is used to construct the TEE based upgrade of the FDC, the FDC2. 2 TEE Management On Flare In the context of the Flare network, the purposes of TEEs are threefold. Firstly, their ability to attest to deployed code means that TEEs can be trusted to execute tasks honestly without requiring rationality assumptions or incentive structures typical to blockchains. Secondly, TEEs allow for the outsourcing of computations, such as moving gas intensive operations off- chain. Finally, TEEs enable connectivity between Flare and other networks, allowing actions on external chains in response to instructions on Flare. Combined, these properties support facilitating trustless off-chain outcomes from on-chain events, such as bridging operations, where the result of an on-chain transaction on Flare instructs the TEE network to release locked funds on an external chain. The ability of TEEs to take actions based on instructions on Flare will be used in this paper to describe FCC operations such as the TEE PMW deployed. Before describing their implementation, the necessary infrastructure for deploying and operating TEEs as part of FCC is introduced here. 2.1 TEEs and the FSP The Flare System Protocol (FSP) [5] is Flare’s key underlying infrastructure, handling in- formation necessary to support the network’s core protocols. Relevant to FCC, its main 3 responsibilities revolve around managing signing on Flare and keeping track of the evolving weights of each of Flare’s data providers over time. The features of the FSP used to support the TEE infrastructure on Flare are highlighted below. Signing Policy and W eight.Before fulfilling an FCC instruction, TEEs will check that a sufficient proportion of Flare’s data providers have signed off on it. Since Flare uses a stake based security model, this proportion is weighted; namely, an instruction is approved if the TEE sees signatures from more than a threshold value of accumulated weight of Flare’s data providers. Usually, the required weight will be 50% or more, but certain instructions may set different thresholds. The weight used is known as the signing weight on Flare, and it is the same as is used in the FTSO, FDC, and FSP. The current set of data providers, signing weights, and their addresses is referred to as the signing policy on Flare. To calculate the weightW j of thejth data provider, first compute the proportionW j∗ of staked FLR tokens and (capped) delegated WFLR tokens assigned to each data provider address. Then, diversity weighting is applied across the weights of all data providers, so that the signing weight of thejth data provider is computed as Wj = W 3/4j∗ P i W 3/4i∗ . More details on the computation of signing weights can be found in Flare’s other white papers such as that of the FTSO [6]. Each data provider has a public address on Flare corresponding to a public/private key pair, and will use this address to sign transactions submitted to the TEE contracts. Reward Epochs.Flare’s signing policy is updated at the end of each reward epoch, which have a duration of 3.5 days, or around 3360 blocks. At the end of each reward epoch, Flare’s data providers sign the new signing policy for the next reward epoch, which tracks the signing weight of the data providers in the next epoch. Changes in signing weight are a result of changes of stake of Flare’s data providers and changing delegations of Flare’s users, in accordance with a delegated proof-of-stake model. Note that since the data providers in one epoch sign the policy for the next epoch, the first signing policy seen by a new entity such as a TEE must be trusted, after which all proceeding policies can be verified sequentially. 2.2 TEE Ownership on Flare The ownership of TEEs operating on Flare is managed by permissioned entities. Since TEEs can attest to their state, there is only minimal trust required in the owner, who must be trusted not to power-off the machine or otherwise deny access to it. An initial set of TEEs will be managed by the Flare Foundation. Since the operation of TEEs will be rewarded on-chain, and different FCEs will have different requirements for their TEEs, operation is expected to be picked up by other providers in future. This section discusses the details of TEE management on Flare. TEE Security .Ultimately, a TEE is a hardware-based security solution, separating a se- cure, tamper-proof segment of processing power away from the rest of a device’s CPU. This enables the execution of secure code and storage of secure memory such as cryptographic keys. However, TEEs are an evolving technology, and the attack surface is still being explored [7]. Physical security is of particular importance, as physical access is a common attack vector for TEEs. On a cryptographic level, Flare’s TEE based protocols will encourage redundancy 4 as a means of defense, requiring both data providers and several TEEs to sign off on a given instruction. For example, multi-sigs can be used to distribute trust across several TEEs that can have separate management and physical locations. Nonetheless, for the purposes of this paper it is assumed that the underlying TEEs are sufficiently well-secured, capable of storing keys and executing code without attack. To this end, trusted providers running the TEE machines will be screened to ensure that they carefully control physical access to the devices. Furthermore, the make and models of TEEs used on Flare will be monitored, as will the state-of-the-art attacks on TEEs. TEE Attestations.TEE machines can produce secure attestations to their state, including the code they are running and the integrity of their memory. Verifying these cryptographic proofs intermittently is an integral part of trusting the TEE environment. Data, in the form of public keys, required to confirm these attestations is stored on a TEE smart contract on Flare. Requests for attestations from specific TEEs are accompanied by fresh random nonces to ensure that the TEE is validly performing a live attestation rather than replaying an old one. These requests are handled by the FDC2, which publishes a verification of the TEE attestation together with an appropriate timestamp on-chain. Crucially, this means that confirming attestations is a responsibility of Flare’s data providers, with the verification done according to consensus among a weighted majority of them. Similarly, a TEE registered on Flare can have its participation be paused in response to an FDC2 attestation checked by data providers stating that it is not currently available at the right URL and timestamp. FCC Protocol Security .Regardless of the owner of the TEE, TEE operations on Flare are instructed according to a (weighted) threshold of signatures from Flare’s data providers, in accordance with the signing policy of the reward epoch. Thus, the correctness of the execution of operations issued to the TEEs as part of FCC relies on the intersection of two sources: •The security of the underlying TEE instance. •The honest and correct behavior of Flare’s data providers. The security of TEE instances was already discussed, and comes down to trust in the un- derlying hardware and owner. The honesty of a majority of Flare’s data providers is the core assumption of the network’s security, and thus is a suitable building block for a TEE deployment managed on Flare. In the usual case where the threshold value is 50%, a weighted majority is required for both safety and liveness: without a weighted majority of signatures, neither a malicious instruction nor an honest instruction will be executed by a TEE. Proxy Servers.The owner of each TEE controls access to the machine through a proxy, a dedicated server which relays information to and from the TEE. The TEE proxy corresponding to a TEE machine must also be registered on Flare with an appropriate public identity, for which it owns the corresponding private key. Essentially, these servers are what manage the flow of information in and out of the TEEs: they store and update signing policies, data providers communicate with them when instructing the TEE machines, and they store and distribute results of the machine’s computations. Effectively, the proxy servers add a layer of security to the TEE by limiting direct access to the machine to the owner. The TEE owner is responsible for ensuring that information is relayed between the TEE and corresponding proxy server. TEEs will only execute instructions relayed to them if they are appropriately signed by Flare’s data provider, and sign results of any FCC actions: thus, the owner is only trusted for availability of the TEE, and can neither force the TEE to take actions not permitted by FCC nor spoof a TEE operation. 5 In order to simplify exposition, proxy access will not be discussed in detail in this paper, and communication will sometimes be described as directly between TEEs and data providers: since these proxies do not meaningfully impact the user experience or design of the FCEs, this should not cause any misunderstandings. 3 Flare Confidential Compute Flare Confidential Compute (FCC) is the name given to the entirety of the TEE architecture on Flare. It is designed to allow for a variety of applications to be deployed within the TEE network. In this section, the central technical mechanism of FCC is laid out: the ability of the TEE infrastructure to support general, user-defined instructions. These instructions are managed through a system of extensions, where an individual application is known as a Flare Compute Extension (FCE). Definition 3.1AFlare Compute Extensionis defined by the following •A set of supported code versions, each stored as (a hash of ) a virtual machine imple- mentation so that they are reproducible accross TEE machines. •A set of TEEs that are registered to the extension and running the appropriate code. Each such TEE is identified by a unique public identity TEE id that is registered to the extension. The specified TEEs run the supported code, which implicitly specifies a set ofTEE instructions available on the extension. An instruction is a command issued by a user on Flare that is executed by one or more TEEs. These TEEs complete the instruction in response to signed and relayed messages from Flare’s data providers specifying the instruction. Each FCE is identified by a unique ExtensionID, and all functions implemented by FCC are built as functions on an FCE. Though minimal, these requirements are sufficient to define meaningful TEE applications: the supported code defines the functionality of the TEE within the extension, and the set of TEEs defines which TEEs are eligible to participate. In an FCE, TEEs will respond to instructions relayed to them by Flare’s data providers. Their response to these instructions is determined by their code version and their state, which means that the deployed code must be able to perform the given instruction and they must hold any require keys. Similarly, TEE smart contracts on Flare must be able to parse given commands. Beyond this requirement, the instruction can be as general as the user desires, and in particular need not even be limited to blockchain or DeFi use cases. For example, an FCE can be put in place to provide Flare’s users with access to AI services, or link actions on Flare to Web 2 sources. Adding or upgrading current instructions is straightforward: available instructions can be managed on-chain, and participating TEEs can be redeployed, updated to a new version supporting the instruction without changing the underlying identity. System Extension.As part of the deployment of the FCC infrastructure, Flare will ini- tialize the first extension with ExtensionID 0, known as thesystem extension. T
프로젝트로 돌아가기