Conract Name | Address | Network |
---|---|---|
ScoreValut | 0x177acf501eF7d2b090d94fd3bd2BE773736598E1 | Scroll Sepolia |
Forwarder | 0x3140a4156db3a4077c41c2bcb22cc02ba407f0b5 | Scroll Sepolia |
Verifier | 0x819cb57caEee4d4D10Dd583ffAe5DF4094EBb069 | Scroll Sepolia |
No. | Address | Network |
---|---|---|
1 | 0x1B38AB190EDf2bb4BcB2EC0b6639426731861581 | Scroll Sepolia |
Circuit ID: 96ddd389-8412-4fa1-9033-1c608bbde247
-
setup
.env
&.env.local
-
create
.env
file inbackend
folder.
And you need to fill below.PRIVATE_KEY= SCROLLSCAN_API_KEY= DEFENDER_API_KEY= DEFENDER_SECRET_KEY= GAS_REPORT= COINMARKETCAP_API_KEY=
-
create
.env.local
file infrontend
folder.
And you need to fill below.NEXT_PUBLIC_ENABLE_TESTNETS= NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID= SCROLLSCAN_API_KEY= DEFENDER_API_KEY= DEFENDER_SECRET_KEY= BEARER_TOKEN= KEY_LENGTH= BACKEND_API_URL= CIRCUIT_ID= SINDRI_API_ENDPOINT= NEXT_AWS_ACCESS_KEY_ID= NEXT_AWS_SECRET_ACCESS_KEY= NEXT_AWS_REGION=
-
-
install
yarn
-
frontend build
yarn frontend:build
-
frontend run
yarn frontend:dev
-
smartcontract compile
yarn backend:build
-
smartcontract test
yarn backend:test
-
smartcontract deploy
yarn backend:deploy:scrollSepolia
-
call Mock contract
verifyproof
methodyarn backend:script:verify:mock:scrollSepolia
-
call Mock contract
verifyproof
method (Gasless)yarn backend:script:gaslessVerify:mock:scrollSepolia
-
call Mock contract
setScore
method (Gasless)yarn backend:script:gaslessSetScore:mock:scrollSepolia
-
compile circuit
yarn circuit:executeGroth16
-
test circuit
yarn circuit:test
-
execute getTxdata sample scripts
yarn scripts:sample
sample result
Normal Transaction data: [ . . . ] Normal Transaction count: 12 Internal Transaction data: [ . . . ] Internal Transaction count: 3 Total Transaction count:15 ================================== [END] ================================== ✨ Done in 1.61s.
Before interacting with the backend APIs, ensure the frontend is built and running. Use the following command to start:
yarn build:dev
Generates a public and a private key for encryption and decryption.
- Endpoint: /api/generateKeyPairs
- Method: POST
- Request (req):
{ "name": "<your name>" }
- CURL Example:
curl -X POST http://localhost:3000/api/generateKeyPairs -H "Content-Type: application/json" -d '{"name":"<your name>"}'
Encrypts a given number using the generated public key.
- Endpoint: /api/encrypt
- Method: POST
- Request (req):
{ "name": "<your name>", "num": "<put number>" }
- CURL Example:
curl -X POST http://localhost:3000/api/encrypt -H "Content-Type: application/json" -d '{"name":"<your name>", "num":"<put number>"}'
Adds two encrypted numbers together, returning the encrypted sum.
- Endpoint: /api/add
- Method: POST
- Request (req):
{ "name": "<your name>", "encNum1": "<put encNum1>", "encNum2": "<put encNum2>" }
- CURL Example:
curl -X POST http://localhost:3000/api/add -H "Content-Type: application/json" -d '{"name":"<your name>", "encNum1":"<put encNum1>", "encNum2":"<put encNum2>"}'
Decrypts an encrypted number using the generated private key.
- Endpoint: /api/decypt
- Method: POST
- Request (req):
{ "name": "<your name>", "encNum": "<put encNum>" }
- CURL Example:
This structured format provides a clear, concise description of each API endpoint, including the HTTP method used, a brief description, the request body format, and an example curl command to test the endpoint. Adjust the , , , and placeholders as necessary to match your actual use case.
curl -X POST http://localhost:3000/api/decrypt -H "Content-Type: application/json" -d '{"name":"<your name>", "encNum":"<put encNum>"}'
Retrieves the details of a proof using its unique proof ID.
- Endpoint: /api/getProofDetail
- Method: POST
- Request (req):
{ "proof_id": "<proof_id>" }
- CURL Example:
curl -X POST http://localhost:3000/api/getProofDetail -H "Content-Type: application/json" -d '{"proof_id":"<proof_id>"}'
Submits proof input for a circuit to generate a proof. This endpoint might typically be used to initiate the proving process for a specific circuit with given inputs.
-
Endpoint: /api/submitProofInput
-
Method: POST
-
Request (req):
{ "name": "<your name>", "totalScore": "<totalScore>", "totalEvaluater": "<totalEvaluater>", "lineNumber": "<lineNumber>" }
-
CURL Example:
curl -X POST http://localhost:3000/api/submitProofInput -H "Content-Type: application/json" -d '{"name":"<your name>", "totalScore": "<totalScore>", "totalEvaluater": "<totalEvaluater>", "lineNumber": "<lineNumber>"}'
Checks if the calculated score is above a certain threshold. This endpoint might typically be used after submitting proof input and obtaining a proof to determine if the result meets a specific criterion.
-
Endpoint: /api/isAbove
-
Method: POST
-
Request (req):
{ "name": "<your name>", "totalScore": "<totalScore>", "totalEvaluater": "<totalEvaluater>", "lineNumber": "<lineNumber>" }
-
CURL Example:
curl -X POST http://localhost:3000/api/isAbove -H "Content-Type: application/json" -d '{"name":"<your name>", "totalScore": "<totalScore>", "totalEvaluater": "<totalEvaluater>", "lineNumber": "<lineNumber>"}'
These additions provide a comprehensive overview of the backend APIs, including operations for generating key pairs, encrypting numbers, adding encrypted numbers, decrypting numbers, and interacting with proofs. Remember to replace , , , , and <proof_id> placeholders with actual values relevant to your use case.