The Zcash payment method for the Machine Payments Protocol. Shielded by default.
Every on-chain transaction is competitive intelligence. Zcash encrypts all of it.
Which APIs, how often, how much. All visible on public chains.
Visible spend lets services price against your profile.
Orchard viewing key verification. Only the recipient sees the payment.
Standard MPP. 402 challenge, shielded payment, retry with proof.
import { Mppx } from 'mppx/server' import { zcash } from 'zimppy-ts/server' const mppx = Mppx.create({ methods: [await zcash({ wallet: 'server' })], }) const result = await mppx.charge({ amount: '42000', currency: 'zec', })(request) if (result.status === 402) return result.challenge return result.withReceipt(Response.json({ data }))
use mpp::server::axum::*; use mpp::server::Mpp; use zimppy_rs::ZcashChargeMethod; struct FortunePrice; impl ChargeConfig for FortunePrice { fn amount() -> &'static str { "42000" } } let mpp = Mpp::create(ZcashChargeMethod::new( &rpc, &address, &orchard_ivk, ))?; let state: Arc<dyn ChargeChallenger> = Arc::new(mpp); let app = Router::new() .route("/api/fortune", get(fortune)) .with_state(state); async fn fortune( charge: MppCharge<FortunePrice>, ) -> WithReceipt<Json<Value>> { WithReceipt { receipt: charge.receipt, body: Json(json!({ "fortune": pick() })), } }
import { Mppx } from 'mppx/client' import { zcash } from 'zimppy-ts/client' const mppx = Mppx.create({ methods: [zcash({ wallet: 'default' })], }) // 402 → pay → retry handled automatically const res = await mppx.fetch('https://api.example.com/fortune') console.log(await res.json())
use mpp::client::Fetch; use zimppy_rs::ZcashPaymentProvider; let provider = ZcashPaymentProvider::new( wallet_config, &rpc_endpoint, ); // 402 → pay → retry handled automatically let resp = client .get("https://api.example.com/fortune") .send_with_payment(&provider) .await?; let fortune = resp.json::<Fortune>().await?;
Agent-native wallet. Full MPP spec support. One command to pay any 402 endpoint.
Address, balance, network status.
402 discovery, payment, retry. Charge or session.
Fully shielded. Nothing exposed on-chain.
Isolated identities per agent or environment.