ARPA 백서

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

e 16 // c o m p u a t i o n . 17 bool success ; 18 // MAC values are for MPC c o r r e c t n e s s v e r i f i c a t i o n . 19 uint256 [] ma cV al ue s ; 20 } 21 19 6 THE SECURE COMPUTATION PROCESSES 22 mapping ( uint256 = > T r a n s a c t i o n ) public txns ; 23 uint256 public ne xt Tx nI d ; 24 25 event T r a n s a c t i o n C r e a t i o n ( T r a n s a c t i o n txn ) ; 26 event T r a n s a c t i o n C o m p l e t i o n ( T r a n s a c t i o n txn ) ; 27 28 /* * 29 * C o n s t r u c t o r function . 30 */ 31 function A r p a C o n t r a c t () public { 32 n ex tT xn Id = 0; 33 } 34 35 /* * 36 * Data consumer calls this function to initiate an instance of MPC and 37 * deposits fund for data usage and c o m p u a t i o n fee . 38 */ 39 function s t a r t T r a n s a c t i o n ( 40 address dataConsumer , 41 address dataProvider , 42 string dataAddress , 43 uint256 numParticipants , 44 uint256 fund ) public payable returns ( bool success ) { 45 require ( msg . value == fund ) ; 46 txnId = ne xt Tx nI d ; 47 n ex tT xn Id += 1; 48 txn = T r a n s a c t i o n ( 49 txnId , 50 dataConsumer , 51 dataProvider , 52 dataAddress , 53 numParticipants , 54 fund , 55 /* i s F i n i s h e d = */ false ) ; 56 txns [ txnId ] = txn ; 57 // Publish new t r a n s a c t i o n i n f o r m a t i o n to notify mpc network 58 // to start c o m p u a t i o n . 59 emit T r a n s a c t i o n C r e a t i o n ( txn ) ; 60 return true ; 61 } 62 63 /* * 64 * The c on se ns us layer of MPC network will call this function to report 65 * c o m p l e t i o n of MPC and upload mpc result ( in cl ud in g MAC values ) for 66 * v e r i f i c a t i o n . 67 */ 68 function s u b m i t R e s u l t ( uint256 txnId , M pc Re su lt m pc Res ul t ) 69 public returns ( bool success ) { 70 txn = txns [ txnId ]; 71 require (! txn . i s F i n i s h e d ) ; 72 uint256 r e m a i n i n g F u n d = txn ; 73 74 if ( v e r i f y M p c R e s u l t ( m pc Re su lt ) ) { 75 // Pay the fee to every party . 76 r e m a i n i n g F u n d -= txn . d a t a U s a g e F e e ; 77 txn . d a t a P r o v i d e r . send ( txn . d a t a U s a g e F e e ) ; 78 for ( worker : mp cR es ul t . p a r t i c i p a n t s ) { 79 r e m a i n i n g F u n d -= worker . c o m p e n s a t i o n ; 80 worker . address . send ( worker . c o m p e n s a t i o n ) 81 } 82 } 20 6 THE SECURE COMPUTATION PROCESSES 83 require ( r e m a i n i n g F u n d >= 0) ; 84 // If the data consumer d ep os it ed extra fund , or MPC v e r i f i c a t i o n 85 // failed , refund the money to data consumer . 86 if ( r e m a i n i n g F u n d > 0) { 87 d a t a C o n s u m e r . send ( r e m a i n i n g F u n d ) ; 88 } 89 90 txn . i s F i n i s h e d = true ; 91 // Publish new t r a n s a c t i o n i n f o r m a t i o n to notify mpc network 92 // to start c o m p u a t i o n . 93 emit T r a n s a c t i o n C o m p l e t i o n ( txn ) ; 94 return true ; 95 } 96 97 function v e r i f y M p c R e s u l t ( M pc Re su lt m pc Re su lt ) public returns ( bool success ) { 98 // Some MPC f ra me wo rk verifies MAC by checking ( sum == 0) . 99 // This is only for i l l u s t r a t i o n purpose . 100 return m pc Re su lt . success && sum ( m pc Re su lt . m ac Va lu es ) == 0; 101 } 102 } Listing 1: ARPA Smart Contract 6.2 Nodes Selection The nodes who will be participating in the computation are randomly selected based on a decen- tralized random function(DRF). One good candidate of such function is RANDAO, which is also a proposed in Ethereum PoS system[10]. Combined with randomness from DRF, participating nodes are also selected based on the node’s performance, condition, success rate, latency, etc. 6.3 Off-Chain Computation Currently on-chain consensus is reached when everyone is receiving the same result, by executing smart contracts on each individual VM. There is no final authority when decentralized. Everyone has to validate every transaction in order to agree with others. The most prominent problem is the amount of gas consumed for every block. The reason that everyone has to repeat the same calculation is that blockchain is a trustless network and everyone must do the same and reach to the same result to trust others. In other words, there is no way to verify the result without actually going over the whole process, i.e. executing the code, in a trustless network. Computation-intensive calculations are expensive on Ethereum and solidity is not good at ex- pressing complex functionality. One way to compute complex function is to simply run it off-chain. Various solutions[19, 18] are focused on how to prove the correctness of an off-chain computation. In order to bring computation off-chain, we need a verifiable scheme in the computation delegation process. For example, if one wants to prove that they have been somewhere, the best proof is an item that is unique to that place, such as a souvenir. We can think of off-chain computation as a delegation process, and the envoy has to prove that he actually did finish the task. Similar to this concept, an off-chain computation scheme needs a verification scheme that: 1. Can prove that the computation is faithfully done, 2. The amount of work done cannot be exaggerated, and more importantly, 3. The privacy of the content is guaranteed and nothing is revealed to the participants. 21 6 THE SECURE COMPUTATION PROCESSES Figure 9: Off-chain computation This relationship is illustrated in Figure 9 We use Information Theoretic MAC to attain these desired properties. The following section will describe how MAC is used and why it can become the critical component in off-chain computation. 6.4 Computation Verification Computation Verification scheme is the cornerstone of verifiable computation. As mentioned earlier, the current state of smart contract execution is duplicated across all nodes on blockchain. However, using MPC, the computation is guaranteed by mathematics and can be safely delegated to another set of nodes. In other words, the process can be trusted by a third party, as long as they provide proof that the process is done in a correct way. This question can be further broken down into three conceptual parts: 1. The computation is conducted with prescribed function and correct input data, 2. The proof cannot be forged, and 3. The proof can be verified by other nodes. Under our MPC protocol, we are securing up to n-1 malicious notes using MAC. As described earlier, MAC is a value that can be used to confirm a message has been created by a certain party who knows the MAC key, and to detect if a message has been changed. While the Smart Contract is being executed, a secure computation request is sent out from an external blockchain node to the computation layer. The computation network then selects several nodes for the task, and data provider’s node is also included in the group. If any other party deviates from the protocol, such as sending incorrect result, the proof-carrying data will not be reconciled and the result will be discarded. Therefore, part 1 is guaranteed by our MPC protocol cryptographically. After each party in the computation group finishes their work, they sign their MAC with their own private key, and store them on the DHT-based distributed storage. This prevents the MAC from being forged by a third party. Therefore, the proof cannot be forged and can be trusted to be authentic, even on a publicly-accessible storage. This produces desired property of part 2. On the consensus layer, it is easier to claim that nodes should not trust other computation proof if they did not participate in the actual computation. Since the computation nodes was selected randomly, it takes alln nodes to be colluded to pass the MAC check, which is a negligible probability or extremely high cost for the malicious party to control almost all the nodes in the network. And in such case, the network is probably does not exist anymore. In other words, the probability that can one trust the consensus network but not the computation network is not plausible. 22 6 THE SECURE COMPUTATION PROCESSES Therefore, under the protocol, we know that if MAC does not pass the check, it means the computation was wrong because some node did it incorrectly. On the opposite, if the MAC does pass the check, we know that the computation was done correctly and the result can be trusted. In summary, we now can conclude that the secure computation can be broken down into compu- tation and verification parts. Further, we are able to prove that by using a privately-signed MAC, we can trust the related result, as well the identity of the signer. 6.5 MAC with Off-chain computation In our off-chain computation phase, MAC is used in secret sharing schemes to ensure that corrupted parties cannot lie about their share and cause an incorrect value to be opened during reconstruc- tion. The following equation shows how MAC proves correctness and integrity of computation. The protocol is under a full threshold active security model where security is guranteed even there is one honest party. This particular party can be data provider or computation initiator who has natural motivation to follow rules. An authenticated secret value x∈ F is defined as the following: ⟨x⟩ = (x1,...,x n,m 1,...,m n,α 1,...,α n) (2) where each party Pi holds an additive sharing tuple (xi,mi,αi) such that: x = n∑ i=1 xi,x·α = n∑ i=1 mi,α = n∑ i=1 αi. (3) When open a value⟨x⟩, all players do the following protocol: 1. Compute σi =mi−αxi. 2. Call FCommit with (Commit, σi) to receive handle τi 3. Broadcast σi to all parties by calling FCommit with (Open, σi). 4. If ∑iσi⁄= 0 then abort and output ⊥; otherwise continue. The protocol achieves the integrity and correctness of computation by information-theoretic se- curity of secret sharing and the following property. ∑ i σi = ∑ i (mi−αxi) = ∑ i mi−α ∑ i xi ∑ i σi = ∑ i (mi−αix) = ∑ i mi−x ∑ i αi (4) It can be observed that, when given a MAC global key or value x, the protocol can check the result with MACs. These two ways can be used to ensure the correctness of computation by checking on intermediate and result by checking on output. Now we can see how MAC helps to protect the computation when at least 1 party act honestly. Furthermore, we can also find that the broadcast value i leaks no information on either secret value or MAC value because they are not correlated. Therefore, it is possible to transfer this check from computation layer to consensus layer, which helps to reach consensus on-chain. Also, the final summation ofi is mathematically simple to deploy any kind of virtual machine. In conclusion, MAC check is the ideal operation to promote consensus and protect computation privacy. Public auditable MPC [5] lift verifiability to arbitrary secure computations. Auditability means that even if all the servers are corrupted, anyone with access to the transcript of the protocol 23 7 CRYPTOECONOMICS can check that the output is indeed correct. This characteristic enables the separation of the input parties, computing parties, and the validator. After the protocol is executed, anyone acting as the validator can retrieve the transcript of the protocol from the bulletin board, and determine if the result is valid or not by using only the circuit and the output. The protocol will instruct computing parties to make part of their conversation public and logged on the bulletin. The verification is reached by linear commitments on secret inputs instead of traditional use of non-interactive zero knowledge proof. The more ambitious properties that public auditable MPC is willing to achieve are universal veri- fiability, where the validators must not know the output and observe any process of the computation, but still hold computing parties accountable by Pedersen commitment. 6.6 Data Storage The Distributed Hash Table (DHT) is a decentralized distributed storage system that provides a look-up service similar to a hash table. The data is distributed over the whole network of nodes, while any data is searchable by querying any node. To achieve that, the DHT (Figure 10) defines a key space (for example, 160-bit string) and maps the entire data set onto this key space. The key space is then partitioned into chunks and assigned to nodes so that a node is only responsible for storing part of the data set. Another property is that every node keeps an index of mapping from key to the address of node(s) which stores the data with that key. With an overlay network connecting all nodes, a query that reaches any node can leverage the index to be routed to the node hosting queried data. Figure 10: DHT lookup The decentralization and fault tolerance nature enable DHT to be more resilient to a hostile attacker than a typical centralized storage system. DHT can also be designed to have Byzantine fault tolerance[23]. This makes it feasible to handle MAC value storage in ARPA’s network, as no individual MPC node can be trusted. On the other hand, if we choose an arbitrary MPC node to store the MAC value, there is a chance that the node will supply a forged value, either because it happens to be a malicious node or it is under hostile attack. 7 Cryptoeconomics Bitcoin is considered the first massive deployment of a Byzantine Fault Tolerant (BFT) protocol in real world. Byzantine failures are considered the most general and most difficult class of failures among the failure modes. In 1999, the Practical Byzantine Fault Tolerant(PBFT)[28] was introduced 24 7 CRYPTOECONOMICS and received immediate notice. The algorithm is designed to work in asynchronous systems and is optimized to be high-performance, with an impressive overhead runtime, and only a slight increase in latency. However, the solution works on a permissioned system, meaning that the nodes have to be authorized to join the network. This property works well on closed blockchain system like Hyperledger[1], Steller[25] and Ripple[34]. The Bitcoin network, on the other hand, is a permissionless network. It works in parallel to generate a blockchain allowing the system to overcome Byzantine failures and reach a coherent global view of the system’s state. To achieve decentralized consensus on a permissionless network, Bitcoin invented a new consensus scheme called proof-of-work. This consensus scheme has three major properties: 1. The ”work” is a NP hard problem to prover but easy to verify by verifier. 2. The more stake (computation device) and cost (electricity) a node is willing to put into the system, the higher the chance that this node will be the first to solve the work. 3. The node who solves the work first will be rewarded and its ledger is broadcasted and trusted. The prover, who found the hash value that satisfies the nonce, can be trusted because he puts tremendous efforts/cost/stake in this game, and it would not be a rational decision to hack the system. Otherwise he gained nothing with depreciating token value. The difference between PBFT and Bitcoin is that the former makes an honest assumption of participants (a permissioned network), while the later gives a more realistic and real-world assump- tion of Economic Rationality [30], a concept from neoclassical economics, which is maximization of subjective utility. Chain-based blockchain systems like Bitcoin or Ethereum prefer plausible liveness to correctness, while BFT consensus algorithm can ensure transactional correctness but may not be able to finalize conflicting blocks and can get stuck. In Ethereum and other blockchain networks based on the Nakamoto(Proof-of-Work, or PoW) consensus, the fundamental assumption is that the computation resource is scarce. If everyone is verifying transactions, there will be no final state of transaction history agreed by everyone. If a leader in the network propose a block of transaction and everyone else only has to verify that, the situation is alleviated. Therefore, consensus is reached based on block of transactions, proposed by a participating node who solved a cryptographic puzzle using fairly large amount of computation power. This brings a trustworthy ”finality” to the blockchain network. In essence, Bitcoin created a game where verification (of the hash work) is much more simpler than the computation of the function(verify the transactions). Nakamoto consensus protocol transfers the trust needed to verify transactions to a puzzle game. With economic rationality mentioned ahead, the finality of the state is set by a trusted leader who solves the hash puzzle. Similar to how Bitcoin reached decentralized consensus, our work makes Economic Rationality assumption to MPC, so that the cryptographic protocol can be deployed as a permissionless network. On the contrary to the assumption of Proof-of-Work consensus, ARPA designed the MPC protocol where verification of computation is even simpler than hash verification, using information theoretic MAC. This feature opens new possibilities of consensus, explained in the Consensus(7.6) section. 7.1 Economic Rationality We aim to deploy an MPC network with cryptoeconomics considered. While in cryptography the most basic assumption is that some parties are simply honest (or not), in economics the assumption is that the parties are rational and their utilities can be quantified, such that with a proper incentive mechanism all (or at least most) of them can be discouraged from deviating the protocol. Under rational behavior, everyone will attempt to break from the rule and gain as much as possible. But to a point where no more economic benefits one can gain. If the situation occurs 25 7 CRYPTOECONOMICS where deviating the protocol, or even sabotaging the whole network, is in the best interest for the participating nodes, they would do so for their own benefit. On the contrary, participants will follow the protocol if the incentive received when following protocol is more than expected return from breaking it. We designed a incentive system that will punish those who deviates from the protocol, and the punishment is more than the expected return when colluding with others. This will eliminate participating nodes to take chance in the system. This system will be explained in detail in section 7.3. Sybil attack is common in peer-to-peer network, in which spawning identities will help the attacker to gain disproportional advantage on voting or influence. In PoW consensus scheme, the spawned nodes are bounded by the real computation power on their physical machine. Therefore, the risk of sybil attack is mitigated. We designed a credit system that each node is in multiround game system, and it is the best interest for them to keep the same identity (than register a new address) and follow the protocol. Without rationality, one can simply believe that the super admin of AWS (or anyone with un- limited computation resources) can attack Bitcoin and destroy its belief system. But in reality, it doesn’t have to be worried because 1. A rational person would not do so without a budget. 2. When invested with computation resources, a rational participant would rather make more economic return by staking in the game than sabotage a network with some upfront cost. 3. A rational person will not assume that others would so that Therefore, it can be concluded that this sabotage behavior will never happen. With a properly designed incentive system, one brings the question from a mathematical (ab- solute) perspective to a more realistic angle, where every participant can be ”guided” to follow the protocol, and those who don’t will be punished. 7.2 Identity and Reputation At the time a new node joins the computation network, it is allocated a unique account in the consensus layer. The account will be served as public identity of such node. With asymmetric encryption, the network can generate private/public key pairs as the identity for a node. The public key serves as the node identification and information authentication. To prove the authenticity of the result, one has to sign the MAC value wit
프로젝트로 돌아가기