EthereumEthereum
0x85...0e12

ELS Listing V1

ELS-LIST-V1

收藏品
大小
37
收藏品
所有者
9
24% 独特的所有者

ELS Listing V1 17

收藏
所属者
0xEd...F684
Ethereum
0xEd...F684
Ethereum
描述
<p>Written by @<a href="https://twitter.com/msfew_eth" rel="noopener noreferrer" target="_blank">msfew</a>, @Shuyang</p><p>Thanks to&nbsp;<a href="https://twitter.com/julesdesmit" rel="noopener noreferrer" target="_blank">Jules de Smit</a>, Sinka, and Guo Yu for review and feedback.</p><h2>Intro</h2><p>Our&nbsp;<a href="https://hyperoracle.medium.com/zkwasm-the-next-chapter-of-zk-and-zkvm-471038b1fba6" rel="noopener noreferrer" target="_blank">previous blog</a>&nbsp;talks about zkWASM and the reason why zkWASM is the perfect basis with general computation, to support flexibility for any user-defined zkGraph of Hyper Oracle’s indexing and automation protocol.</p><p>This blog covers zkPoS and how zkPoS is the most important piece of puzzle, with the ability of proving the consensus with ZK, to complete end-to-end trustlessness of Hyper Oracle’s indexing and automation protocol.</p><h2>TLDR</h2><ul><li>Hyper Oracle is working on zkPoS (prove Ethereum PoS consensus with zero knowledge proof). zkPoS will enable Hyper Oracle’s zkMiddleware to be end-to-end trustless.</li><li>For achieving zkPoS Attestation, we researched all the key modules and logic (proposer selection algorithm, committee shuffling logic…) of Ethereum’s PoS consensus and listed the SNARKified design of them.</li><li>For verifying BLS signatures in zkPoS, we implemented (probably the first) open-source Halo2 Pairing library.</li><li>For further boosting zkPoS Attestation’s succinctness, we proposed the design of recursive proof for consensus of sequential blocks.</li></ul><h2>0. Ethereum PoS Consensus</h2><p>Ethereum is now based on the PoS protocol of Gasper.</p><p>PoS is the Sybil resistance mechanism (<a href="https://twitter.com/stonecoldpat0/status/1570338216946851842" rel="noopener noreferrer" target="_blank">restrict who can participate in the block production process</a>) Ethereum 2.0 has.</p><p><a href="https://github.com/ethereum/pos-evolution/blob/master/pos-evolution.md#gasper" rel="noopener noreferrer" target="_blank">Gasper</a>&nbsp;is the actual PoS consensus protocol with the combination of FFG Casper (finality gadget) and (a variation of) LMD-GHOST (fork choice rule).</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*Pbw9V_eEN50PLj2bF0KAuA.webp"></p><p>Just like the term of zk rollup is more widely used than the one of validity rollup, in this post, we will refer to Ethereum 2.0’s consensus as Ethereum PoS.</p><p>You can explore the related roadmap of Ethereum PoS consensus future by Vitalik:&nbsp;<a href="https://notes.ethereum.org/@vbuterin/single_slot_finality" rel="noopener noreferrer" target="_blank">Paths toward single-slot finality</a>.</p><h2>a) Ethereum PoS: Terms</h2><p>Now that we can dive into the actual concepts of Ethereum PoS.</p><ul><li><strong>Block</strong>: A block (or a slot) is generated every 12 seconds.</li><li><strong>Epoch</strong>: An epoch is composed of every 32 consecutive blocks, with the first block as a checkpoint.</li><li><strong>Validator and Committee</strong>: The set of validators is partitioned into committees that shuffled every epoch.</li><li><strong>Validator Entrance</strong>: To become a validator, a node need to deposit at least 32 ETH and enter the entrance queue for no less than four epochs.</li><li><strong>Validator Exit</strong>: To exit the validator set and reclaim balance, the validator has to stay in an exit queue for no less than four epochs. After exiting the set, there is still a ~27-hour period before being able to withdraw.</li></ul><h2>b) Ethereum PoS: Committee Attestation</h2><p>Each validator in a given committee is mapped into a set of blocks to verify each epoch. The committee is assigned by randao_mix to attest the block.</p><p>The attestation from a committee to a block contains a bit-string representing the votes and an aggregated signature (We will discuss this in later sections).</p><p>A checkpoint is justified after the blocks between it and the previous checkpoint contain at least 2/3 of the total votes. A justified checkpoint will be considered finalized after its successive checkpoint is also justified. Other blocks are justified or finalized when the nearest subsequent checkpoint is justified or finalized.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*X0nGYt087poO1AbwsVieUw.webp"></p><h2>c) ZK Attestation and Committee Attestation</h2><blockquote><strong><em>Attestation in zkPoS Attestation ≠ Attestation in Committee Attestation</em></strong></blockquote><p>To avoid confusion, we need to emphasize that the “attestation” in this section is essentially a local representation of votes for a particular block, which differs from the zkPoS Attestation of a global state we have realized (ZK Attestation).</p><h2>1. zkPoS Attestation</h2><h2>a) Verify Consensus</h2><p>Before understanding zkPoS, we need to know some basics of different definitions of blockchain nodes.</p><p>In Ethereum PoS’s context,&nbsp;<a href="https://dinoeggs.substack.com/p/easier-framing-for-blockchain-nodes" rel="noopener noreferrer" target="_blank">an easier framing of blockchain nodes</a>&nbsp;is:</p><ul><li><strong>Validator</strong>: build, propose, and agree on valid blocks</li><li><strong>Full Node</strong>: download the entire block, including headers and transactions; can self-verify blocks and applies state changes</li><li><strong>Light Client</strong>&nbsp;(or Light Node): download only block headers; can verify Merkle proof to check for transaction inclusion; need to “trust” other nodes on consensus for transaction data</li><li>Other types include Proposer and Builder in&nbsp;<a href="https://notes.ethereum.org/@vbuterin/pbs_censorship_resistance" rel="noopener noreferrer" target="_blank">PBS</a>&nbsp;and Archive Node</li></ul><p><strong>We will then only focus on Light Clients because it’s&nbsp;</strong><a href="https://twitter.com/VitalikButerin/status/873177382164848641" rel="noopener noreferrer" target="_blank"><strong>impossible for ordinary users to run Full Nodes</strong></a>. Apart from “ordinary users,” these scenarios are&nbsp;<strong>only limited to Light Client-like nodes: Mobile, Browser, and On-chain</strong>.</p><p>Light Client also has&nbsp;<a href="https://twitter.com/0xdinoeggs/status/1607816984472989696" rel="noopener noreferrer" target="_blank">different types</a>. They can be classified as verifiers for various usages:</p><ul><li><strong>Consensus Verifier</strong>: verify Merkle proof, making sure part of the consensus (transaction inclusion) is valid, but still need to trust other nodes on the whole consensus</li><li><strong>State Verifier</strong>: verify zk or fraud proof, making sure state transition is valid</li><li><strong>DA Verifier</strong>: verify the availability of transaction data for a newly proposed block</li><li><strong>Full Verifier</strong>: verify all the above of consensus, state, and DA</li></ul><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*QEr29GWikGZsRxDBW2_zSg.webp"></p><p>It needs to be noted that Consensus Verifier Light Client still needs to trust other nodes on the whole consensus. Since it can verify proofs,&nbsp;<strong>why not let it verify ZKP of the entire consensus of Ethereum PoS</strong>?</p><h2>b) Don’t Trust, Verify zkPoS Attestation</h2><p>In Hyper Oracle’s vision, we are aiming at end-to-end trustlessness.</p><p>We need to&nbsp;<strong>implement Light Client that verifies the whole consensus of Ethereum PoS</strong>. In Ethereum’s Roadmap’s The Verge, it is also called “<a href="https://notes.ethereum.org/@domothy/roadmap#What%E2%80%99s-next2" rel="noopener noreferrer" target="_blank">SNARK-based Light Client</a>”.</p><p>The advantages of zkPoS Attestation are:</p><ul><li><strong>Trustless</strong>: remove Ethereum Light Client’s additional trust on other nodes to achieve full trustlessness</li><li><strong>Decentralized</strong>: Ethereum nodes don’t need to rely on centralized services to feed them block headers or other data</li><li><strong>Low Overhead</strong>: verification of zkPoS Attestation is efficient and requires minimal overhead</li></ul><p>This super-powered Light Client will verify ZKP of our zkPoS Attestation (or zkPoS Proof). It can be simply run in web apps or plugins in the browser.</p><p><strong>Verifying zkPoS Attestation will be the prerequisite for making everything of Hyper Oracle ZK-powered</strong>. It will give our meta apps of zkIndexing (Trustless Indexing and Querying with GraphQL) and zkAutomation (Trustless Automation and Keeper with GraphQL off-chain source) the ability to access and sync valid block headers.</p><p>After that, we can grab the receipt, state, and transaction roots with the valid block headers. In zkIndexing’s case, we follow the pipeline of receipt root, then receipts encoded data, and finally get contract events based on receipts raw data with Recursive-length prefix (RLP) decoding.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*TeUW3kZPR-uH9hYM1vh13g.webp"></p><h2>2. Hyper Oracle’s zkPoS</h2><p>The algorithms of PoS are very complex, and difficult to be described in a simple diagram or a single paragraph. Also, implementing them in a ZK way requires a lot of engineering work and architectural considerations (just like zkEVM). Therefore, to implement zkPoS, it is necessary to split up the components and conquer them one by one.</p><p><strong>The most prioritized algorithm of zkPoS is the Block Attestation</strong>. In another term,&nbsp;<strong>verifying BLS signatures with Pairing is the most crucial part of zkPoS</strong>. We will cover this part in detail in the later sections.</p><p>In a nutshell, for Hyper Oracle’s zkPoS, we will implement these algorithms of Ethereum PoS:</p><h2>a) Randomness-based Algorithm</h2><ul><li><strong>Proposer Selection Algorithm</strong></li></ul><p>A random seed before a few epochs will determine the proposer of each block.</p><p>One of this algorithm’s underlying components is the shuffling algorithm, which will also be applied in the next logic.</p><ul><li><strong>Committee Shuffling Logic</strong></li></ul><p>Every epoch, with the random seed and the shuffling algorithm, the whole set of validators is reshuffled into different committees.</p><h2>b) Validator-related Algorithm</h2><ul><li><strong>Validator Entrance</strong></li></ul><p>Validator candidate: Any node deposits ≥32ETH to become a validator candidate.</p><p>Formal validator: After a validator candidate enters a queue for no less than 4 epochs, it will be activated as a formal validator.</p><ul><li><strong>Validator Exiting</strong></li></ul><p>To leave the validator set and withdraw the balance, a node has to enter exit queue for no less than 4 epochs. Such validator exiting can be triggered by voluntary exits or slashing for misbehaviors.</p><p>In particular, validators with an effective balance lower than 16ETH will be inactivated.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*5re3EbRKrLpN-c7YkYRmOA.webp"></p><h2>c) Block Attestation Algorithm</h2><p>A block is attested only if the corresponding committee members of the epoch have a majority (i.e., 2/3) of votes in favor of the block.</p><p>This is realized in the form of aggregated signatures and bit-strings standing for the votes where each bit is 1 if and only if the corresponding validator votes.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*_aWwUz22EvB490HZrg7wOQ.webp"></p><h2>d) Other Logics</h2><p>Note that the variables and reasonings illustrated in this article are the most significant components, but more is needed for fully attesting a block. For example, the randomness and the effective balance are not generated trivially.</p><ul><li>Randomness</li></ul><p>Randomness is referring to the process that a signature (randao_reveal) is mixed into a random source (randao_mix) in every block to determine the random numbers after certain blocks.</p><ul><li>Effective Balance</li></ul><p>The effective balance of a validator needs to be constantly updated and validators with insufficient balance will be deactivated.</p><h2>e) zkPoS in One Graph</h2><p>Due to the complexity of specifying the existing PoS of Ethereum, we provide this figure summarizing the above logic. The two columns represent the data corresponding to two adjacent blocks.</p><p>In particular, the first block (on the left) is a checkpoint. The figure includes the necessary (not sufficient) algorithms for the state transition from the checkpoint block to its next block.</p><p>Each arrow corresponds to at least one constraint to zkPoS Attestation.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*L8v9iRUBoXAeuup2eGWX7g.webp"></p><p>In this figure, we have omitted both effective balance and the Boolean array indicating whether an index is active for simplicity.</p><p>Notice that:</p><ul><li>The committee members are selected according to a random number of certain epochs ago.</li><li>The entrance and exit queues are updated according to the newest deposits, slashing, and voluntary exits.</li><li>Validators in entrance/exit queue joined 4 epochs ago will leave the queue and become activated/deactivated.</li><li>The second block is attested by attestations from the corresponding committees which are stored in later blocks.</li></ul><h2>3. zkPoS: BLS</h2><h2>a)&nbsp;<a href="https://eth2book.info/bellatrix/part2/building_blocks/signatures/#the-building-blocks" rel="noopener noreferrer" target="_blank" style="color: var(--colors-inherit);">BLS Signatures in PoS</a></h2><p>In Ethereum PoS protocol, BLS signatures with BLS12–381 elliptic curve are used, instead of ECDSA with secp256k1 elliptic curve (for user transaction signing).</p><p>Here are some thought processes why BLS with BLS12–381 is chosen:</p><p>1. Why BLS?&nbsp;<strong>BLS has the special property of pairing</strong>.</p><p>2. Why pairing?&nbsp;<strong>Pairing allows signatures to be aggregated</strong>.</p><p>3. Why Aggregation? Although verification of BLS signature is resource intensive and expensive compared to ECDSA due to pairing operations, the benefits are:</p><ul><li><strong>Time</strong>: verify all attestations in a single signature verification operation (verify N signatures with just two pairing and trivial elliptic curve point additions).</li><li><strong>Space</strong>: scale down N bytes of all signatures to 1/N bytes of aggregate signature (approximately and ideally).</li><li><strong>The benefits accrue when the number of signatures is more significant</strong>.</li></ul><p>4. Why BLS12–381? **BLS12–381 is&nbsp;<a href="https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-10" rel="noopener noreferrer" target="_blank"><strong>a pairing-friendly elliptic curve</strong></a>, with **<a href="https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-10#name-for-128-bit-security" rel="noopener noreferrer" target="_blank"><strong>128 bit security</strong></a>.</p><h2>b)&nbsp;<a href="https://eth2book.info/bellatrix/part2/building_blocks/signatures/#verifying" rel="noopener noreferrer" target="_blank" style="color: var(--colors-inherit);">Verifying BLS Signature</a></h2><p>For&nbsp;<strong>verifying BLS signature</strong>, we need three inputs:</p><ul><li><strong>BLS signature itself</strong>&nbsp;(”Add” signatures together with elliptic curve point addition, and get the final point representing the 96-byte signature.)</li><li><strong>Aggregated public key</strong>&nbsp;(Original public keys of the validators can be found in the beacon state. Then “add” them together.)</li><li><strong>Message</strong></li></ul><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*VM-9-hrRSZXu_Hdi6v6dbQ.webp"></p><p>In our previous sections about Light Clients, we know that our most common scenarios are Mobile, Browser, and On-chain. In these scenarios, verifying computations, including aggregating public keys and verifying BLS signature (elliptic curve additions with pairing check), is expensive.&nbsp;<strong>Luckily,&nbsp;</strong><a href="https://medium.com/@ingonyama/bridging-the-multichain-universe-with-zero-knowledge-proofs-6157464fbc86" rel="noopener noreferrer" target="_blank"><strong>verifying ZKP</strong></a>, or specifically, zkPoS Attestation is cheap.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*eEopKYPHmqSDMHmkcnjO3g.webp"></p><p><strong>Verifying BLS signatures with the BLS12–381 curve is one of the critical components of zkPoS Attestation</strong>.</p><p>The computing power needed for such expensive verification can be outsourced to zkPoS Attestation prover. Once the proof is generated, there’s no need for other computations.</p><p>Then, again,&nbsp;<strong>clients just need to verify a ZKP</strong>. That simple.</p><h2>c) More on BLS12–381</h2><p><a href="https://eth2book.info/bellatrix/part2/building_blocks/signatures/#see-also" rel="noopener noreferrer" target="_blank">A trivial but fun fact</a>&nbsp;about BLS signatures and BLS12–381 is that BLS of “BLS signatures” are Boneh, Lynn, and Shacham, while BLS of “BLS12–381” are Barreto, Lynn, and Scott.</p><p>12 in BLS12–381 is&nbsp;<a href="https://hackmd.io/@benjaminion/bls12-381#Motivation" rel="noopener noreferrer" target="_blank">the embedding degree of the curve</a>.</p><p>381 in BLS12–381 is&nbsp;<a href="https://hackmd.io/@benjaminion/bls12-381#Motivation" rel="noopener noreferrer" target="_blank">the number of bits needed to represent coordinates on the curve</a>.</p><p>The curve of BLS12–381 is actually two curves: G1 and G2. Other than diving deeper into the Math part of these curves, some&nbsp;<a href="https://hackmd.io/@benjaminion/bls12-381#Swapping-G1-and-G2" rel="noopener noreferrer" target="_blank">engineering decisions on BLS signature</a>&nbsp;are:</p><ul><li>G1 is faster and&nbsp;<a href="https://medium.com/asecuritysite-when-bob-met-alice/explaining-bls12-381-the-zero-knowledge-proof-curve-aa5eabec8261" rel="noopener noreferrer" target="_blank">requires less memory</a>&nbsp;than G2 due to a smaller field for calculation.</li><li>Zcash chose to use G1 for signatures and G2 for public keys.</li><li>Ethereum PoS chose to use G1 for public keys and G2 for signatures. The reason is that aggregation of public keys happens more often, and public keys are stored in states requiring small representation.</li></ul><p>The elliptic curve pairing between the two curves is called a bilinear map. The essence is that we map G1 X G2 → Gt. You can learn more in&nbsp;<a href="https://vitalik.ca/general/2017/01/14/exploring_ecp.html" rel="noopener noreferrer" target="_blank">Vitalik’s post</a>.</p><p>In&nbsp;<a href="https://alonmuroch-65570.medium.com/bls-signatures-part-2-key-concepts-of-pairings-27a8a9533d0c" rel="noopener noreferrer" target="_blank">simpler words</a>,&nbsp;<strong>pairing is a kind of fancy multiplication we need to evaluate BLS signatures</strong>. The pairing is what we need for our verification part of BLS signatures of zkPoS Attestation.</p><h2>4. zkPoS: Halo2 Pairing for BLS</h2><h2>a) Existing Implementations</h2><p>There are many open-source implementations of pairing on BLS12–381. They are the essential components for implementing verification of BLS signature:</p><ul><li><strong>For Ethereum PoS Client</strong>:&nbsp;<a href="https://github.com/supranational/blst" rel="noopener noreferrer" target="_blank">blst</a>&nbsp;by supranational</li><li><strong>For Learning</strong>:&nbsp;<a href="https://github.com/paulmillr/noble-bls12-381" rel="noopener noreferrer" target="_blank">noble-bls12–381</a>&nbsp;by Paul Miller</li></ul><p>Also, some implementation with ZK languages:</p><ul><li><strong>For Circom</strong>:&nbsp;<a href="https://github.com/yi-sun/circom-pairing" rel="noopener noreferrer" target="_blank">circom-pairing</a>&nbsp;by 0xPARC (<a href="https://0xparc.org/blog/zk-pairing-1" rel="noopener noreferrer" target="_blank">part1 post</a>,&nbsp;<a href="https://0xparc.org/blog/zk-pairing-2" rel="noopener noreferrer" target="_blank">part2 post</a>)</li></ul><h2>b) Hyper Oracle’s Halo2 Pairing</h2><p>To recap, we need implementation with ZK languages because we will prove PoS with our zkPoS Attestation. BLS signature verification is an essential part of zkPoS Attestation, and pairing on BLS12–381 is the basis for BLS signature verification.</p><p>If you read our&nbsp;<a href="https://hyperoracle.medium.com/zkwasm-the-next-chapter-of-zk-and-zkvm-471038b1fba6" rel="noopener noreferrer" target="_blank">last post on zkWASM</a>, you may think, why don’t we just use existing implementations? Here’s our thought process:</p><ul><li><strong>Reusing Implementations in Rust/C/…</strong>: Out-of-the-box solution, but performance may not be optimal directly running them in zkWASM without optimization.</li><li><strong>Reusing Implementations in circom</strong>&nbsp;(circom-pairing): Also out-of-the-box and&nbsp;<a href="https://medium.com/veridise/circom-pairing-a-million-dollar-zk-bug-caught-early-c5624b278f25" rel="noopener noreferrer" target="_blank">audited</a>. Some comparisons will be covered in the next section.</li></ul><h2>c) Comparison between Halo2 Pairing and circom-pairing</h2><p>circom-pairing provides a great PoC implementation of pairings for BLS12–381 curve in circom. And it is used for BLS signature verification in Succinct Labs’&nbsp;<a href="https://github.com/succinctlabs/eth-proof-of-consensus" rel="noopener noreferrer" target="_blank">Proof of Consensus trustless bridge</a>.</p><p>And the reason we don’t use circom-pairing are:</p><ul><li><strong>Product-wise</strong>: circom-pairing makes customization and generality hard. zkIndexing, and zkAutomation are based on user-defined zkGraph (defines how blockchain data will be extracted, and processed into Hyper Oracle Node), and any logic in zkGraph’s syntax must be supported. This one is closely related to tech-stack-wise reasoning.</li><li><strong>Tech-stack-wise</strong>: circom-pairing is not natively compatible with Plonkish constraint system of zkWASM and other circuits. circom-pairing in circom compiles to R1CS, and it’s hard to combine with our Plonkish constraint system (without tooling like&nbsp;<a href="https://anoma.net/blog/a-vamp-ir-s-guide-to-arithmetic-circuits-and-perfectly-boiled-eggs/" rel="noopener noreferrer" target="_blank">VampIR</a>&nbsp;that adds more complexity to our system). Also R1CS is not perfect for proof batching (of course possible).</li><li><strong>Performance-wise</strong>: On proof generation speed, our Halo2 Pairing implementation is much faster than circom-pairing. On gas fee cost, our Halo2 Pairing circuits can be easily integrated with zkWASM circuits (Halo2 Pairing is Plonkish, while circom-pairing is R1CS), so Halo2 Pairing’s gas fee will be much lower.</li></ul><p>In simpler words, if we have to use circom-pairing for BLS signature verification, some short-comings for us mainly are:</p><ol><li><strong>Incompatible</strong>&nbsp;with our existing zk circuits, including zkWASM.</li><li><strong>Negative to products’ full generality and customization ability</strong>&nbsp;on zkGraph</li><li>Or&nbsp;<strong>adds unnecessary complexity to our system</strong>&nbsp;if we integrate it anyways</li><li>And&nbsp;<strong>performance may not be optimal</strong></li></ol><p>The differences illustrated are:</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*WLTRkmo2YKDgfuqY34U2oQ.webp"></p><p><strong>Our final stack is that zkWASM for customized logic (for zkGraph), and Halo2 Pairing as foreign circuit (for BLS with BLS12–381)</strong>. It satisfies both generality (for user-defined zkGraph) and performance (for the entire zk system).</p><p><strong>We are thrilled that we have our own implementation of Halo2 Pairing Library (probably the first open-source implementation out there)</strong>, ready to power zkPoS Attestation. It is open-sourced, and you can check it&nbsp;<a href="https://github.com/DelphinusLab/halo2ecc-s/tree/pairing" rel="noopener noreferrer" target="_blank">here</a>. Below is some more technical details and benchmarks.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*fBIkjHJcfEQoRik8jVvc_g.webp"></p><h2>5. zkPoS: Recursive Proof</h2><h2>a) ZK Recursion</h2><p>Another critical point of zkPoS is recursive proof.</p><p>Recursive proof is essentially proofs of proofs (verifying proof A when proving B), which our Halo2 Pairing can also potentially play a part in because BLS12–381 is the “<a href="https://medium.com/asecuritysite-when-bob-met-alice/explaining-bls12-381-the-zero-knowledge-proof-curve-aa5eabec8261" rel="noopener noreferrer" target="_blank">zero-knowledge proof curve</a>.”</p><p>In general, recursive proof’s&nbsp;<a href="https://www.youtube.com/watch?v=VmYpbFxBdtM" rel="noopener noreferrer" target="_blank">main advantage</a>&nbsp;is:</p><ul><li><strong>Compression (aka Succinctness)</strong>:</li><li>“Rollup” more knowledge into one outputted single proof.</li><li>Eg. Verification(Proof N+1th that proves 0th-Nth’s correctness) &lt; Verification(Proofs 0th-Nth)</li></ul><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*TC_VNRcuyqAsxJ0LlzqWPA.webp"></p><h2>b) Why Recursive Proof for zkPoS?</h2><p>When dealing with&nbsp;<a href="https://bitcoin.org/bitcoin.pdf" rel="noopener noreferrer" target="_blank">a chain of blocks</a>’ consensus, the need for recursive proof amplifies.</p><p><strong>I. Recursive Proof for PoW and PoS</strong></p><p>For a network with PoW consensus: Starting from the highest block, we will recursively check its previous hash, nonce, and difficulty until we reach the start block we defined. We will demonstrate the algorithm with formulas in the next section.</p><p>For a network like Ethereum with PoS consensus: The case will be more complicated. We need to check every block’s consensus based on the previous block’s validator set and the votes until it’s traced back to a historical block with no dispute (like the genesis block of the Ethereum PoS beacon chain).</p><p><strong>II. Effect of Recursive Proof for PoW</strong></p><p>The following figure illustrates the effect of recursive proofs for consensus attestations in compressing more information into a single proof, taking PoW as an example.</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*w2HpjCYz5hit0R9DF3eJKQ.webp"></p><p><strong>III. With or Without Recursive Proof</strong></p><p>Without recursive proof, we will eventually output O(block height) size proofs to be verified, namely, the public inputs of every block attestation and the proofs for every block.</p><p>With recursive proof, except for the public inputs of the initial and the final state, we will have an O(1) for proof for any number of blocks, namely, the first and the final public inputs, together with the recursive proofs pkr. It is a natural question that where have all the intermediate public inputs gone. The answer is that they have become existential quantifiers of the ZK argument and hence canceled out. In simpler words, more knowledge are compressed into the proof by recursive proof.</p><p><strong>IV. Effect of Recursive Proof in Hyper Oracle</strong></p><p>Remember, we are dealing with “light clients” (browsers) with more computation and memory limitations, even though each proof can be verified in constant time (say, 1 or 2 seconds). If the number of blocks and proofs adds up, the verification time will be very long.</p><p>In Hyper Oracle’s zkAutomation, there may be cases of cross-many-block automation that need to be triggered in scenarios like arbitrage strategy or risk management bots. Then a recursive proof for verifying PoS consensus is a must for realizing such an application.</p><h2>c) Hyper Oracle’s Recursive Proof</h2><p>This section has been simplified for ease of presentation and understanding and does not represent an exact implementation in practice.</p><p>In theory, for applying recursive proof for sequentially two chained blocks, the attestation for PoW‘s case (PoS’s case is too complicated to be written in one formula) will be like this illustration:</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*wRMK2fRcEH5oKXRpnB3bZg.webp"></p><p>After changing the intermediate public variables (namely, h_1, pk_2, and preHash_2) into witnesses, the two proofs can be merged into one proof, as shown below:</p><p class="ql-align-center"><img src="https://miro.medium.com/max/1400/1*X4gzD6Cjrz47gtpdXYaD1A.webp"></p><p>We can observe that the public inputs are only h_2, pk_1, and preHash_1. When there are more than two blocks, say, n blocks, we can apply the same technique for n-1 times and fetch a single proof for all the n blocks while preserving only the public inputs of the first pk_1 and preHash_1, along with the final block hash h_n.</p><p>A similar algorithm to this PoW example for recursive proof will be applied to keep Hyper Oracle’s zkPoS Attestation succinct and constant with arbitrary block numbers. Note that the customization logic for zkGraph is not included in this recursive proof in the current stage.</p><h2>6. Path to End-to-end Trustless</h2><p>Our upcoming yellow paper will provide more specifications and implementation details of Hyper Oracle’s zkPoS Attestation.</p><p>To wrap up, zkPoS is based on our unique tech stack of:</p><ul><li>zkWASM for providing 100% customization for user-defined zkGraph</li><li>Foreign circuits, including Halo2 Pairing</li><li>Recursive Proof</li></ul><p>Hyper Oracle is excited about realizing end-to-end trustless indexing and automation meta apps with zkPoS and making the next generation of applications truly decentralized with our zkMiddleware.</p>
详情
代币 ID
17
网络
Ethereum
标准
ERC721