Guardian Client
A minimal Rust client library for interacting with the Guardian gRPC service.
API Reference
Client Creation
use Arc;
use SecretKey;
use ;
// Without authentication (only for configure endpoint)
let client = connect.await?;
// With request signing (required for all other endpoints)
let secret_key = new;
let signer = new;
let client = connect
.await?
.with_signer;
Authentication
The client uses Falcon RPO signatures for authenticated requests. Here is how to set it up:
1. Create a Signer
use Arc;
use SecretKey;
use FalconKeyStore;
// Generate a new secret key
let secret_key = new;
let signer = new;
// Get the public key for authorization
let pubkey_hex = signer.public_key_hex;
2. Configure Client with Signer
let client = connect
.await?
.with_signer;
3. Set Up Account Authorization
use auth;
// Add the public key to the account's authorized cosigners
let auth_config = miden_falcon_rpo_auth;
Server Signature Verification
After pushing a delta, the server returns an Acknowledgment signature that signs the new commitment. You should verify this signature to ensure the server is signing with the expected public key.
use verify_commitment_signature;
let push_response = client.push_delta.await?;
if let Some = &push_response.delta
The server signs the new_commitment (the resulting commitment after applying the delta) to provide cryptographic proof that it processed the delta correctly.
Example