Skip to content

Commit 5ebf101

Browse files
committed
docs: cli and sdk reference
1 parent a6492a3 commit 5ebf101

2 files changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Aligned SDK
2+
3+
## API Reference for aggregation mode
4+
5+
### `is_proof_verified_in_aggregation_mode`
6+
7+
Checks if the proof has been verified with Aligned and is included in the batch on-chain.
8+
9+
```rust
10+
pub async fn is_proof_verified_in_aggregation_mode(
11+
proof_data: ProofData,
12+
network: Network,
13+
eth_rpc_url: &str
14+
beacon_client_url: &str,
15+
from_block: Option<u64>
16+
) -> Result<[u8; 32], ProofVerificationAggModeError>
17+
```
18+
19+
#### Arguments
20+
21+
- `proof_data` - The proof data needed based on the provided proving system.
22+
- `network` - The network on which the verification will be done (`devnet | holesky | mainnet`)
23+
- `eth_rpc_url` - The URL of the Ethereum RPC node.
24+
25+
#### Returns
26+
27+
- `Result<[u8; 32], ProofVerificationAggModeError>` - The merkle root of the aggregated proof.
28+
29+
#### Errors
30+
31+
- `ProvingSystemNotSupportedInAggMode` if the proving system is not supported (Currently, only SP1 compressed proofs are supported).
32+
- `EthereumProviderError` if there is an error in the Ethereum call.
33+
- `BeaconClient` if there is an error in the Beacon client call.
34+
- `UnmatchedBlobAndEventMerkleRoot` if the proof was in included in the blob but the merkle root did not match with the one in the contract
35+
- `ProofNotFoundInLogs` if the proof was not found in any of the aggregated proofs from the specified block_number
36+
- `EventDecoding`: if it failed to decode an event from the ProofAggregationService

docs/3_guides/9_aligned_cli.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,46 @@ aligned get-user-amount-of-queued-proofs \
346346
--network holesky \
347347
--batcher_url wss://batcher.alignedlayer.com
348348
```
349+
350+
351+
---
352+
353+
### **verify-agg-proof**
354+
355+
#### Description:
356+
357+
Verifies if your proof has been verified by the `ProofAggregationService`.
358+
359+
#### Command:
360+
361+
`cargo run verify-agg-proof [OPTIONS] --proving_system <proving_system>`
362+
363+
#### Options:
364+
365+
- `--vk`: Verification key hash file path.
366+
- `--public_input`: Your program committed values file path.
367+
- `--from-block`: From which block to start fetching events. This must no be older than 18 days as blobs will be expired. Defaults to the block corresponding to last 24 hours.
368+
- `--network <working_network_name>`: Network name to interact with.
369+
- Default: `devnet`
370+
- Possible values: `devnet`, `holesky`, `mainnet`
371+
- `--rpc_url <RPC_provider_url>`: User's Ethereum RPC provider connection address.
372+
- Default: `http://localhost:8545`
373+
- Mainnet: `https://ethereum-rpc.publicnode.com`
374+
- Holesky: `https://ethereum-holesky-rpc.publicnode.com`
375+
- Also, you can use your own Ethereum RPC providers.
376+
- `--beacon_client_url <BEACON_CLIENT_URL>`: User's Ethereum Consensus provider connection address. Public nodes don't support this method.
377+
378+
379+
380+
#### Example:
381+
382+
```bash
383+
aligned verify-agg-proof \
384+
--network holesky \
385+
--from-block 3638552 \
386+
--proving_system SP1 \
387+
--public_input ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.pub \
388+
--vk ./scripts/test_files/sp1/sp1_fibonacci_4_1_3.vk \
389+
--beacon_url <YOUR_BEACON_CLIENT> \
390+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
391+
```

0 commit comments

Comments
 (0)