LearnBitcoin

Bitcoin Dev Archive 2023

ZeroSync: Introducing Validity Proofs to Bitcoin

6 messages, 12 May to 28 Aug 2023. Started by Robin Linus.

Robin Linus (2), Weiji Guo, Peter Todd, Erik Aronesty, blk0

Permalink Original thread on gnusha.org

Robin Linus permalink original

Hi all,

Today we are publishing a summary of our research on "ZeroSync: Introducing Validity Proofs to Bitcoin".

Here's the preface:

We introduce ZeroSync, the first-ever proof system addressing Bitcoin’s scalability challenges with Succinct Non-Interactive Argument of Knowledge (SNARKs). ZeroSync compresses the entire Bitcoin blockchain into a compact proof of validity, enabling instant verification and unlocking various innovative applications. We discuss our prototype implementation of a chain state proof, utilizing the Cairo language, Utreexo, and recursive STARKs. Our work enables diverse applications, including quick bootstrapping of full nodes, trustless light clients, enhanced Lightning Network privacy, and secure cross-chain bridges. Chain state proofs require no consensus changes, which is crucial as forks in Bitcoin are challenging to implement and achieve consensus for. Despite the existing bottleneck of prover performance, we present a range of optimization strategies and demonstrate the practicality of generating a complete chain state proof. Finally, we introduce zkCoins, a client-side validation protocol combined with zeroknowledge SNARKs, drastically improving privacy and throughput of token transactions. In combination with future Bitcoin features, such as Simplicity, zkCoins also enables private and more scalable BTC transactions. The groundbreaking compression capabilities of SNARKs initiated a paradigm shift in cryptocurrency design, and ZeroSync is pioneering their application to Bitcoin.

You can find the full paper here: https://zerosync.org/zerosync.pdf <https://zerosync.org/zerosync.pdf> Happy to receive any comments and answer any questions the bitcoin dev community may have about the paper!

Best regards, Robin Linus

Weiji Guo in reply to Robin Linus permalink original

Hi Robin,

Could you please expand more on how you plan to "implement a SNARK verifier on Bitcoin’s base layer"?

For your information, I happen to be the one proposing a new opcode OP_ZKP to enable the Bitcoin network to verify zkp proofs. My proposal requires a soft fork. You may find more information from the email archive here: https://www.mail-archive.com/bitcoin-dev@lists.linuxfoundation.org/msg12601.html

We might be tackling similar issues and probably could benefit from each other.

Thanks, Weiji

On Fri, May 12, 2023 at 9:16 PM Robin Linus via bitcoin-dev < bitcoin-dev@lists•linuxfoundation•org> wrote:

Quoted text (44 lines)
> Hi all,
>
> Today we are publishing a summary of our research on "ZeroSync:
> Introducing Validity Proofs to Bitcoin".
>
>
> Here's the preface:
>
> *We introduce ZeroSync, the first-ever proof system addressing Bitcoin’s
> scalability challenges with Succinct Non-Interactive Argument of Knowledge
> (SNARKs). ZeroSync compresses the entire Bitcoin blockchain into a compact
> proof of validity, enabling instant verification and unlocking various
> innovative applications. We discuss our prototype implementation of a chain
> state proof, utilizing the Cairo language, Utreexo, and recursive STARKs.
> Our work enables diverse applications, including quick bootstrapping of
> full nodes, trustless light clients, enhanced Lightning Network privacy,
> and secure cross-chain bridges. Chain state proofs require no consensus
> changes, which is crucial as forks in Bitcoin are challenging to implement
> and achieve consensus for. Despite the existing bottleneck of prover
> performance, we present a range of optimization strategies and demonstrate
> the practicality of generating a complete chain state proof. *
> *Finally, we introduce zkCoins, a client-side validation protocol combined
> with zeroknowledge SNARKs, drastically improving privacy and throughput of
> token transactions. In combination with future Bitcoin features, such as
> Simplicity, zkCoins also enables private and more scalable BTC
> transactions. *
> *The groundbreaking compression capabilities of SNARKs initiated a
> paradigm shift in cryptocurrency design, and ZeroSync is pioneering their
> application to Bitcoin.*
>
>
> You can find the full paper here: https://zerosync.org/zerosync.pdf
> Happy to receive any comments and answer any questions the bitcoin dev
> community may have about the paper!
>
>
>
> Best regards,
> Robin Linus
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation•org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
Robin Linus in reply to Weiji Guo permalink original

