From 8320bf80bf3d2ab9b8ab1b1e8cf622d173ec83b3 Mon Sep 17 00:00:00 2001 From: chiefbiiko <22937570+chiefbiiko@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:02:39 +0100 Subject: [PATCH] docs: complete readme --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 41c886e..feeb8d5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,11 @@ [![ci](https://github.com/chiefbiiko/gnark-witnejs/workflows/ci/badge.svg)](https://github.com/chiefbiiko/gnark-witnejs/actions/workflows/ci.yml) -[gnark](https://github.com/Consensys/gnark) witness serializer in js. +[gnark](https://github.com/Consensys/gnark) witness serializer in js + +``` +npm i gnark-witnejs +``` ## Usage @@ -11,13 +15,12 @@ import serialize from "gnark-witnejs" const inputs = { x: 3n, y: 35n, z: [ [ 0n, 99n ], 77n ] } const publics = { x: true } // indicates public inputs -const opts = {/* prime: BN254, publicOnly: false */} +const opts = {/* modulus: BN254_R, publicOnly: false */} const buf = serialize(inputs, publics, opts) ``` Make sure that: - ++ input fields appear in the same order as in the golang struct + the input object does not contain nested objects > nested arrays are supported though -+ input fields must appear in the same order as in the golang struct \ No newline at end of file