Bitcoin Nodes Now One Step Closer to Instant Sync

Please fol­low and like us:
Pin Share

Bit­coin light clients are now able to sync to the tip of the blockchain near­ly instant­ly, thanks to a new devel­op­ment enabled by bit­coin start­up Zero­Sync and their work in zero-knowl­edge (ZK) proofs. Ulti­mate­ly, Zero­Sync seeks to enable full nodes to do the same.

ZK proofs allow a prover to gen­er­ate a short math­e­mat­i­cal state­ment that proves to a ver­i­fi­er that a giv­en com­pu­ta­tion is cor­rect with­out reveal­ing any details about such com­pu­ta­tion. Con­struct­ing this proof can be com­pu­ta­tion­al­ly expen­sive, but the state­ment it pro­vides is always very com­pact, regard­less of how large the data served as an input to the proof cal­cu­la­tion was –– enabling blaz­ing fast ver­i­fi­ca­tion of the cor­rect­ness of that data with math­e­mat­i­cal cer­tain­ty. In bit­coin, this math trick can be very use­ful to nodes and clients.

Bit­coin full nodes are noto­ri­ous­ly required to down­load and ver­i­fy every sin­gle piece of data that makes up the blockchain, from its incep­tion in Jan­u­ary 2009 to the present day. Due to the dif­fi­cul­ty in scal­ing such a com­pre­hen­sive set­up, Satoshi Nakamo­to envi­sioned in the bit­coin white paper a dif­fer­ent type of client that would be able to ver­i­fy their incom­ing pay­ments with­out run­ning a full node. 

Bit­coin light clients lever­age a sim­pli­fied pay­ment ver­i­fi­ca­tion (SPV) mech­a­nism. Upon receiv­ing a pay­ment, the client queries net­work nodes to get the head­ers of the longest chain. Then, it is able to find the block to which the incom­ing trans­ac­tion was added –– which shows net­work nodes have accept­ed it as valid. As more blocks get added to the chain after that one, the more con­fir­ma­tions the light client gets that the pay­ment was valid and accept­ed by the net­work into a block.

With­out any need for a con­sen­sus change to bit­coin, ZK proofs improve this set­up by com­press­ing the head­ers into a sin­gle proof. Sim­i­lar­ly to how each bit­coin block effec­tive­ly com­press­es its trans­ac­tions’ data into a Merkle tree and includes the root of that tree in its head­er, ZeroSync’s work takes every bit­coin block head­er and batch­es them into anoth­er Merkle tree. This process allows for the chain of head­ers to be syn­the­sized into a short and light­weight piece of data –– the proof.

The head­er chain proof is able to quick­ly prove whether a giv­en block head­er is includ­ed in the chain. A block head­er can then be lever­aged to attest whether a spe­cif­ic trans­ac­tion was includ­ed in that block. This process is very sim­i­lar to the SPV method described pre­vi­ous­ly, but more effi­cient. Instead of hav­ing to keep a full copy of every head­er in the blockchain for SPV, with ZK proofs the light client only needs to store that small head­er chain proof, being able to sync to the lat­est state of the chain in seconds.

Ulti­mate­ly, what the head­er chain proof is able to prove is that each block in the chain met the dif­fi­cul­ty require­ment at the time it was mined. In oth­er words, ver­i­fy­ing the head­er chain proof allows the user or client to be sure that each bit­coin block up to that giv­en height was mined cor­rect­ly and met the min­ing dif­fi­cul­ty cri­te­ria at the time.

Releas­ing the first com­plete head­er chain ZK proof was ZeroSync’s first mile­stone. To achieve their big­ger vision –– pro­vide a full ver­i­fi­ca­tion of the his­tor­i­cal blockchain to full nodes with­out requir­ing users to down­load and process it –– the team needs to tick two more check­box­es. The sec­ond would take the head­er chain proof up a notch and enable a node to sync sim­i­lar­ly to the Assume Valid func­tion of Bit­coin Core. The third and final one would pro­vide the com­plete bit­coin blockchain sync envisioned.

Assume Valid is an option in Bit­coin Core, enabled by default, that assumes that all scripts up to a giv­en block height are valid. This means that new full nodes sync­ing the blockchain with ini­tial block down­load (IBD) get to skip the ver­i­fi­ca­tion of scripts from the Gen­e­sis block until the block height estab­lished by the Bit­coin Core client at a giv­en release. These scripts are the Wit­ness data part of the trans­ac­tions –– most­ly the sig­na­tures resolv­ing the lock­ing scripts and unlock­ing the funds to be spent, as well as time­locks and oth­er pro­grammed spend­ing con­di­tions. Users do have the option to set ‘assumevalid=0‘ and force their client to per­form full ver­i­fi­ca­tion of all scripts, in addi­tion to the ver­i­fi­ca­tion of the oth­er block con­tents. How­ev­er, the gen­er­al and fair­ly safe assump­tion behind enabling Assume Valid by default is that enough proof of work has been shown up to that giv­en block height that makes it fair to believe the scripts pre­ced­ing it are valid.

ZeroSync’s mid­dle ground offer­ing, when com­plete, will let bit­coin users sync their nodes sim­i­lar­ly to a default Bit­coin Core IBD. The node down­loads all data from bitcoin’s incep­tion to the present day, but only ver­i­fies wit­ness data after the assumevalid height. The UTXO set is also a nec­es­sary part of the equa­tion. To solve for that, Zero­Sync lever­ages Utre­exo, a project that also seeks to increase effi­cien­cy in sync­ing bit­coin nodes. Utre­exo pro­vides the lat­est UTXO set at a giv­en block, and Zero­Sync is able to add that into its ZK proofs-based set­up. The result is a much short­er head­er chain proof and a more com­pact and effi­cient UTXO set, which clients can lever­age to sat­is­fy their pay­ment ver­i­fi­ca­tion needs.

The team’s top tier offer­ing will take things a step fur­ther and allow nodes to syn­chro­nize to bitcoin’s lat­est state with­out assum­ing any script is valid. Using ZK proofs, full nodes would be able to achieve a much faster ini­tial sync with per­haps even greater secu­ri­ty assur­ances than Bit­coin Core’s default set­ting, which uses assumevalid.

It is impor­tant to note that even if Bit­coin Core users dis­able assumevalid –– ver­i­fy­ing all scripts and achiev­ing sim­i­lar secu­ri­ty assump­tions to ZeroSync’s top tier offer­ing –– the latter’s greater val­ue propo­si­tion is still the sub­stan­tial gain in effi­cien­cy and speed for ver­i­fy­ing all this infor­ma­tion. While the bit­coin blockchain cur­rent­ly holds 510GB of data, ZeroSync’s approach will, when com­plete, enable a much quick­er process giv­en the pro­duc­tion of a short and light­weight proof of slight­ly over 1MB –– an improve­ment in per­for­mance of sev­er­al orders of mag­ni­tude over a stan­dard IBD using Bit­coin Core while ensur­ing that the exact same con­sen­sus rules are followed. 

Gains in effi­cien­cy will only become more impor­tant as the bit­coin blockchain keeps grow­ing block after block. Even­tu­al­ly, down­load­ing and ver­i­fy­ing the entire chain could become pro­hib­i­tive in terms of band­width and stor­age –– espe­cial­ly in parts of the world where access to high-speed inter­net and big­ger hard dri­ves is lim­it­ed or expensive. 

Source link

Please fol­low and like us:
Pin Share

Leave a Reply

Your email address will not be published.