Skip to content

Commit 8597a1e

Browse files
committed
closing #402 in the old docs repo, references #3081
1 parent 76d3b53 commit 8597a1e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

docs/docs/noir_js/noir_js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ Your only concern should be to write Noir. Noir.js will work out-of-the box and
1717

1818
## Barretenberg
1919

20-
Since Noir is backend agnostic, you can instantiate `noir_js` with supported backends through their own `js` interface.
20+
Since Noir is backend agnostic, you can instantiate `noir_js` without any backend (i.e. to execute a function). But for proving, you should instantiate it with any of the supported backends through their own `js` interface.
2121

2222
Aztec Labs maintains the `barretenberg` backend. You can use it to instantiate your `Noir` class.

docs/docs/noir_js/reference/02_noirjs.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,35 @@ This method takes no parameters
5454
await noirInstance.init();
5555
```
5656

57+
## `execute`
58+
59+
This async method allows to execute a circuit to get its witness and return value. [`generateFinalProof`](#generatefinalproof) calls it for you, but you can call it directly (i.e. to feed directly to a backend, or to get the return value).
60+
61+
### Syntax
62+
63+
```js
64+
async execute(inputs)
65+
```
66+
67+
### Parameters
68+
69+
| Parameter | Type | Description |
70+
| --------- | ------ | ------------------------------------------------ |
71+
| `inputs` | Object | An object containing the inputs to your circuit. |
72+
73+
### Returns
74+
75+
| Return value | Type | Description |
76+
| ------------ | --------------------- | --------------------------------------------------- |
77+
| `witness` | Promise <Uint8Array\> | The witness |
78+
| `returnValue` | Promise <InputMap\> | The return value |
79+
80+
### Usage
81+
82+
```js
83+
const { witness, returnValue } = await noir.execute(inputs)
84+
```
85+
5786
## `generateFinalProof`
5887

5988
This async method generates a witness and a proof given an object as input.

0 commit comments

Comments
 (0)