Search…
REST
⚠️This API and documentation is still under active development.

List Registered Circuits

The Provide Privacy API can be thought of more generally as a circuit registry that enables best practices with regard to interacting with zero-knowledge circuits. The API exposes a way to query circuits in the registry.
The scope of the response is based on the authorized subject of the given bearer authorization request header.
curl
1
curl -v \
2
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5NTgxNDUwLCJpYXQiOjE2MDk0OTUwNTAsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjFkNWYwY2M0LTgwN2QtNDlkNi05YWI3LWE4MTRkNjhlMTViZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.kwiOivtE4fHPk6oZfYHa4dXEaEl6LRtvLmcHkOgHq2mpYVr8T44_Q9YuF_VeGYyAa6Ec9qAIDCdM87web10K3SX8dc2u-Jb3zC_ZM5_S7AFPu10lIvMhyfax1MbfMeP5TQQD_NhCJJvSJf6EbcMf2VbuvDGBsJIY_V9ofv3Ier_X57mgzhLMtWf1_V0-0Oe1iC_RFe6VQVGuBRE75-1RTR-t7EIcXGlZBcz6TizDkKKux1j1qE8U5d5zG_ZNlgKt_Z2Qrcy4Hmwn2GGpd8tW5sAOkByFD1lfkDcxvUXlJQysRLEvL1nRxhjutGXqhZOyTMvDZpIJjZ7wZXak3jr2D7dn4z6VWkCMGrpaxxLLZinil9y0tMIruGgbZ6cAjiXWUMPtIUZcZL_rGmIRe8XdEZ6p6gRle6O2wovUPkourPsPF2BTQhP8Bq3HByk9hEj_6QhPk8ac24Mw4i-U8Kgvg_gaHy902tereUYY77y2qpesepcx8Pg5hADz-cX0_nqxa0juG8QA63MyzGQioXq-pRQLbl4DkvVNBjA7Fh22NtO0Fn0THf7RLilJ8U-_forJ_khENGysDgOkGXmDojrVSLvIEV2A3dc4KgS67-Zzxh53v8CRfTzqvXPdET973lIxdm5aDXdws_TyEarpbxMQ7RMrLEAQ6Q8Hbaqj7axGIzc' \
3
https://privacy.provide.services/api/v1/circuits
4
5
> GET /api/v1/circuits HTTP/1.1
6
> Host: privacy.provide.services
7
> User-Agent: curl/7.64.1
8
> Accept: */*
9
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5NTgxNDUwLCJpYXQiOjE2MDk0OTUwNTAsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjFkNWYwY2M0LTgwN2QtNDlkNi05YWI3LWE4MTRkNjhlMTViZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM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>
11
12
< HTTP/1.1 200 OK
13
< Access-Control-Allow-Credentials: true
14
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
15
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
16
< Access-Control-Allow-Origin: *
17
< Access-Control-Expose-Headers: X-Total-Results-Count
18
< Content-Type: application/json; charset=UTF-8
19
< X-Total-Results-Count: 1
20
< Date: Fri, 01 Jan 2021 10:08:03 GMT
21
< Content-Length: 470
22
<
23
[
24
{
25
"id": "55bb4a37-c5e0-491c-9d4e-f27453b24215",
26
"created_at": "2021-01-01T09:58:02.649155Z",
27
"vault_id": "b25f7104-00f9-4650-937e-a77d9d32de66",
28
"proving_key_id": null,
29
"verifying_key_id": null,
30
"name": "my 1337 circuit",
31
"description": null,
32
"identifier": "cubic",
33
"provider": "gnark",
34
"proving_scheme": "groth16",
35
"curve": "BN256",
36
"status": "pending_setup"
37
}
38
]
Copied!

Query Parameters

The following query parameters can be used to filter the response:
Parameter
Description
Example
curve
filter the response by elliptic curve
curve=bn256
identifier
filter the response by circuit identifier
identifier=cubic
provider
filter the response by interface provider
provider=gnark
proving_scheme
filter the response by proving scheme
proving_scheme=groth16
status
filter the response by provisioning status
status=provisioned

Create Circuit

You must provision a circuit before it can be used to generate and verify proofs. The foregoing holds true regardless of which provider, proving_scheme, curve and circuit identifier you specify (or source, if the raw source code of the circuit is provided instead of an identifier).
A powerful aspect of the Provide Privacy API is the asynchronous nature by which computationally-intensive cryptographic operations are executed. The lifecycle of a zero-knowledge circuit depends largely on the chosen proving_scheme. For example, zkSNARK proving schemes (i.e., groth16) require a trusted setup whereas more modern schemes (i.e., plonk) do not.
A persistent store is implicitly initialized upon the creation of a new circuit unless an existing store_id is provided and the referenced store is valid in the context of the circuit and authorized scope.

Provisioning

This API will evolve as additional providers and proving schemes are supported. Creating a circuit entails compiling the circuit from source, performing the appropriate setup or multiparty key ceremony and securely persist resulting artifacts.
The parameters required to provision a Circuit vary slightly across providers and proving schemes. Ensure you are using the source or identifier parameter properly for the selected provider and proving_scheme.

Request Parameters

Parameter
Description
Required
curve
pairing-friendly elliptic curve, i.e., BN256
yes
identifier
circuit identifier
yes
name
name of the circuit
yes
proving_scheme
proving scheme to be used; i.e., groth16
yes
provider
circuit provider, i.e., gnark
yes
note_store_id
identifier of the persistent store instance for the encrypted notes tree
no
nullifier_store_id
identifier of the persistent store instance for the nullifiers tree
no
The following API call illustrates how to compile and setup a new groth16 zkSNARK circuit using gnark.
curl
1
curl -v -XPOST \
2
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5NDEwNjQ2LCJpYXQiOjE2MDkzMjQyNDYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6ImU2NDg5M2I1LTYxMGItNGU3OC1hYjlmLTIzMjllZDBlMmJiNyIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjE5NzMwZmJmLWQxNzgtNGEyZC1iMTM5LTBkZmIxYzRkYTY2OSIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMTk3MzBmYmYtZDE3OC00YTJkLWIxMzktMGRmYjFjNGRhNjY5In0sInN1YiI6InVzZXI6MTk3MzBmYmYtZDE3OC00YTJkLWIxMzktMGRmYjFjNGRhNjY5In0.dJVRiWhovrkFvFZ-n4g6hybhEg-raf-dvYOD2eQ8ajI-mUC8kxtZb56ibS-03rh5r5glrFXRCpWbJ74Eu0jFlKH5BPwzDve9WnDQn8Lr_NiaxwRGa3jYSnXMJbn6zGhzqhmiDr7f-7WlELp5e2bKkhIsGReyetgj-UIu8sl3hB6hT5ARh39BMY6fjNDyAlvvTGpMXz_Rr0T5b1JzAJaOOyYqeTqmYmOvxOFKj5RCk7KjOSpxLS23tiY_73NpkdbvtVOzPcvenWpxD0d00OWTbmVL-7Cwpa_NqDGwETi8kiiYPMyK3qgfCEKe1iQrBqUzIij2s68XUAVhaCikPpFpeR_PZnKZB9-9zN53VlFoDZyxx7WkKFzGy1Mj5eWXAcE81MlT6hXHM06ZyMj_yv8-8mZ41nfUPbyU9PdUlQsoFNz1rz_mCsUy6DeqIg5TS5I39Rpd8_E8VdsYb4BNILTlWQa-PbtKBDUN9wqq-tqigahG9JK2J2w7fTNQfqIAd1plrlQYzDKt178Mqd8lkF0G-uicartUHRxetUXlX-6YpiNphHPyrwuz38uggGBqPLbq4OlejWK2-oDYJMGcTpTVJk9qEk6JAbm148_i04OEfNtFbS9PRkj1_H5DyaaGWW_3R0nDZdlNz1Xm-ExLyGTwdqrJBb9lf1UbdRC-wtpMlOk' \
3
-H 'content-type: application/json' \
4
https://privacy.provide.services/api/v1/circuits --data-binary @- << EOF
5
{
6
"identifier": "cubic",
7
"proving_scheme": "groth16",
8
"curve": "BN256",
9
"provider": "gnark",
10
"name": "my 1337 circuit"
11
}
12
EOF
13
14
> POST /api/v1/circuits HTTP/1.1
15
> Host: privacy.provide.services
16
> User-Agent: curl/7.64.1
17
> Accept: */*
18
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSld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XHM06ZyMj_yv8-8mZ41nfUPbyU9PdUlQsoFNz1rz_mCsUy6DeqIg5TS5I39Rpd8_E8VdsYb4BNILTlWQa-PbtKBDUN9wqq-tqigahG9JK2J2w7fTNQfqIAd1plrlQYzDKt178Mqd8lkF0G-uicartUHRxetUXlX-6YpiNphHPyrwuz38uggGBqPLbq4OlejWK2-oDYJMGcTpTVJk9qEk6JAbm148_i04OEfNtFbS9PRkj1_H5DyaaGWW_3R0nDZdlNz1Xm-ExLyGTwdqrJBb9lf1UbdRC-wtpMlOk
19
> content-type: application/json
20
> Content-Length: 131
21
22
< HTTP/1.1 202 Accepted
23
< Access-Control-Allow-Credentials: true
24
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
25
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
26
< Access-Control-Allow-Origin: *
27
< Access-Control-Expose-Headers: X-Total-Results-Count
28
< Content-Type: application/json; charset=UTF-8
29
< Date: Wed, 30 Dec 2020 22:23:45 GMT
30
< Content-Length: 425
31
<
32
{
33
"id": "36717299-cb2e-4b56-a3f5-d39aebc61e13",
34
"created_at": "2020-12-30T22:23:45.453904041Z",
35
"vault_id": "8db03454-6bd8-41b8-8cb8-1e742a0b3a12",
36
"proving_key_id": null,
37
"verifying_key_id": null,
38
"name": "my 1337 circuit",
39
"description": null,
40
"identifier": "cubic",
41
"provider": "gnark",
42
"proving_scheme": "groth16",
43
"curve": "BN256",
44
"status": "compiled"
45
}
Copied!

