Devnet · Checking
Protocol · Phase 1

Quantum Vault Protocol

An undeployed Solana program designed for policy-limited classic SPL Token escrow. Unaudited; compiled-program execution passed locally, not on devnet.

Instructions and permissions

on-chain
InstructionSignerEnforced by program
create_vaultOwnerFixes mint, destination token account, per-withdraw max, fixed 24-hour window limit, unlock time. Immutable afterwards.
depositToken holdertransfer_checked into the vault PDA's associated token account. Zero rejected.
withdrawOwnerProgram checks policy against Clock, nonce, epoch, expiry; PDA signs transfer_checked to the fixed destination only.
pauseOwnerImmediate. Blocks all withdrawals.
request_unpause / unpauseOwnerUnpause activates only after 24h and bumps the epoch, voiding older intents.

No admin, no rescue, no policy loosening, no arbitrary CPI, classic SPL Token only (no Token-2022, no native SOL). Program upgrade authority will be disclosed at deployment; upgradeable programs are not immutable.

Vault address calculator

local build id
Vault PDA
—
Escrow token account
—

Policy preview

advisory — program is the authority

Would pass policy

Intents expire within 10 minutes and must use the next sequential nonce.

Deploy & Verify — devnet only

OWNER SIGNATURE REQUIRED

Status: NO PUBLIC DEVNET DEPLOYMENT. This app never receives, stores or uses a private key and cannot deploy programs from the browser. You deploy from your own machine with your own signer and remain the upgrade authority. Your wallet keypair (pays and holds upgrade authority) is distinct from the program-id keypair (only fixes the address).

