§ Docs · T.01
Send a shielded transaction.
The default mode of transferring ADM. Sender, recipient, amount and memo are encrypted before the transaction leaves the device; the chain sees the envelope, the validity proof, and the fee.
§ 01 / Code
In Rust.
use adamant_sdk::{Client, Tx, Amount};
use adamant_sdk::address::StealthAddress;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = Client::new("wss://rpc.adamantprotocol.com").await?;
let wallet = adamant_sdk::Wallet::from_seed_phrase(&std::env::var("ADM_SEED")?)?;
// Derive a one-time recipient address from the recipient's published
// viewing key (ML-KEM-768 encapsulation).
let recipient = StealthAddress::derive(
"vkpub1...", // recipient's long-lived view pubkey
)?;
let tx = Tx::shielded_transfer()
.from(wallet.address())
.to(recipient)
.amount(Amount::adm(10)) // 10 ADM
.memo("invoice #42") // encrypted, included in envelope
.build(&wallet)
.await?;
let hash = client.submit(tx).await?;
println!("submitted: {}", hash);
Ok(())
} Behind the scenes: the SDK constructs a fresh stealth address, encrypts the body under ML-KEM-768, generates a Halo 2 proof of correct state transition, and packages it into a transaction envelope. The validator set verifies the proof; the body is decryptable only by the recipient’s view key.
§ 02 / What an observer sees
From the public view.
| Field | Visible? |
|---|---|
| Transaction hash | yes |
| Block height | yes |
| Fee · multi-dim | yes |
| Validity proof | yes |
| Encryption regime | yes |
| Sender | encrypted |
| Recipient | encrypted |
| Amount | encrypted |
| Memo | encrypted |