Repository navigation
v3.8.5
MetroVault v3.8.5 - Release Notes
Silent Payments (BIP-352)
Full BIP-352 Silent Payments support: receive, send, and spend sp1q… payments entirely air-gapped. MetroVault can now act as a cold signer for Silent Payment wallets end-to-end.
- Create & Import SP Wallets: Silent Payments is now a wallet type in both the create and import flows, for Mainnet (
sp1q…) and Testnet (tsp1q…). - Receive: Derive BIP-352 scan (
b_scan) and spend (b_spend) keys from the master key and present the wallet's silent-payment receive address with a QR code. - Send: Pay to
sp1q…/tsp1q…addresses. MetroVault resolves the nominal SP address into the real on-chain Taproot (bc1p…) output before signing, so you can verify exactly where funds are going. - Spend Received Outputs: Sign PSBT inputs that spend previously received silent-payment outputs, computing the tweaked key-path signing key (
d = b_spend + tweak) with validation that the tweak matches the input's Taproot output key. - Mixed Transactions: Transactions combining silent-payment and standard inputs (and SP sends alongside SP receives) are handled in a single signing flow.
Scan-Key Export (Watch-Only Setup)
Set up a watch-only Silent Payments wallet on your online coordinator without ever exposing spend authority:
- Scan-Key Export Screen: Export BIP-352 scan keys and descriptors with QR generation and account-level derivation.
spscan/tspscanCodec: Bech32m encoding/decoding of scan-key export strings.- Cold-Signer Safety: The codec strictly rejects spend-key exports (
spspend/tspspend), preserving the cold-signer security model — the spend key never leaves the device.
PSBT v2 Support (BIP-370)
Silent Payment sends from coordinators are PSBT v2 (like Sparrow), MetroVault now parses and serializes them.
- Full v2 Read/Write:
PsbtReader.readV2synthesizes the transaction from per-input/output fields (PSBT_IN_PREVIOUS_TXID,PSBT_OUT_AMOUNT, locktime computation);PsbtWriterserializes v2 with global transaction counters. - Byte-for-Byte Round-Trips: Verified against real PSBT v2 fixtures exported from Sparrow, preserving unknown fields (e.g.
PSBT_OUT_SP_V0_INFO) across read/write. - Backward Compatible: PSBT v0 (BIP-174) continues to work through the same reader/writer architecture.
DLEQ Proofs & Verification (BIP-374 / BIP-375)
So that watch-only wallets can independently verify the derived output scripts MetroVault produces:
- DLEQ Proofs (BIP-374): New
DleqProofutility generates and verifies Discrete Log Equality proofs. - BIP-375 Global Fields: SP resolution now authors
PSBT_GLOBAL_SP_ECDH_SHAREandPSBT_GLOBAL_SP_DLEQso coordinators can verify derived outputs. - Spec-Compliant Stripping:
PsbtWriterstrips global silent-payment proof fields from PSBT v0 serializations per BIP-375 constraints.
BIP-322 Message Signing
Modern message signing that works with Taproot and Silent Payment addresses:
- BIP-322 Support: New
Bip322utility performs virtual-transaction signing and verification, enabling message signing for address types that legacy signing can't handle. - Unified Signer:
WalletMessageSignercentralizes signing/verification across BIP-137 (Electrum/legacy), and BIP-322. - Air-Gapped SP Signing: BIP-322 message-signing PSBTs allow message signing for Silent Payment wallets over QR.
Change Script Type
Single-sig wallets can now switch script types while preserving their account structure:
- Switch Anytime: Toggle a wallet between Taproot, Native SegWit, Nested SegWit, and Legacy.
- Access: Wallet Details → Change Script Type.
Multisig Registration & Change-Address Validation
Multisig wallets must now be explicitly registered before they can sign, closing the change-address attack where a malicious or buggy coordinator routes "change" to an address it controls.
- Verify & Register Ceremony: A dedicated screen (shown at import and reachable later from Wallet Details) that leads with the derived first receive address and the descriptor's BIP-380
#checksumto cross-check against your coordinator, lists every cosigner's full xpub (with QR), fingerprint, and derivation path, and registers the wallet with a single confirmation. - Enforced Before Signing: Signing a multisig PSBT is blocked until the wallet is registered. The verified state is bound to a checksum of the exact descriptor, so any descriptor change automatically re-arms verification.
- Change-Output Validation: At sign time, the device derives the expected output
scriptPubKeyfrom the full registered descriptor at the PSBT-declared index. Any output that claims to be your change (carries a cosigner fingerprint) but does not match is refused — the descriptor, not the PSBT's hints, is the source of truth. - Migration: Previously-imported multisig wallets show a one-time explainer and a "Not yet verified" banner until re-registered.
- Fixes: Corrected P2SH-P2WSH (nested-segwit) multisig address derivation (a double-SHA256 of the witness script) and the Wallet Details "Address Type" label for multisig wallets.
Additional Improvements
Silent Payments UX
- Badges: A "Silent Payments" badge appears on wallet cards (Wallets screen) and in Wallet Details.
- Addresses Tab: A "Silent Payments" tab in the Addresses screen lets you derive SP addresses (gated by a global toggle).
- Discovery Toggle: Settings → Advanced adds a global toggle to enable Silent Payment features for standard wallets.
- Smart Navigation: Home and Wallet Details route SP wallets to the dedicated SP address view automatically.
- Key Exposure Warning: The SP address screen warns about key exposure and gates scan/spend key reveal behind password confirmation.
Transaction Confirmation
- SP Output Display: Confirmation screens show both the recipient's
sp1q…address and the derived on-chainbc1p…address for verification. - Self-Send Detection: Outputs are labeled
CHANGEvsRECEIVEwhen they belong to the wallet, with a "Self-Send" notice and corrected net-amount math that excludes internal outputs.
QR & Scanning
- Smarter Format Detection:
AnimatedQRScannerdistinguishesur:crypto-psbt/fromur:psbt/and falls back to single (non-animated) QR codes. - Automatic Output Format: The detected source format now auto-selects the most compatible signing output format.
- PSBT vs Plain Payloads:
isPsbtFramedetection routes PSBT frames to the joiner while letting plain payloads (addresses/messages) pass through. - SeedQR Polish: Shared
SeedQRContentcomponent, quiet-zone border for reliable scanning, grid overlay off by default, and a double-tap-to-zoom hint.
Security
- Logs Stripped from Release: New
AppLogwrapper is compile-time gated onBuildConfig.DEBUG; log strings and lambdas are completely removed from release artifacts, with ProGuard rules stripping any residualandroid.util.Logcalls.
Testing
- Major Coverage Expansion: Granular crypto tests (SHA-1/256/512, RIPEMD-160, HMAC, PBKDF2), BIP-32/39 derivation, BIP-44/49/84/86 address vectors, Taproot (Schnorr, key-/script-path,
OP_CHECKSIGADD), Bech32/Base58, and BIP-69 ordering. - SP & PSBT v2 Tests: BIP-352 reference vectors, scan-key codec round-trips, SP send/receive signing, PSBT v2 Sparrow fixtures, DLEQ vectors, BIP-375 round-trips, and BIP-322 interop.
Build & Tooling
- Gradle 9.5.1 and compileSdk 37.
- Build script cleanup (removed redundant plugins/flags),
secp256k1-jvmadded for JVM tests, and minor Compose performance fixes (lambda-basedModifier.offset).
Technical Details
Key Files Added / Modified
Silent Payments — Core Library (lib/bitcoin/)
SilentPayments.kt- shared-secret and Taproot output-key derivation; typedSilentPaymentMathExceptionSilentPaymentAddress.kt-sp1q…/tsp1q…bech32m encode/decodeSilentPaymentInputs.kt- eligible input classification (P2TR, P2WPKH, P2SH-P2WPKH, P2PKH; excludes NUMS script-path)SilentPaymentSpending.kt- one-shot spending key derivation (d = (b_spend + tweak) mod n)DleqProof.kt- BIP-374 DLEQ generation/verificationBip322.kt- BIP-322 virtual-transaction message signing
Silent Payments — Services & Orchestration
SilentPaymentSender.kt- resolves SP placeholders into final Taproot outputs; authors BIP-375 fieldsSilentPaymentReceiveSigner.kt- signs inputs spending received SP outputsSilentPaymentManager.kt/SilentPaymentWalletService.kt- wallet-level SP operations, address resolution, scan-key export, descriptorsWalletSigningService.kt-resolveSilentPaymentspre-stage and SP-aware signing flowWalletMessageSigner.kt- unified BIP-137/BIP-322 signingScanAddressCodec.kt-spscan/tspscanexport codec (rejects spend keys)
PSBT
PsbtReader.kt/PsbtWriter.kt/PsbtTypes.kt- modularized parsing/serialization, PSBT v2 (BIP-370) supportPsbtKeyResolver.kt- shared per-input key derivation extracted fromPsbtSignerBip374Fields.kt- typed accessors for SP PSBT fields (PSBT_OUT_SP_V0_INFO,PSBT_IN_SP_TWEAK, labels)PsbtAnalyzer.kt- SP recipient resolution for confirmation display
UI / Feature Screens
SPAddressScreen.kt- SP receive address with key-reveal dialogSilentPaymentExportScreen.kt- scan-key/descriptor exportScriptTypeScreen.kt- script-type switching for single-sig walletsAddressesScreen.kt/WalletDetailsScreen.kt/WalletsScreen.kt- SP tabs, badges, gated optionsTransactionConfirmation.kt- SP output rows and self-send handlingAppNavigation.kt- routes for SP address, SP export, and script type
Multisig Registration
MultisigChangeValidator.kt(new) - descriptor-based change-output validation at signingMultisigAddressService.kt-generateMultisigScriptPubKey; P2SH-P2WSH address-derivation fixVerifyMultisigScreen.kt(new) - Verify & Register ceremony, cross-checks, and receiptWalletMetadata.kt-multisigVerifiedflag bound to a descriptor checksumWallet.kt- registration state,markMultisigVerified, and signing gates (WALLET_NOT_VERIFIED/CHANGE_OUTPUT_MISMATCH)WalletDetailsScreen.kt/ScanPSBTScreen.kt/ImportMultisigScreen.kt- registration banner, pre-sign notice, and ceremony wiring
Data Model & Wallet
WalletMetadata.kt-isSilentPaymentflag, cachedB_scan/B_spendpubkeys, serializationWallet.kt- eager SP key derivation/caching,changeScriptType,SilentPaymentManagerintegrationDerivationPaths.kt- BIP-352 account/scan/spend path builders (m/352'/…)
Security & Build
AppLog.kt- compile-time-gated logging;proguard-rules.proupdatesapp/build.gradle.kts,gradle.properties,lint.xml- Gradle 9.5.1, compileSdk 37, test config
What's Changed
- Refactor and expand cryptographic unit tests and project configuration by @gorunjinian in #7
- Implement BIP-352 Silent Payments support and PSBT v2 enhancements by @gorunjinian in #8
Full Changelog: v3.8.0...v3.8.5