provable-sdk
Rust SDK for interacting with Kayros through the Provable API.
Do not send raw data to Provable. Hash the data first with your preferred algorithm, or use the helpers in this crate and register the resulting data_item.
Installation
[]
= "0.1.2"
Usage
1. Default usage
use ;
let data_item = "2ee055213dc902d9b2ebab428c780167c500c2c33ef33fa4ca5baab379a23565";
let prove = prove_single_hash.expect;
let verify = verify;
assert!;
assert!;
2. Usage with API key and custom data type
use ;
let data_item = "2ee055213dc902d9b2ebab428c780167c500c2c33ef33fa4ca5baab379a23565";
let data_type = "benchmark_s32";
let api_key = var.expect;
let options = RequestOptions ;
prove_single_hash_with_options.expect;
let verify = verify_with_inclusion;
assert!;
let kayros_hash = verify
.details
.as_ref
.and_then
.map
.expect;
let proof = get_merkle_proof.expect;
assert!;
Main API
prove_single_hash(...)andprove_single_hash_with_options(...)get_record_by_hash(...)compute_hash_from_hex(...)verify(...)verify_with_inclusion(...)verify_merkle_proof(...)get_merkle_proof(...)verify_hash_existence(...)verify_hash_batch(...)normalize_merkle_proof(...)get_merkle_proof_levels(...)check_merkle_proof_compatibility(...)
Notes
- Default Kayros host:
https://kayros.provable.dev - Default
data_type:provable_sdk - Default API key: the SDK test key, equivalent to the other language SDKs
- Merkle level hashing defaults to
sha3-256unless explicitly overridden