SEMVI CLI GUIDE Current status: real engine tests pass; mainnet publication awaits funding. Experimental MVP; inspect the contract before using real funds. BUILD AND CHECK cargo test --test settlement -- --nocapture cargo build --examples cargo build --target wasm32-unknown-unknown --release WALLET Use the official authenticated Tari wallet daemon on 127.0.0.1:5100. Enable local cookie authentication for same-OS-user automation, and set TARI_WALLET_COOKIE_FILE to the daemon's actual .cookie file path. Never disable authentication for real funds or expose the cookie to a website. python3 scripts/wallet.py status Mainnet needs real Ootle TARI. L1 Minotari XTM has different addresses; never send XTM directly to an Ootle address. Follow the official burn/claim guide when bridging. The tool does not automate conversion or acquire funds. ESTIMATE PUBLISHING (NO SUBMISSION) python3 scripts/wallet.py publish \ --file target/wasm32-unknown-unknown/release/semvi.wasm \ --max-fee YOUR_MICROTARI_FEE_CEILING The fee account must exist on chain and be funded. An empty unconfirmed account currently produces a missing-substate error, not a fee quote. CREATE A DEDICATED INTENT KEY target/debug/examples/intent keygen /secure/payer.key This prints a PUBLIC key and creates the private file with mode 0600. Back it up outside source control. To withdraw from its vault, import the key into your authorized wallet using official key-import support. Never paste it into the browser proof interface. Your wallet returns the actual imported KeyId, e.g. {"Imported":{"local_key_id":1}}. Do not guess its ID. PREPARE A REQUEST Write request-spec.json. All uppercase values below are placeholders: { "action": "create", "network": "mainnet", "current_epoch": "CURRENT_MAINNET_EPOCH", "fee_account": "YOUR_ACCOUNT_COMPONENT", "max_fee": "YOUR_MICROTARI_FEE_CEILING", "seal_signer": {"Derived":{"key_branch":"account","index":0}}, "template": "PUBLISHED_TEMPLATE_HASH", "payer": "PUBLIC_KEY_FROM_KEYGEN" } Use your wallet's actual owner_key_id for seal_signer; index 0 is only an example. Get the current epoch from the intended network's indexer. Mainnet: https://indexer-a.ootle.tari.com/epoch-manager/stats target/debug/examples/prepare request-spec.json > prepared-request.json python3 scripts/wallet.py transaction --file prepared-request.json This is a DRY RUN. Inspect fees, outcome and expected state changes. The helper sets a fresh nonce and three-epoch transaction validity window. FUND A VAULT Keep the base fields above, replace action with fund, remove template/payer, and add rail (your Semvi component) and amount_micro (decimal string). Funding withdraws revealed TARI from fee_account and deposits it in rail. Native stealth holdings must first be made usable as revealed account-vault funds through official wallet tooling. No silent privacy-mode substitution. SIGN A BUSINESS JOB target/debug/examples/intent sign /secure/payer.key \ mainnet VAULT_COMPONENT JOB_HASH RECIPIENT_COMPONENT AMOUNT_MICRO EXPIRY_EPOCH \ > intent.json Persist the (network, vault, job ID) mapping before submitting. Reuse it after a timeout; a new ID authorizes a new payment. Intent expiry is independent of each transaction's three-epoch validity window. RELAY OR RETRY Keep base fields, set action to execute, remove template/payer/rail, and add intent_file (path to the same signed intent.json). target/debug/examples/prepare request-spec.json > prepared-request.json python3 scripts/wallet.py transaction --file prepared-request.json New preparation yields a new transaction for the same business job. Already-paid jobs fail with OperationConsumed. Relayers cannot redirect funds. SUBMIT ONLY AFTER EXPLICIT APPROVAL Actual submission requires BOTH the flag and approved-network environment: SEMVI_APPROVED_NETWORK=mainnet python3 scripts/wallet.py transaction \ --file prepared-request.json --submit --out transaction-response.json Publication has the same --submit/network gate. Tool availability does not constitute spending permission. Record the returned ID before waiting: python3 scripts/wallet.py receipt --tx TRANSACTION_ID An ambiguous response is not evidence that a payment failed. WITHDRAW UNUSED FUNDS Keep base fields; action withdraw; add rail, recipient (receiving account), amount_micro and other_signers (array containing the actual imported payer KeyId). Prepare and dry-run first. Only the payer's badge can authorize withdrawal. It works even when all 256 registry slots are used. BOUNDARIES At most one settlement per vault/job ID. No guaranteed delivery, cost-free retry, private payout or outside audit claim. Paid IDs are never pruned. New vaults and new job IDs are independent namespaces.