Hi Weiji,

Quoted text (1 line)
> Could you please expand more on how you plan to "implement a SNARK verifier on Bitcoin’s base layer"?

First, I should clarify that I see this as a long-term option, which will take years. If Simplicity gets activated, we could use it to implement a SNARK verifier on Bitcoin's base layer. But for now, we just plan to experiment with Simplicity on the Liquid sidechain when it gets activated.

Quoted text (1 line)
> For your information, I happen to be the one proposing a new opcode OP_ZKP to enable the Bitcoin network to verify zkp proofs. My proposal requires a soft fork. You may find more information from the email archive here: https://www.mail-archive.com/bitcoin-dev@lists.linuxfoundation.org/msg12601.html <https://www.mail-archive.com/bitcoin-dev@lists.linuxfoundation.org/msg12601.html>

I've seen it; however, I suppose it is hard to establish consensus over some particular kind of op_snark_verify opcode because there are so many competing proof systems with different trade-offs. For example, STARKs are great for a chain state proof as they are scalable and allow for processing huge circuits; however, I would not favor STARKs for an on-chain verifier because there are other proof systems, such as Plonky2, with much smaller proof sizes.

A nice thing about SNARK verifiers is that once we have any verifier, we can use it to wrap other proofs. E.g., we could "compress" the size of a STARK by verifying it in a Plonky2 proof. Still, Simplicity offers much more flexibility and allows to update verifiers as the research advances.

Quoted text (1 line)
> We might be tackling similar issues and probably could benefit from each other.

Sounds good! Please join our Telegram group, if you would like to chat about SNARKs on Bitcoin https://t.me/zerosync_chat <https://t.me/zerosync_chat>

Cheers, Robin

Peter Todd in reply to Robin Linus permalink original

On Fri, May 12, 2023 at 02:12:03PM +0200, Robin Linus via bitcoin-dev wrote:

Quoted text (14 lines)
> Hi all,
>
> Today we are publishing a summary of our research on "ZeroSync: Introducing Validity Proofs to Bitcoin".
>
>
> Here's the preface:
>
> We introduce ZeroSync, the first-ever proof system addressing Bitcoin’s scalability challenges with Succinct Non-Interactive Argument of Knowledge (SNARKs). ZeroSync compresses the entire Bitcoin blockchain into a compact proof of validity, enabling instant verification and unlocking various innovative applications. We discuss our prototype implementation of a chain state proof, utilizing the Cairo language, Utreexo, and recursive STARKs. Our work enables diverse applications, including quick bootstrapping of full nodes, trustless light clients, enhanced Lightning Network privacy, and secure cross-chain bridges. Chain state proofs require no consensus changes, which is crucial as forks in Bitcoin are challenging to implement and achieve consensus for. Despite the existing bottleneck of prover performance, we present a range of optimization strategies and demonstrate the practicality of generating a complete chain state proof.
> Finally, we introduce zkCoins, a client-side validation protocol combined with zeroknowledge SNARKs, drastically improving privacy and throughput of token transactions. In combination with future Bitcoin features, such as Simplicity, zkCoins also enables private and more scalable BTC transactions.
> The groundbreaking compression capabilities of SNARKs initiated a paradigm shift in cryptocurrency design, and ZeroSync is pioneering their application to Bitcoin.
>
>
> You can find the full paper here: https://zerosync.org/zerosync.pdf <https://zerosync.org/zerosync.pdf>
> Happy to receive any comments and answer any questions the bitcoin dev community may have about the paper!

Two serious issues with this proposal:

