Bitcoin+STARK: ZeroSync & Khepri

1. 引言

当前,以下项目借助STARK,为Bitcoin引入类似Mina的功能:

  • https://github.com/lucidLuckylee/zerosync:Pure Cairo based(Cairo+Python)
  • https://github.com/bitcoin-stark/khepri:StarkNet contract based(Cairo+Python)

2. ZeroSync

ZeroSync定位为:
不再需要下载数百GB的区块,借助STARK proof,即可验证整个历史交易以及每个人的当前balance。

ZeroSync项目启动历程为:

  • 2022年2月,Lukas George启动STARK relay作为其TU Berlin的本科论文,在STARK relay中,其证明了the headers chain of Bitcoin。
  • Geometry Research为项目开发提供了grant资助。
  • 2022年7月,Robin Linus加入项目,并将项目规划为full chain proof。
  • Ruben Somsen将项目重命名为ZeroSync。

ZeroSync致力于成为custom Bitcoin proofs的工具盒。借助STARK proof,可:

  • transform the blockchain data
  • enhance the blockchain data
  • filter the blockchain data
  • index the blockchain data for efficient queries
  • optimise the blockchain data for individual use case

ZeroSync的长期愿景为:“zerosync and scan the chain efficiently”,即:

  • 1)Merkelized headers chain:对链上任意交易压缩并提供灵活的inclusion proofs;
  • 2)Block filters:为zk-clients提供block filters,以检查某区块是否与其相关;
  • 3)Compact blocks:为zk-clients提供区块压缩,可仅下载与其相关的部分区块,而不是所有区块。

ZeroSync未来也希望可实现:

  • 1)Compact ring signatures:如,证明you control outputs worth at least 1BTC without revealing which ones。
  • 2)Instant history verification for client-side validation protocols like Omni, RGB, or Taro,但是:
    • 借助transaction graph obfuscation,具有更好的隐私。每笔交易可为a coin teleport proven in zk。
  • 3)强化Lightning Network中的routing隐私?

Zero Sync当前仍处于早期阶段,ZeroSync路线图为:

  • 1)阶段1——“assumvalid”:即模仿“assumevalid” option of Bitcoin Core实现chain proof,主要工作为:

    • 解析区块、区块头和交易
    • 验证链上各种哈希(如区块哈希、前一区块哈希、Merkle root、TxID等)
    • 验证the chain’s work(proof-of-work 以及 难度重新校准)
    • 验证UTXO set(Utreexo accumulator 以及 提供inclusion proof的“bridge node”)
    • 以recursive STARKs实现的chain of proof:即在当前chain proof中验证previous chain proof。
  • 2)阶段2——“measure and optimise”:测量并优化assumevalid proof的性能,使得其可支撑未来扩展到Bitcoin Scripts validation证明,基本流程为:

    • 对full of transactions区块的assumevalid proof进行benchmark
    • 识别性能瓶颈并看是否存在showstoppers
    • 优化瓶颈,直到可满足添加Script validation性能要求
  • 3)阶段3——“Bitcoin Script”:实现witness verification,并完成full chain proof:

    • Bitcoin Script:
      • Compute signature hashes(ALL/NONE/SINGLE/ANYONECANPAY,…)
      • Script interpreter(实现所有opcodes)
    • Payment类型有:
      • Legacy:p2pk/p2pkh/p2sh
      • SegWit:p2wpkh/p2wsh
      • Taproot:p2tr,以及key path & script path spend
    • Crypto:
      • ECDSA,Schnorr
      • SH256/HASH256/SHA1/RIPEMD160/HASH160
    • Chain verifier:
      • 软件:用于下载和证明a chainstate directory for a Bitcoin Core full node
      • 网站:在一个简单的网站中展示chainstate proof demo。

    完成以上3个阶段之后,可同步a pruned full node by downloading only the current UTXO set。
    运行一个ZeroSync全节点无需修改Bitcoin Core的代码,仅需要在验证通过之后,将UTXO set拷贝到Core的chainstate路径下即可。

  • 4)阶段4——Hardening:代码在生产可用之前,需对其进行测试、review、固化:

    • 收集社区反馈
    • 进行代码review
    • 更多的testing,并添加fuzzing
    • Bug Bounty program

3. Khepri

Khepri定位为:

  • STARK-proven Stateful Bitcoin client enabling hyper fast trustless sync and checkpoints。

Khepri当前仍处于PoC阶段,用于展示在不改变Bitcoin协议的情况下如何使用STARK proof。

Kehpri的核心思想为:

  • 借助STARK proof system来解决Bitcoin生态中的某些issue,或至少强化用户体验。

借助STARK proof和Cairo,可验证the integrity of a computation without having to naively redo all computation。因此,Verifier可确信the honest execution of a program,而不需要执行该程序来检查结果。

验证proof 比 直接执行该程序 的速度要快指数级的,从而提供了可扩容性。
此外,生成proof的开销,相对于 正常执行程序而不生成proof 的开销,是可忽略的。

这种机制为多个用户场景提供了很多潜在优化可能,如:

  • hyper fast & trustless synchronization (IBD)
  • enhanced Simplified Payment Verification
  • protection against DoS on the P2P layer

Kehpri总体架构为:
Bitcoin+STARK: ZeroSync & Khepri_第1张图片

附录

  • Omni:为构建与Bitcoin之上的去中心化资产平台,用于创建和交易自定义数字资产及货币。
  • RGB:为基于Bitcoin和闪电网络之上构建的复杂智能合约协议。为Bitcoin生态的Layer2和Layer3,为client-side validated state and smart contracts system。RGB:
    • 不是token协议;
    • 与闪电网络配合使用;
    • 由于是client-validated特性,无链上使用和可跟踪痕迹;
    • 独立于Bitcoin timechain扩容;
    • 基于最好的研究产品可提供零知识性和隐私性:
      • Mimblewhimble:Bulletproofs by Andrew Poelstra
      • Liquid:Confidential Assets by Blockstream
  • Taro:为Bitcoin闪电网络实验室(Lightning Labs) 的项目,Taro协议利用2021年11月在比特币上推出的Taproot升级基础上,向比特币和闪电网络的用户引入稳定币、NFT和其他资产的方案。Taro将允许比特币以外的资产在比特币主区块链上发行,并能通过第二层闪电网络(LN)转移和使用这些资产
    Taproot升级:
    • 使用Schnorr签名代替ECDSA签名,可将多笔交易打包形成聚合签名,打包后的交易 与 普通交易没有区别,具有更好的安全性和隐匿性;
    • 利用MSAT(Merklized Abstract Syntax Tree)结构——来自于抽象语法树(Abstract Syntax Tree)和默克尔树(Merkle Tree)的结合。MAST允许在散列所有内容之前对交易或智能合约的每个属性进行分割。当比特币交易发生时,只需要提供其分支运算并将分支哈希连接到固定大小的默克尔根上,从而减少交易数据,提升区块空间。而且MAST可以根据交易不同设置不同的条件,也就是实现智能合约功能。

参考资料

[1] twitter some efforts to make Bitcoin work similarly to Mina
[2] 比特币Taproot升级顺利完成,对比特币有哪些长期影响?
[3] Taro——Taproot-powered protocol
[4] Bitcoin RGB协议

你可能感兴趣的:(比特币,比特币)