Toolchain: Agave 2.2.20 · SBF platform-tools v1.57 · Anchor CLI 0.31.1 · nightly-2025-11-01 (IDL only). The placeholder build hash 60b2a0bbe9207d83… only matches the placeholder program id; your rebuild with your own id produces a new hash. Reviewed owner artifact: none yet — bytecode check shows NOT CHECKED. Share only your public program address and public upgrade authority.

  1. 1. Pin the toolchain (Agave 2.2.20, platform-tools v1.57, Anchor 0.31.1, nightly-2025-11-01)
    sh -c "$(curl -sSfL https://release.anza.xyz/v2.2.20/install)"
    solana --version            # solana-cli 2.2.20
    cargo-build-sbf --version   # expect platform-tools v1.57
    cargo install --git https://github.com/coral-xyz/anchor avm --locked
    avm install 0.31.1 && avm use 0.31.1 && anchor --version
    rustup toolchain install nightly-2025-11-01
  2. 2. Work from the repository root
    cd /path/to/QLi                       # your clone
    export QLI_ROOT="$(pwd)"
    test -f programs/Anchor.toml && echo "root ok"
    mkdir -p programs/target/deploy
    mkdir -p "$HOME/.config/qli-devnet" && chmod 700 "$HOME/.config/qli-devnet"
  3. 3. Devnet only: set and check the cluster
    solana config set --url https://api.devnet.solana.com
    solana genesis-hash --url https://api.devnet.solana.com   # must print EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG
  4. 4. Owner wallet = fee payer + upgrade authority (private; keep offline, back up safely)
    solana-keygen new --outfile "$HOME/.config/qli-devnet/owner.json"
    chmod 600 "$HOME/.config/qli-devnet/owner.json"
    export OWNER="$(solana-keygen pubkey "$HOME/.config/qli-devnet/owner.json")"; echo "$OWNER"
    solana airdrop 2 "$OWNER" --url https://api.devnet.solana.com
  5. 5. Program-id keypair (separate file; only fixes the address; never commit it)
    solana-keygen new --outfile "$QLI_ROOT/programs/target/deploy/quantum_vault-keypair.json"
    chmod 600 "$QLI_ROOT/programs/target/deploy/quantum_vault-keypair.json"
    export PROGRAM_ID="$(solana-keygen pubkey "$QLI_ROOT/programs/target/deploy/quantum_vault-keypair.json")"; echo "$PROGRAM_ID"
    git -C "$QLI_ROOT" check-ignore programs/target/deploy/quantum_vault-keypair.json   # must print the path
    test "$PROGRAM_ID" != "$OWNER" && echo "distinct keys ok"
  6. 6. Align the program id (review every diff by hand)
    (cd "$QLI_ROOT/programs" && anchor keys sync)   # updates declare_id! and Anchor.toml
    # Then edit by hand, replacing the old placeholder with $PROGRAM_ID:
    #   src/lib/qli-core/quantum-vault.ts   LOCAL_BUILD_PROGRAM_ID
    #   (tests import LOCAL_BUILD_PROGRAM_ID; no other fixture edits needed)
    grep -n "declare_id" "$QLI_ROOT/programs/quantum_vault/src/lib.rs"
    grep -n "quantum_vault =" "$QLI_ROOT/programs/Anchor.toml"
    grep -n "LOCAL_BUILD_PROGRAM_ID =" "$QLI_ROOT/src/lib/qli-core/quantum-vault.ts"
    grep -rn "93v9K8ytGDR3BAoxtaVVo7u1oaBv3Pu257eBAPCp7SH5" "$QLI_ROOT/programs" "$QLI_ROOT/src" --exclude-dir=target   # must print nothing
  7. 7. Rebuild SBF + IDL with the new id and record the NEW hash
    (cd "$QLI_ROOT/programs" && cargo-build-sbf --tools-version v1.57 --manifest-path quantum_vault/Cargo.toml --sbf-out-dir target/deploy)
    (cd "$QLI_ROOT/programs" && RUSTUP_TOOLCHAIN=nightly-2025-11-01 anchor idl build -p quantum_vault -o idl/quantum_vault.json -- --locked)
    sha256sum "$QLI_ROOT/programs/target/deploy/quantum_vault.so"
    stat -c%s "$QLI_ROOT/programs/target/deploy/quantum_vault.so"
    grep -n "\"address\"" "$QLI_ROOT/programs/idl/quantum_vault.json"   # must equal $PROGRAM_ID
    # The old placeholder hash no longer applies.
  8. 8. Run tests from the root against the rebuilt binary
    (cd "$QLI_ROOT/programs" && cargo test -p quantum_vault_policy)
    (cd "$QLI_ROOT" && QLI_VAULT_SBF=1 BPF_OUT_DIR="$QLI_ROOT/programs/target/deploy" bunx vitest run src/test/quantum-vault-sbf.test.ts src/test/quantum-vault.test.ts)
  9. 9. OWNER SIGNATURE REQUIRED — deploy to devnet with your own signer
    solana program deploy "$QLI_ROOT/programs/target/deploy/quantum_vault.so" \
      --program-id "$QLI_ROOT/programs/target/deploy/quantum_vault-keypair.json" \
      --upgrade-authority "$HOME/.config/qli-devnet/owner.json" \
      --keypair "$HOME/.config/qli-devnet/owner.json" \
      --url devnet
  10. 10. Verify on-chain bytes and authority
    solana program show "$PROGRAM_ID" --url devnet   # Authority must equal $OWNER
    solana program dump "$PROGRAM_ID" /tmp/qv-dumped.so --url devnet
    LEN=$(stat -c%s "$QLI_ROOT/programs/target/deploy/quantum_vault.so")
    head -c "$LEN" /tmp/qv-dumped.so | sha256sum   # must equal step 7
    tail -c +$((LEN + 1)) /tmp/qv-dumped.so | tr -d '\0' | wc -c   # must print 0 (padding only)
  11. 11. Share only public addresses
    echo "program: $PROGRAM_ID  upgrade authority: $OWNER"
    # Then commit OWNER_REVIEWED_ARTIFACT (sha256, length, programId) and the
    # QUANTUM_VAULT_DEPLOYMENT config for source review. Never share keypair JSON or seed phrases.

Multisig: after verification, transfer upgrade authority to a Squads multisig with solana program set-upgrade-authority — only after testing on devnet.

Program Verifier

read-only · devnet RPC

A passing report is evidence only. Write controls stay disabled until the reviewed deployment config is committed to source and re-attested live before every signature.

Vault Sentinel

read-only

Ready for first devnet vault — no verified deployment, no balances or alerts.

Scheduled worker coverage of vaults: not configured. Sentinel proposals (e.g. pause after an authority change) are review documents; every action is rebuilt from a fresh chain read and signed by your wallet.

Related prototypes

reference only

My Vaults & Key holds a local ML-DSA-65 key in tab memory and Quantum Wallets models WOTS vault chains. Neither is connected to this program, and Flywheel wallet tokens are not held in any vault.

Phase 2 research — not built

future

On-chain post-quantum verification (WOTS/XMSS or ML-DSA) is under research: transaction size (1,232 bytes), compute budget, multi-instruction signature staging and published test vectors. Until a verifier is deployed and audited, Quantum Identity and Quantum Authorization proofs remain application-level. Nothing in Phase 1 checks them.