# BLOOM Bitcoin Vault

This adapter runs Espresso's exact PQSB implementation locally. It does not port PQSB to Solana or claim payment privacy. The upstream engine remains a separate, unmodified Git checkout. Revision: `944bc932151ea61bfd4774b6855a36a2b96b62bb`.

## Install on Linux, macOS, or Windows WSL2

Requires Python 3.12+, Git, a C++ compiler, and Rust 1.85.1 or newer (the pinned Cargo lockfile requires a recent Cargo). Bitcoin Core is needed for regtest. Obtain these dependencies from their official sources.

```sh
git clone https://github.com/EspressoSystems/PQSB.git PQSB
git -C PQSB checkout --detach 944bc932151ea61bfd4774b6855a36a2b96b62bb
cd PQSB/pqai-btc-everything/implementation-app
sh solver/build.sh
cd verifier
cargo build --release --locked
```

Download `bloom_vault.py` from BLOOM's Bitcoin Vault page. Then run, substituting your absolute checkout path:

```sh
python3 bloom_vault.py --pqsb /absolute/path/to/PQSB
```

The launcher opens a local browser page with a private per-launch token. Do not share its URL. The hosted BLOOM page never receives this token or your secrets. The local interface supports the upstream SegWit and Legacy setup/funding/spend workflows, vault listing, estimates, and public explorer. Mainnet transactions are prepared for manual broadcasting; automatic funding and mining are restricted to regtest. Start with regtest.

The adapter requires the Bitcoin consensus verifier to exist before the spending API runs. It preserves upstream cryptography, parameter tables, and the local authentication checks. No dependency source is redistributed here; clarify upstream licensing before vendoring or distributing their implementation.

## Limits

PQSB is experimental and unaudited. Its files store secrets in plaintext. Each lock authorizes one payment: a second distinct signature can weaken security even if the first transaction never confirms. Keep backups private; do not copy vault state across simultaneously signing devices. This adapter does not replace PQSB's file lifecycle with a production wallet keystore or solve backup rollback/concurrent-process signing. Do not treat it as audited custody software.

The hosted Solana workspace provides public wallet-to-wallet payments; it is separate from PQSB. The Bitcoin vault runs locally and requires its native dependencies. Authorization is not transaction privacy.

## Run the complete local-chain test

After installing Bitcoin Core, point BITCOIN_BIN at its bin directory:

```sh
BITCOIN_BIN=/absolute/path/to/bitcoin/bin python3 bloom_vault.py --pqsb /absolute/path/to/PQSB --self-test
```

This runs both SegWit level 64 and Legacy level 124 through the authenticated BLOOM adapter: create, fund, find a spend, verify with the Bitcoin consensus library, mine, and reject a second spend. These are test parameters, not a recommendation for real-value custody. No public-chain coins are used.

## Windows runtime on this computer

The isolated WSL distribution is named `Bloom-PQSB`. The pinned engine lives at `/opt/bloom/PQSB`, and Bitcoin Core 28.1 is at `/opt/bloom/bitcoin-28.1/bin`. Download `Start-BloomVault.ps1` alongside `bloom_vault.py`, then run it from PowerShell. Open the private localhost URL it prints and leave the terminal open. Pass `-SelfTest` to repeat the full local-chain test. Other computers must install the prerequisites first; the launcher does not install a Linux distribution.
