Skip to main content

Rust SDK

The Rust SDK provides payload hash verification and on-chain anchor checks. Signature verification is planned.

Example

use olymp_verifier::{verify_payload_hash, verify_anchor, ExpectedAnchor};

let ok = verify_payload_hash(payload_bytes, expected_hash_hex);

let expected = ExpectedAnchor {
provider: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8".into(),
source_provider: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8".into(),
schema_id: "0xa52094c663b57018c5cdc2084026c4b5bc16c72d9e040aed163e68750dc3cf70".into(),
data_type_hash: "0xc72a5198e7e10c034ec16ab75c9ee049cdf0f712e06398fa02bf301dcc74cd92".into(),
window_start: 1700000000,
window_end: 1700000600,
payload_hash: "0x458519ac7f8531c1b661fef583b421cdec31181f61f951ba95dc9891e41830cb".into(),
};

let anchor_ok = verify_anchor(
"http://localhost:8545",
"0x000000000000000000000000000000000000aaaa",
"0x8e466e6bb8feb3522eec2d274eb6dde6bb1cc0218195379934c021ae324f241f",
&expected
)?;

Notes

  • Signature verification is not implemented yet.
  • Use test vectors in test-vectors/ for payload and anchor inputs.

Disclaimers

Verification outcomes are variable and depend on on-chain state and payload integrity. No guarantees. Not investment advice.