Architecture API REST ⚠️This API and documentation is still under active development.
List Registered Provers
The Provide Privacy API can be thought of more generally as a prover registry that enables best practices with regard to interacting with zero-knowledge provers. The API exposes a way to query provers in the registry.
The scope of the response is based on the authorized subject
of the given bearer authorization
request header.
curl
Copy curl -v \
-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' \
https://privacy.provide.services/api/v1/provers
> GET /api/v1/provers HTTP/1.1
> Host: privacy.provide.services
> User-Agent: curl/7.64.1
> Accept: * / *
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5NTgxNDUwLCJpYXQiOjE2MDk0OTUwNTAsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjFkNWYwY2M0LTgwN2QtNDlkNi05YWI3LWE4MTRkNjhlMTViZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmli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access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: X-Total-Results-Count
< Content-Type: application/json; charset = UTF-8
< X-Total-Results-Count: 1
< Date: Fri, 01 Jan 2021 10:08:03 GMT
< Content-Length: 470
<
[
{
"id" : "55bb4a37-c5e0-491c-9d4e-f27453b24215" ,
"created_at" : "2021-01-01T09:58:02.649155Z" ,
"vault_id" : "b25f7104-00f9-4650-937e-a77d9d32de66" ,
"proving_key_id" : null,
"verifying_key_id" : null,
"name" : "my 1337 prover" ,
"description" : null,
"identifier" : "cubic" ,
"provider" : "gnark" ,
"proving_scheme" : "groth16" ,
"curve" : "BN254" ,
"status" : "pending_setup"
}
]
Query Parameters
The following query parameters can be used to filter the response:
filter the response by elliptic curve
filter the response by prover identifier
filter the response by interface provider
filter the response by proving scheme
filter the response by provisioning status
Create Prover
You must provision a prover before it can be used to generate and verify proofs. The foregoing holds true regardless of which provider
, proving_scheme
, curve
and prover identifier
you specify (or source
, if the raw source code of the prover 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 prover 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 prover unless an existing store_id
is provided and the referenced store is valid in the context of the prover and authorized scope.
Provisioning
This API will evolve as additional providers and proving schemes are supported. Creating a prover entails compiling the prover from source, performing the appropriate setup or multiparty key ceremony and securely persist resulting artifacts.
The parameters required to provision a Prover
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
pairing-friendly elliptic curve, i.e., BN254
proving scheme to be used; i.e., groth16
prover provider, i.e., gnark
identifier of the persistent store instance for the encrypted notes tree
identifier of the persistent store instance for the nullifiers tree
The following API call illustrates how to compile and setup a new groth16
zkSNARK provert using gnark
.
curl
Copy curl -v -XPOST \
-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' \
-H 'content-type: application/json' \
https://privacy.provide.services/api/v1/provers --data-binary @- << EOF
{
"identifier": "cubic",
"proving_scheme": "groth16",
"curve": "BN254",
"provider": "gnark",
"name": "my 1337 prover"
}
EOF
> POST /api/v1/provers HTTP/1.1
> Host: privacy.provide.services
> User-Agent: curl/7.64.1
> Accept: * / *
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5NDEwNjQ2LCJpYXQiOjE2MDkzMjQyNDYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6ImU2NDg5M2I1LTYxMGItNGU3OC1hYjlmLTIzMjllZDBlMmJiNyIsIm5hdHMiOnsicGVybWlzc2lvb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3R0nDZdlNz1Xm-ExLyGTwdqrJBb9lf1UbdRC-wtpMlOk
> content-type: application/json
> Content-Length: 131
< HTTP/1.1 202 Accepted
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: X-Total-Results-Count
< Content-Type: application/json; charset = UTF-8
< Date: Wed, 30 Dec 2020 22:23:45 GMT
< Content-Length: 425
<
{
"id" : "36717299-cb2e-4b56-a3f5-d39aebc61e13" ,
"created_at" : "2020-12-30T22:23:45.453904041Z" ,
"vault_id" : "8db03454-6bd8-41b8-8cb8-1e742a0b3a12" ,
"proving_key_id" : null,
"verifying_key_id" : null,
"name" : "my 1337 prover" ,
"description" : null,
"identifier" : "cubic" ,
"provider" : "gnark" ,
"proving_scheme" : "groth16" ,
"curve" : "BN254" ,
"status" : "compiled"
}
Lifecycle
default status
value for all newly-initialized provers
prover is currently being compiled
prover has been successfully compiled
trusted setup will begin asynchronously
trusted setup is running asynchronously
on-chain shield/verifier contract artifacts are being deployed
¹ 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 prover, 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 prover.
Request Parameters
prover-specific public and private inputs
The following API call illustrates how to generate a proof using a provisioned Prover:
curl
Copy curl -v -XPOST \
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhw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gqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
-H 'content-type: application/json' \
https://privacy.provide.services/api/v1/provers/3514bc72-cd2c-4d65-893b-24546162f2e9/prove --data-binary @- << EOF
{
"witness:": {
"X": "3",
"Y": "35"
}
}
EOF
> POST /api/v1/provers/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
> Host: privacy.provide.services
> User-Agent: curl/7.64.1
> Accept: * / *
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
> content-type: application/json
> Content-Length: 51
< HTTP/1.1 201 Unprocessable Entity
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: X-Total-Results-Count
< Content-Type: application/json; charset = UTF-8
< Date: Mon, 04 Jan 2021 11:09:41 GMT
< Content-Length: 276
<
{
"proof" : "e68905f07f5837bca745788d3b39df96887e87ed731a968f541da07a461b793b8a5fc8d93055c7d1a6b5017b63ecec6f630108211a59dda1375cabbf4bd831690917d68d0208cbfc0b771af7adbe87e852a5742603f80869d104cd39251c055b98151d7bb1700775e4b3491fef3f810eac2f0fbd1d028473c5b6f4b6519329e7"
}
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 prover arguments (i.e., fields) are not included within the given witness
parameter or (iii) when Prover constraints are not satisfied.
Here is example API call that results in an error message related to unsatisfied constraints:
curl
Copy curl -v -XPOST \
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
-H 'content-type: application/json' \
https://privacy.provide.services/api/v1/provers/3514bc72-cd2c-4d65-893b-24546162f2e9/prove --data-binary @- << EOF
{
"witness:": {
"X": "3",
"Y": "37"
}
}
EOF
> POST /api/v1/provers/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
> Host: privacy.provide.services
> User-Agent: curl/7.64.1
> Accept: */*
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0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sjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
> content-type: application/json
> Content-Length: 51
< HTTP/1.1 422 Unprocessable Entity
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: X-Total-Results-Count
< Content-Type: application/json; charset=UTF-8
< Date: Mon, 04 Jan 2021 11:09:41 GMT
< Content-Length: 93
<
{
"errors": [
{
"message": "constraint is not satisfied: [(37 * 1) != (1 * 5) + (3 * 1) + (27 * 1)]"
}
],
"proof": null
}
Verify
Verify a proof
using the given witness
parameters.
Request Parameters
the hex-formatted proof to verify
public and private inputs used to generate the proof
when true
, the proof is written to the configured note store
The following API call illustrates how to verify a proof using a provisioned Prover:
curl
Copy curl -v -XPOST \
-H 'authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdml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Wt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8' \
-H 'content-type: application/json' \
https://privacy.provide.services/api/v1/provers/3514bc72-cd2c-4d65-893b-24546162f2e9/verify --data-binary @- << EOF
{
"witness:": {
"X": "3",
"Y": "35"
},
"proof": "88b8d340795f4258c1f2c0ed8478b44859c90472af9ccdc5c54b02c85bcd879d9ddf3a3fb7c6926ea247c0b1c411abe2f5ba9c8deba60ab476428272767a761d1e14e343208024326429e361ebbc4c11daf5f16dbb7f7f4679cf85b17b59b1bdaa379a82ddab4dcbb7cd2bc32cdebadc6825c72d5f8e624f6d0f6b07906a8248"
}
EOF
> POST /api/v1/provers/36717299-cb2e-4b56-a3f5-d39aebc61e13/prove HTTP/1.1
> Host: privacy.provide.services
> User-Agent: curl/7.64.1
> Accept: */*
> authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNjA5ODM3NzY2LCJpYXQiOjE2MDk3NTEzNjYsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6Ijc4MjIyYjZhLWUzMjYtNDQwNC1iNWFmLTMwMzI0OGE1MjJhZiIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsicHVibGlzaCI6eyJhbGxvdyI6WyJiYXNlbGluZS5cdTAwM2UiXX0sInN1YnNjcmliZSI6eyJhbGxvdyI6WyJ1c2VyLjFmMmQ5ODM3LTNjYzAtNDY5YS1hNWJhLTAzMTMyODY2YzkxNyIsIm5ldHdvcmsuKi5jb25uZWN0b3IuKiIsIm5ldHdvcmsuKi5zdGF0dXMiLCJwbGF0Zm9ybS5cdTAwM2UiLCJiYXNlbGluZS5cdTAwM2UiXX19fSwicHJ2ZCI6eyJwZXJtaXNzaW9ucyI6NDE1LCJ1c2VyX2lkIjoiMWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0sInN1YiI6InVzZXI6MWYyZDk4MzctM2NjMC00NjlhLWE1YmEtMDMxMzI4NjZjOTE3In0.DfefiKTw2YqGXfSOJ6ww3grDG2yh8DQpepiFWOj0F3cnjOCX93rehthsO_-nU5hTeY_NndlaBMn5BkjTmdl089vF88EaaIDFjy8O_unYc0GeDx02yBwVQvZ_ZWWQEyRmg4qawSYEPcaGftwFldyirJ9v9sv4V0zbYoM3g4E9lt7Jh0zRgB1DbvYVoOwkIGTpi2Vvd7wg1esny24rTY6AwmnGa3RlbMT2LfTy0t6w3iYWXLe4GwPuxgsF9r_8EsTEmX0TwPohC6dIKVrk9pL6lQOf7vBlgWqLMiI_Yfdeef8aK1PTOB35y5axzZSCaVHW0bF_r4Hue7H127b3fuLTnHa88g3avTYsW9vM1tPfRsjFLgblY8fqNTHexw0vF6x1aky1S71_D0MrDYOjSQ59g1yj-L2VDnd7aZ2mmhKh0AhzvvgHNnQSPcGJUGUsSo3-ZXUN_xTtXgqPXDalOYAo4dzZs3iLxVsOC9OEySqLpYR6IvA5-was386iB7v6C3CZK2ArNSwtTvSSg_1qT_99xg4CRWt3Eqdb_Rp2TuMIdbbeAjKJKiPJw1JN4VravJyRVS5NrgKbhPjgn3Wo7rMuc26darj8AuPETi-3poC6KfoBUpEEnX4imYc1OpwCnvbuKTg-X6bEu5sK4FaVgWQqRkAXtsuCXnF5bOzzcMjU9J8
> content-type: application/json
> Content-Length: 322
< HTTP/1.1 200 OK
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Cache-Control, Content-Length, Content-Type, Origin, User-Agent, X-CSRF-Token, X-Requested-With
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: X-Total-Results-Count
< Content-Type: application/json; charset=UTF-8
< Date: Thu, 07 Jan 2021 02:00:08 GMT
< Content-Length: 23
<
{
"result": true
}