Skip to content

Commit

Permalink
docs: complete readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefbiiko committed Mar 2, 2024
1 parent d19aa26 commit 8320bf8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 8320bf8

Please sign in to comment.