1) You're creating an alternative implementation of the Bitcoin protocol. There is a _long_ history of such implementations failing to implement an exact copy of the consensus rules, leading to potential forks. Obviously, if only used by otherwise lite clients, there is less of a risk associated with this. But the risk is there and will expand as this tech is used for more sophisticated things.

2) If the tech advances to the point where proof-generation is fast enough to happen in real time, Bitcoin miners adopting it along with and other widepsread adoption it may cause Bitcoin to lose its decentralization. At the heart, Bitcoin's consensus is a proof of publication scheme: miners are (weakly) forced to publish blocks by the fact that users and other miners demand blocks to both validate their coins, and mine further. Without blocks themselves being published on a timely basis, the censorship resistance of Bitcoin fails because only a subset of miners actually have the necessary block data to create new blocks with transactions in them. There's also other scenarios where these capabilities could be abused, eg with "illegal data" being published in the chain.

Re: #2, the Bitcoin technical community would be smart to find ways to *defeat* ZKP schemes, with the goal of making it technologically infeasible to use them for recently created blocks (eg the last few days worth).

Erik Aronesty in reply to Robin Linus permalink original

"The sender could store redundant copies of the encrypted transaction data with multiple trust- minimized middlemen, for the recipient to download when they come back online."

sounds like a nostr event sent to a half dozen relays

On Fri, May 12, 2023, 9:15 AM Robin Linus via bitcoin-dev < bitcoin-dev@lists•linuxfoundation•org> wrote:

Quoted text (44 lines)
> Hi all,
>
> Today we are publishing a summary of our research on "ZeroSync:
> Introducing Validity Proofs to Bitcoin".
>
>
> Here's the preface:
>
> *We introduce ZeroSync, the first-ever proof system addressing Bitcoin’s
> scalability challenges with Succinct Non-Interactive Argument of Knowledge
> (SNARKs). ZeroSync compresses the entire Bitcoin blockchain into a compact
> proof of validity, enabling instant verification and unlocking various
> innovative applications. We discuss our prototype implementation of a chain
> state proof, utilizing the Cairo language, Utreexo, and recursive STARKs.
> Our work enables diverse applications, including quick bootstrapping of
> full nodes, trustless light clients, enhanced Lightning Network privacy,
> and secure cross-chain bridges. Chain state proofs require no consensus
> changes, which is crucial as forks in Bitcoin are challenging to implement
> and achieve consensus for. Despite the existing bottleneck of prover
> performance, we present a range of optimization strategies and demonstrate
> the practicality of generating a complete chain state proof. *
> *Finally, we introduce zkCoins, a client-side validation protocol combined
> with zeroknowledge SNARKs, drastically improving privacy and throughput of
> token transactions. In combination with future Bitcoin features, such as
> Simplicity, zkCoins also enables private and more scalable BTC
> transactions. *
> *The groundbreaking compression capabilities of SNARKs initiated a
> paradigm shift in cryptocurrency design, and ZeroSync is pioneering their
> application to Bitcoin.*
>
>
> You can find the full paper here: https://zerosync.org/zerosync.pdf
> Happy to receive any comments and answer any questions the bitcoin dev
> community may have about the paper!
>
>
>
> Best regards,
> Robin Linus
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation•org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
blk0 in reply to Robin Linus permalink original

Peter Todd wrote:

Quoted text (7 lines)
>Two serious issues with this proposal:

>1) You're creating an alternative implementation of the Bitcoin protocol. There
>is a _long_ history of such implementations failing to implement an exact copy
>of the consensus rules, leading to potential forks. Obviously, if only used by
>otherwise lite clients, there is less of a risk associated with this. But the
>risk is there and will expand as this tech is used for more sophisticated
>things.

There is a general purpose zkVM implementation for the RISC-V instruction set:

https://www.risczero.com/

Since Bitcoin Core can be compiled for RISC-V, and RiscZero can prove execution traces of a RISC-V VM, this argument no longer applies: the exact consensus rules would be applied and verified.

@blk014