Lifecycle

Status
Description
init
default status value for all newly-initialized circuits
compiling
circuit is currently being compiled
compiled
circuit has been successfully compiled
pending_setup¹
trusted setup will begin asynchronously
running_setup¹
trusted setup is running asynchronously
deploying_artifacts²
on-chain shield/verifier contract artifacts are being deployed
provisioned
circuit is ready for use
¹ Trusted setup only applies to certain proving schemes. Setups are managed asynchronously by the Backplane component. ² On-chain artifacts are deployed if supported by the selected provider and proving_scheme.

Prove

Once you have provisioned a circuit, this API can be used to generate a proof given valid witness parameters. Calling this API has an implicit side-effect of writing the hash of generated proof to the persistent store associated with the circuit.

Request Parameters

Parameter
Description
Required
witness
circuit-specific public and private inputs
yes
The following API call illustrates how to generate a proof using a provisioned Circuit:
curl
1
curl -v -XPOST \
2
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
3
-H 'content-type: application/json' \
4
https://privacy.provide.services/api/v1/circuits/3514bc72-cd2c-4d65-893b-24546162f2e9/prove --data-binary @- << EOF
5
{
6
"witness:": {
7
"X": "3",
8
"Y": "35"
9
}
10
}
11
EOF
12
13
> POST /api/v1/circuits/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
14
> Host: privacy.provide.services
15
> User-Agent: curl/7.64.1
16
> Accept: */*
17
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucH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xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
18
> content-type: application/json
19
> Content-Length: 51
20
21
< HTTP/1.1 201 Unprocessable Entity
22
< Access-Control-Allow-Credentials: true
23
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
24
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
25
< Access-Control-Allow-Origin: *
26
< Access-Control-Expose-Headers: X-Total-Results-Count
27
< Content-Type: application/json; charset=UTF-8
28
< Date: Mon, 04 Jan 2021 11:09:41 GMT
29
< Content-Length: 276
30
<
31
{
32
"proof": "e68905f07f5837bca745788d3b39df96887e87ed731a968f541da07a461b793b8a5fc8d93055c7d1a6b5017b63ecec6f630108211a59dda1375cabbf4bd831690917d68d0208cbfc0b771af7adbe87e852a5742603f80869d104cd39251c055b98151d7bb1700775e4b3491fef3f810eac2f0fbd1d028473c5b6f4b6519329e7"
33
}
Copied!

Error Handling

The API returns a 422 status code and human-readable error message(s) if (i) the witness parameters is not provided, (ii) required circuit arguments (i.e., fields) are not included within the given witness parameter or (iii) when Circuit constraints are not satisfied.
Here is example API call that results in an error message related to unsatisfied constraints:
1
curl -v -XPOST \
2
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2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rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
3
-H 'content-type: application/json' \
4
https://privacy.provide.services/api/v1/circuits/3514bc72-cd2c-4d65-893b-24546162f2e9/prove --data-binary @- << EOF
5
{
6
"witness:": {
7
"X": "3",
8
"Y": "37"
9
}
10
}
11
EOF
12
13
> POST /api/v1/circuits/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
14
> Host: privacy.provide.services
15
> User-Agent: curl/7.64.1
16
> Accept: */*
17
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
18
> content-type: application/json
19
> Content-Length: 51
20
21
< HTTP/1.1 422 Unprocessable Entity
22
< Access-Control-Allow-Credentials: true
23
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
24
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
25
< Access-Control-Allow-Origin: *
26
< Access-Control-Expose-Headers: X-Total-Results-Count
27
< Content-Type: application/json; charset=UTF-8
28
< Date: Mon, 04 Jan 2021 11:09:41 GMT
29
< Content-Length: 93
30
<
31
{
32
"errors": [
33
{
34
"message": "constraint is not satisfied: [(37 * 1) != (1 * 5) + (3 * 1) + (27 * 1)]"
35
}
36
],
37
"proof": null
38
}
Copied!

