Chainlink 백서

Chainlink

원문

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

to prove to nodes inO that its reportr was correctly relayed from S, without other nodes having direct access to S. Variants and extensions: Town Crier offers an alternative way to achieve the same adapter. The credentials ofOi can be placed in Town Crier instances run by individual oracle nodes inO, with appropriate restrictions on their use [164]. It is also possible to extend MediatedReport so thatO may call any node in O∗, a subset of nodes with access to S. It is also possible to generalize MediatedReport to involve nodes on MAINCHAIN. Such a variant can be helpful in protocols, e.g., staking or optimistic rollups, e.g. [141], that use on-chain arbitration of off-chain computation. C.2 Cross-Ledger Reports ( XL-Report-Read) For many applications, it can be useful to exchange data across DONs. Here we describe a simple adapter to import a basic report from a DON B to another DON A. For simplicity, we assume a unique report of the form ⟨report : (q,r )⟩ onLB for any givenq. Technical approach: As messages on a ledger LB are signed with respect to pkLB, they can easily be authenticated by the set of oracle nodesOA operating Decentralized Oracle Network A if they know pkLB. Adapter XL-Report-Read(OA,LB) Input: (q, pkLB)→L A, for query q and target DON public key pkLB Output:⟨XLreport : (q,r ); pkLB⟩→L A. Security: • Availability: At least one node in OA must have access toLB. • Integrity: r’s correctness depends upon an honest OB. Example application: A DONA may determine that it has sufficient trust in DON B to treat its reports as trustworthy. In this case, it may be more cost-effective to import certain reports than to generate them independently. PKI support: The main challenge in securing report transfer between DONs is maintenance of a supporting public-key infrastructure (PKI), that is, a trustworthy, 127 up-to-date mapping of public keys to DONs. To support this essential functionality in Chainlink, we plan to maintain smart-contract-based directories of Decentralized Oracle Networks and their public keys on all blockchains that Chainlink supports. Variants and extensions: Of course, many other possible cross-DON adapters are possible. For example, DON A may have permission in DON B to import confidential data from LB. In this case, the adapter would require participation from OB. As another example, DON A may have selective write permissions on DON B, in which case a cross-chain adapter for writing data would be possible. Other extensions are possible to handle multiple or ambiguous reports on LB. For example, XL-Report-Read could relay the message M = ( (q,∗),z ) with the highest index z onLB at a given time t. C.3 Confidential Switch ( ConfSwitch) Our previous two examples did not provide on-ledger confidentiality of q or r. We now describe one that does: ConfSwitch. This adapter reveals on chain only a function switch of an aggregate (medianized) report r, and is thus appropriate for price feeds. It provides on-ledger confidentiality forq andr, revealing only a function of the latter. It also enables recording of confidential data for an auditor (with public key pkaud). Such auditing may be important, as the details of transactions that use ConfSwitch are not visible on the ledger or main chain. The data made available to the auditor includes q, switch, and optional auxiliary data α. Technical approach: To provide confidentiality forq and switch (and optionallyα), they are encrypted under the public keys ofO and the auditor.O accumulates reports off ledger and aggregates them into a report r, and outputs switch(r). Neither q nor any report data are written explicitly on L. Strong confidentiality: Strong confidentiality is achievable in ConfSwitch using DECO or Town Crier. In such a variant, players place on L the commitment c = comm(q, switch) to the query and switch. Either player can then use DECO or Town Crier to retrieve reports and prove in zero knowledge their correctness with respect to c. As DECO enables such proofs only for individual reports, an additional step would be required: The user would prove the correctness of ciphertexts on individual reports and then prove the correctness of a claimed output switch(r), i.e., correct medianization and application of switch to the reports. 128 Adapter ConfSwitch (O,S) Input: EncpkO[q, switch], Encpkaud[q, switch,α ] Output:⟨ConfSwitch : switch(r)⟩, for r = median({ri}i :Oi∈O) Security: • Confidentiality: The adapter reveals Mixicle execution details toO, but only switch(r) to observers ofL and MAINCHAIN. • Availability: Availability depends on full availability ofS (although vari- ants are possible that rely on a threshold subset of S). • Integrity: r’s correctness depends upon cryptographic hardness assump- tions, the honesty ofO, and the accuracy of reports from S. Figure 19: Adapter ConfSwitch D Functional Signatures A functional (digital) signature scheme [59], like a conventional signature, has a master (private) key sk that permits signing of any message. Additionally, however, the master key can be used to create a signing key skF , for a function F , that permits signing of any valuey in the range of F , i.e. such that F (x) =y for some input x. A simple way to realize this primitive, given in [59], is as follows (with slight modi- fication). A fresh key pair ( sk′, pk′) is generated. To create the key skF for function F is computed as: skF = ( sk′, cert = Sigsk(pk′‖ F )), where cert here may be viewed as a “certificate” stating that pk′ is a valid public key for a functional signature with function F and master public key pk. A signature on message y using skF , then, takes the form: Sig∗skF (y) = (cert, Sigsk′(y),x ). To verify Sig∗skF (y), i.e., compute verify∗ ( Sig∗skF (y)), a verifier checks thatF (x) =y, and also checks the validity of cert and Sigsk′(y) in the obvious way. The value x (the “witness”) can in principle be large—as in the oracle-oriented use cases we consider. A straightforward remedy [59] that is computationally efficient for the verifier is to substitute for x a SNARK (or zk-SNARK for confidentiality)—a compact proof (argument) of the existence of x. 129 Functional signatures are conceptually straightforward, as are their basic construc- tions. But they provide a useful framework for reasoning about combining source data in oracle networks. D.1 Functional Signatures for Combining Data Returning to Example 4, we can see how a functional signature might be applied to create a proof σ that a value v was correctly computed from the value-signature set pair (V, Σ). Let ( ski, pki) denote the signing key pair for data source Si inS = {S1,S 2,...,S nS}. Suppose pk is a public key for S whose corresponding private key is shared in a threshold manner among data sources; for simplicity, assume ski is Si’s share of sk. We can then define a functional signature that medianizes a set ofnS validly signed values as follows: F (V, Σ) = { median(V ) if ∀i∈{ 1...n S}, verify(pki,σ i,v i) = true ⊥ otherwise. } A functional signature scheme with master key sk, then, can be used to transmit a correctly computed median valuev to SC. The oracle network computesσ∗ = Sig∗skF (v),and sends it to SC, which verifies it by computing verify∗(σ∗, pk,v ). Of course, to improve robustness to data source failures, F can be relaxed to medi- anize a subset of at least kS validly signed values for some threshold kS≤nS, i.e., to accept valid signatures from a quorum of sources, as we do in our example constructions below. D.2 Discretized Functional Signatures Computing σ∗ using a SNARK-based function-signature construction is a computa- tionally intensive task that may be incompatible with high performance DON ap- plications. We therefore propose a relaxed variant we call discretized functional sig- natures, the key idea of which is to place a grid over the space of possible signed values, and constrain the values to that grid. For example if the required answer is a single scalar, the grid could be all the integer multiples of some grid size a∈ R+, aZ ={..., −3a,−2a,−a, 0,a, 2a, 3a,...}. Then a valid signed value is a representation of some az for z∈ Z plus a valid signature over az. The value az need not be the precise answer F (V, Σ), but will be close to it. To formalize this, in addition to the predicate function F from Appendix D.1, the specifi- cation of a discretized functional signature has an additional pair of parameters ( δ,δ′), corresponding to how coarse/fine the constraining grid is. They are as follows: 130 • The parameter δ bounds permitted deviation from the correct output of F . In- formally,21 given a pair (V, Σ), we require that it be infeasible for an adversarial signer (the DON, for our purposes) to generate a signature σ∗ that deviates from the correct output of F (V, Σ) by more than δ, i.e., such that: verify∗(σ∗, pk,v ) ⋀ (|F (V, Σ)−v|>δ ). • The parameter δ′ characterizes how precisely some quorum of values in V must match, for a feasible signature to be guaranteed. I.e., a functional signature σ∗ can always be constructed, givenkS signers{Szi}kSi=1 with observations{vzi} such that|vzi−vzj|≤ δ′ for all i,j . Thus,δ may loosely be viewed as a soundness parameter, whileδ′ is a completeness parameter, in the sense that it specifies that signatures can always be constructed from observations v = (v1,...,v kS) by honest participants as long as v lies within δ′ of the diagonal in V kS-space, under the max norm, i.e. so the larger δ′ is, the larger the set of signable observation sets is. Recall our assumption that ski is a secret share of sk. In describing an example construction, we further assume that Sig is a non-interactive threshold signature, e.g., a BLS signature [54]. In an example below, we will use ( kS,n S)-threshold signatures for some threshold kS≤nS such that kS > 23nS. With this machinery, we can build efficient functional signatures for a variety of different message spaces. The idea, briefly, is for data sources collectively—but non- interactively—to compute partial (kS,n S)-threshold signatures on grid valuesazi∈aZ in the neighborhood of their respective individual values vi. In this way, the data sources in S collectively constrain v, without explicitly computing it. If at least kS data sources emit valuesvi that are sufficiently close, their neighboring grid values will have a common element which they have all signed, collectively creating a threshold signature on a grid point within a δ-bounded neighborhood of a valid v =F (V, Σ). A signature Sig∗sk(v) for v =az is simply a threshold signature on az∈aZ. We illustrate by way of example, describing a construction for medianizing. It is convenient here to define a cell for aZ as an interval of values contained within a pair of successive grid points, i.e., [az,a (z + 1)]. Example 6 (Discretized functional signature for median) . Suppose the value to be signed is a price quote (e.g., the USD price of ETH), and can thus be represented as a positive integer in Z+ (e.g., denominated in some fraction of US dollars such as cents). For the function F (V, Σ) that medianizes a set of at least kS signed source values, the following construction achieves (δ =a,δ′ =a) for any a∈ N. Let 21A more formal security definition would require application of the “discretized” property to the existential unforgeability under a chosen message attack (EUF-CMA) for threshold signatures, for which see, e.g. [118]. 131 ι(vi) = a⌊vi/a⌋, ι′(vi) = ι(vi) +a, i.e., [ι(vi),ι′(vi)] is the highest cell in the grid aZ which contains vi. Each data source Si emits a signature σi of the following form: σi = (σ(1)i ,σ (2)i ,σ (3)) = ( Sigski ( ι(vi) ) , Sigski ( ι(vi) ) , Sigski ( vi )) A signature σi is valid if all the constituent signatures σ(j)i are valid, and the mes- sages in σ(1)i ,σ (2)i are equal to ι(vi),ι′(vi), where vi is the message in σ(3)i .22 A functional signature Sig∗sk(v) = F ({vi},{σi}) can be constructed from the signa- tures{σi}i if there is a common grid point v = az∈ aZ on which some sufficiently large subset of {σ(1)i ,σ (2)i }i contains partial signatures. The scheme in Example 6 achieves δ = a and δ′ = a for the median function F (V, Σ) that medianizes a set of at least kS signed source values, as we will show in the following lemmas. Lemma 1. Given a valid discretized functional signature on v∈aZ, constructed from kS partial signatures on v, { σi = (Sigski(ι(vi)), Sigski(ι′(vi)), Sigski(vi))}kSi=1, it follows that each vi lies in [v−a,v +a]. Proof. Since{σi} can be used to construct a functional signature on v, we must have v∈{ι(vi),ι′(vi)} for each i. Thus one of the following is true: v =ι(vi) = a⌊vi/a⌋ =⇒ vi∈ [v,v +a] v =ι′(vi) = a⌊vi/a⌋ +a =⇒ vi∈ [v−a,v ] Therefore, vi∈ [v−a,v ]∪ [v,v +a] = [v−a,v +a]. 22σ(3)i = Sigski(vi) is not necessary for the correctness of this construction, but including it avoidsdistracting questions about what the median of the observations is, when • a dishonest oracle Si could attest to arbitrary grid cell boundaries irrespective of its observed valuevi, or even without having observed any value vi at all, or • an aggregator of the partial signatures could choose an arbitrary kS-sized subset of the σi’s from which to construct the functional signature It is not hard to optimize this construction to work with only Σ = {(σ(1)i ,σ (2)i )}, and show that the range of possible values for the median implied by the resulting functionally-signed value covers all possible actual median values, as long as less than nS3 answers are dishonest. It requires the minor (but distracting) ontological gymnastics of reassigning inaccurately-reported/nonsensical/nonexistent values of V to arbitrary integers. 132 Lemma 2. Let{vi}mi=1 be a set of observations, and letI⊂{ 1,...,m } be a subset of in- dices which constitute a majority. The median of{vi} lies in [min({vi}i∈I), max({vi}i∈I)]. Proof. Without loss of generality, assume the observations v1,...,v m are sorted. The subsequence arg min i∈I vi,..., arg max i∈I vi is longer than m2 , since|I|> m2 . Therefore, the midpoint(s) 23 of the sequence 1,...,m lie(s) in subsequence, and thus the median lies in [min({vi}i∈I), max({vi}i∈I)]. Lemma 3. Given a valid discretized functional signature on v∈ aZ, from a set of nS signers{Si}, more than two thirds of which are honest, and a signature threshold kS > 23nS, the true median lies in [v−a,v +a]. Proof. By lemma 1, all the vi’s used by honest signers lie in [ v−a,v +a]. While dishonest signers could have signed v on the basis of any observation (or even no observation), the honest participants form a majority of the signers, so by lemma 2 the median observation lies between two honest values in [v−a,v +a], and therefore itself lies in [v−a,v +a]. (The honest signers form a majority because at least kS > 23nS signed, but the number of dishonest participants in the signing group is assumed to be less than 13nS = 12× 23nS < kS2 .) Lemma 4. The discretized functional signature scheme in Example 6 achieves δ = a for the medianization function. Proof. By lemma 3, the true median lies in [v−a,v +a]. All points in this interval are less than a units from v, so the distance from v to the true median is less than a. I.e., the condition from the definition of δ which we desire to be infeasible, verify∗(σ∗, pk,v ) ⋀ (|F (V, Σ)−v|>δ ). is indeed infeasible, for δ =a. Lemma 5. The discretized functional signature scheme in Example 6 achieves δ′ =a. I.e., given a quorum of at least kS signers Q ={Si} with observations |vi−vj| < a for Si,S j∈ Q, a valid discretized functional signature can be constructed from their signatures{σi = (Sigski(ι(vi)), Sigski(ι′(vi)), Sigski(vi))} Proof. LetI = [min({vi}i), max({vi}i)] be the smallest interval containing{vi}i. Since the length of I,| max({vi}i)− min({vi}i)|, is a difference between two elements of{vi} it is less than a. Thus I contains at most one point of aZ. If it contains one, say v, then v∈{ι(vi),ι′(vi)} for all I, because each vi lies in either the cell below or the cell abovev. Therefore a functional signature on v can be constructed from the σi’s. If it does not, it lies entirely within one cell of aZ, and{ι(vi),ι′(vi)} will be the same for all i, so a functional signature can be constructed on either boundary value. 23There are two midpoints if m is even, m2 and m2 + 1, and one midpoint if m is odd, m2 + 1. 133 The technique in Example 6 can be viewed as a means of reducing proximity testing to equality testing by discretizing values within a lattice. Greater resilience to variance (in the sense of larger δ′) can be achieved if participants send signatures over a larger set of grid points in the neighborhood of their observed vi’s. Enriching the discretized functional signature: As described here, a signature Sig∗sk(v) is on a grid point v∈ aZ, and v will be close to but not necessary equal to the medianvmed computed over a set of at least kS node-supplied values. It is possible, however, for a DON also to include vmed in its signed message. If vmed is computed by the DON, then it is a trustworthy value assuming the DON is functioning correctly . In some cases, contracts may wish to consume vmed if|v−vmed|≤ a, use v as assurance against gross inaccuracy of vmed. E Prospective Bribery One class of adversarial behavior we expressly designed our proposed staking mech- anisms to protect against is what we call prospective bribery. This novel attack is a generalization of the bribery attacks described in [166]. Prospective bribes are feasi- ble in and can impact the security of proof-of-work, proof-of-stake, and permissioned systems. In proof-of-work and proof-of-stake blockchains, a prospective briber commits to paying the creator of a future block a specified bribe given that the future block meets some specified condition. For example, a briber could post a bribe to ensure that a future block does not include a specific transaction, or includes a specified ordering. We use the term prospective because the briber actually does not know which node will be chosen to lead the protocol in the relevant round. Still, the bribe can be successful as long as the candidates for that leadership role are aware of the bribe. To grasp the impact of prospective bribery in the context of staking, consider a staking mechanism for an oracle network in which there is a pool of n oracles, and in each round a node is selected at random—using fresh randomness—to unilaterally report the next value. It may appear that this strategy is naturally resistant to bribery attack, as a briber might have no way to determine ahead of time which node to bribe. However a briber can offer a guaranteed bribe to whichever node is selected as leader of the target block, promising a payment if and only if the block returns false (to use the language of Section 9). A briber can guarantee payment of a prospective bribe using a smart contract analogous to those shown in [166]. 134 F Random vs. Committee-Based Oracle Selection It is possible to operate an oracle network in a permissionless or quasi-permissionless way, selecting a random subcommittee ˜O⊂O producing a given reportr or sequence of reports. An ostensible benefit of this approach is its resistance to attacks that corrupt nodes, whether technical or bribery-based. Provided that ˜O isn’t known in advance, an adversary must in principle control close to a majority of O, rather than just ˜O, in order to subvert r with high probability for sufficiently large n. This observation underlies many hybrid consensus protocols, e.g., [120, 182] as well as some oracle protocols, e.g., [25]. We believe, however, that in many applications, it will be beneficial for relying parties to select stable oracle nodes (or committees) , for several reasons: • Non-uniform corruption: Rational nodes’ reliability is a function of incentives that reflect factors beyond their staked assets, such as potential future revenue, reputation, and so forth, as discussed in Section 9. Users may prefer to re
프로젝트로 돌아가기