Skip to main content

Crate dpo2u_sdk

Crate dpo2u_sdk 

Source
Expand description

§dpo2u-sdk

Rust client SDK for the DPO2U on-chain compliance programs on Solana. Provides canonical program IDs, PDA derivers, and purpose-hash helpers for integrators building Anchor programs that CPI into DPO2U or off-chain clients that build DPO2U transactions directly.

§Programs covered

ProgramProgram ID (devnet)Purpose
compliance_registry7q19zbMMFCPSDhJhh3cfUVJstin6r1Q4dgmeDAuQERyKDPIA/audit attestation with ZK binding
sp1_verifier5xrWphWXoFnXJh7jYt3tyWZAwX1itbyyxJQs8uumiRTWGroth16 pairing CPI target
consent_managerD5mLHU4uUQAkoMvtviAzBe1ugpdxfdqQ7VuGoKLaTjfBDPDP India consent events
art_vaultC7sGZFeWPxEkaGHACwqdzCcy4QkacqPLYEwEarVpidnaMiCAR ART safeguards (PoR + liquidity + buffer + velocity)
aiverify_attestationDSCVxsdJd5wVJan5WqQfpKkqxazWJR7D7cjd3r65s6cmAI Verify Singapore attestation
agent_registry5qeuUAaJi9kTzsfmiphQ89PNrpqy7xW7sCvhBZQ6mya7DPO/auditor DIDs with capability bits
payment_gateway4Qj6GziMjUfh4TszuSnasnEqnASqQBS6SHw6YAu9U23QMCP invoicing (SPL Token CPI)
fee_distributor88eKEEMMnugv8AFWRvqa4i7LEiL7tM9bEuPTVkRbD76xAtomic 70/20/10 split
agent_wallet_factoryAjRqmxyieQieov2qsNefdYpa6HbPhzciED7s5TfZi1inDeterministic PDA wallets
use dpo2u_sdk::{programs, pdas};
use solana_program::pubkey::Pubkey;
use std::str::FromStr;

let user = Pubkey::from_str("7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU").unwrap();
let fiduciary = Pubkey::from_str("5qeuUAaJi9kTzsfmiphQ89PNrpqy7xW7sCvhBZQ6mya7").unwrap();
let purpose_hash = pdas::purpose_hash(b"marketing_communications");

let (consent_pda, _bump) = pdas::consent_pda(&user, &fiduciary, &purpose_hash);
assert_ne!(consent_pda, Pubkey::default());

Re-exports§

pub use programs::*;

Modules§

pdas
PDA derivers — all match the #[account(seeds = ...)] declarations in the on-chain programs. Use these exact functions client-side to avoid seed drift.
programs
Canonical program IDs (devnet === mainnet addresses — upgrades keep IDs).
public_values
Helpers for parsing the 96-byte PublicValuesStruct ABI layout used by both compliance-registry::create_verified_attestation and consent-manager::record_verified_consent.
seeds
Raw seed constants (for callers building transactions that need to mirror the Rust program’s #[account(seeds = ...)] exactly).