Verify

Verify a proof using the given witness parameters.

Request Parameters

Parameter
Description
Required
proof
the hex-formatted proof to verify
yes
witness
public and private inputs used to generate the proof
yes
store
when true, the proof is written to the configured note store
no
The following API call illustrates how to verify a proof using a provisioned Circuit:
1
curl -v -XPOST \
2
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
3
-H 'content-type: application/json' \
4
https://privacy.provide.services/api/v1/circuits/3514bc72-cd2c-4d65-893b-24546162f2e9/verify --data-binary @- << EOF
5
{
6
"witness:": {
7
"X": "3",
8
"Y": "35"
9
},
10
"proof": "88b8d340795f4258c1f2c0ed8478b44859c90472af9ccdc5c54b02c85bcd879d9ddf3a3fb7c6926ea247c0b1c411abe2f5ba9c8deba60ab476428272767a761d1e14e343208024326429e361ebbc4c11daf5f16dbb7f7f4679cf85b17b59b1bdaa379a82ddab4dcbb7cd2bc32cdebadc6825c72d5f8e624f6d0f6b07906a8248"
11
}
12
EOF
13
14
> POST /api/v1/circuits/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
15
> Host: priv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XLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
19
> content-type: application/json
20
> Content-Length: 322
21
22
< HTTP/1.1 200 OK
23
< Access-Control-Allow-Credentials: true
24
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
25
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
26
< Access-Control-Allow-Origin: *
27
< Access-Control-Expose-Headers: X-Total-Results-Count
28
< Content-Type: application/json; charset=UTF-8
29
< Date: Thu, 07 Jan 2021 02:00:08 GMT
30
< Content-Length: 23
31
<
32
{
33
"result": true
34
}
Copied!
Last modified 2mo ago