0.1.0 • Published 7 months ago

zerosync_verifier v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

zerosync__verifier

Zerosync verifier allows to verify ZeroSync‘s latest header chain STARK proofs in your node project. The proof validates the Bitcoin consensus for the header chain and provides the latest header chain state. To Instantly verify Bitcoin's header chain in your browser,check out our demo here

Installation

NPM

npm i zerosync_header_chain_verifier

OR

YARN

yarn add zerosync_header_chain_verifier

Quick Start

Here's a simple example to get you started:

import pkg from "zerosync_verifier";
const { verify } = pkg;
import fetch from "node-fetch";

async function main() {

    // The public input and proof are extracted from the latest data
  const publicInputUrl = "https://zerosync.org/demo/proofs/latest/air-public-input.json";
  const proofUrl =  "https://zerosync.org/demo/proofs/latest/aggregated_proof.bin";

  const publicInputResponse = await fetch(publicInputUrl);
  const publicInputBytes = new Uint8Array(
    await publicInputResponse.arrayBuffer()
  );

  const proofResponse = await fetch(proofUrl);
  const proofBytes = new Uint8Array(await proofResponse.arrayBuffer());

  //  Verifies the proof  and returns the result
  const result = verify(publicInputBytes, proofBytes);
  console.log(result);

}
main();

Dependencies

The verifier package leverages in the following dependencies

  • Ministark: GPU accelerated STARK prover and verifier
  • Sandstorm: Cairo prover powered by miniSTARK
0.1.0

7 months ago