Bitcoin Forum
November 25, 2026, 06:43:20 PM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Monitor BTC – open-source watch-only Bitcoin wallet (MIT)  (Read 86 times)
Rael Ales (OP)
Newbie
*
Online Online

Activity: 3
Merit: 2


View Profile WWW
November 22, 2026, 04:27:59 PM
 #1

I'm sharing Monitor BTC, an open-source, watch-only Bitcoin wallet that runs on Cloudflare Workers. It shows balance, receive addresses and history from an xpub, without ever handling private keys.

How it works

The user pastes an xpub/zpub/ypub. The server derives the addresses (BIP44, 49, 84 and 86) and reads balance and history from Electrum servers over TLS.
It builds unsigned PSBTs with fee and change calculation, and can accelerate a pending transaction via CPFP.
Signing is done offline in Cofre BTC, a single HTML file that runs in the browser. Before signing, it checks the account, derivation, script, outputs and fee.
Only after signing is the transaction broadcast. The Monitor checks that the inputs belong to the xpub and are finalized.

Design decisions

No database and no storage. The session lives in a Durable Object that discards everything when the last screen closes.
The xpub never appears in logs or URLs.
Cofre has an optional BIP39 passphrase field. Whoever loses that passphrase loses the wallet it defines.

Known limitations

Full rescan on each new session, with a gap limit of 50 addresses.
No monitoring with the page closed.
Mainnet only. No RBF.
The Electrum servers see the scripthashes you query.
No external audit yet. Security reviews are welcome.

Source (MIT): https://github.com/RaelAles/BTC
Live: https://btc.raelales.com

Questions and criticism are welcome. If you find a problem, please open an issue on GitHub.
ABCbits
Legendary
*
Offline

Activity: 3794
Merit: 10525



View Profile
November 23, 2026, 08:50:06 AM
 #2

With assumption you build it for your personal usage, i have these question. Why don't you just create and use watch-only wallet on Electrum wallet app? Is there any specific feature that doesn't exist or doesn't work well enough on Electrum wallet app?

Rael Ales (OP)
Newbie
*
Online Online

Activity: 3
Merit: 2


View Profile WWW
November 23, 2026, 10:48:02 AM
Merited by ABCbits (1)
 #3

Some features I like about it include:

Open-source and free.
No installer required.
No data persistence (no seed, mnemonic, xpriv, xpub, index, or anything else).
Aggregated UTXO lookup, independent of the BIP standard (84, 49, 44, or 86).
No IP exposure to the node (since it routes through a worker, the IP seen by the node is that of CloudFlare).
No xpub exposure (only scripthashes are shared with the node).
No RBF (intentional, to mitigate the risk of transaction reversal in the event of a compromised node—consider the recent case involving Electrum).
Signing is intentionally handled separately and offline (the "cofre-btc" tool acts as the key generator and PSBT signer).

This project was developed for personal use, but I’m sharing it in case it proves useful to others.
For those without easy access to dedicated electronic devices, it takes just five minutes—provided there is an internet connection—to check balances and execute transfers, all without leaving a trace.

All you need is a flash drive running Tails.
"Boot up, create the transaction, download the standalone 'cofre-btc' tool, go offline, sign the PSBT, close 'cofre-btc,' go back online, import the signed PSBT, broadcast the transaction, unplug the flash drive—and that’s it."

The separation of the wallet into two distinct programs is based on a threat model. The connected computer holds only the account’s xpub (BIP84 or BIP86), which allows for the derivation of addresses and balance tracking, but cannot authorize spending. It constructs a PSBT (BIP174)—containing the inputs, outputs, derivation paths, and the account fingerprint—and broadcasts the transaction once it has been signed. The seed and the xprv keys reside in a separate environment—a "BTC Vault" running on an offline instance of Tails. This environment only reads PSBTs (Partially Signed Bitcoin Transactions), verifies each input against the UTXO script, displays the destination, change, and fee, signs the transaction, and returns the file. An attacker who compromises the internet-connected computer might be able to see balances or attempt to initiate a transaction, but they cannot sign it; meanwhile, the offline review process ensures that the user can verify exactly what is being approved. In contrast, with native software that handles everything in a single process, the private keys and the network connection share the same memory space, leaving both vulnerable to system-level malware.

I am not a fan of the "complexity" of Electrum—though it is certainly useful—especially given a recent issue involving two confirmed cases of vulnerabilities where transactions were "sent back" to be re-signed.

I believe that the simpler and more direct a system is, the smaller its attack surface and the more robust it becomes. Consequently, I decided to build something as simple and straightforward as possible.
Freya Noemi
Newbie
*
Offline

Activity: 1
Merit: 0


View Profile
Today at 05:43:39 PM
 #4

Well done. Good to highlight limitations too. From looking at the README, I note that:

Alongside witness_utxo, Monitor (that part of the threat model that we don’t trust) also includes non_witness_utxo for each input. Does Cofre then also need the full non_witness_utxo for each SegWit v0 input, verify that txid matches the outpoint and independently confirm the value utilised for calculating fee? BIP174 details one such attack that can occur if just witness_utxo is analysed.  PSBT also includes BIP32 hints relating to outputs that are produced by the Monitor. Thus, Cofre should calculate what it expects the change address to be and then verify that the output script conforms to this (based on its seed).

With regards to ‘no RBF’. It is not immediately obvious what level of security this offers. Even if a transaction is replaced, new, valid transaction must still be created which consumes identical inputs. Unfortunately, bad actor does not have required signatures to independently create such a transaction. Moreover, full RBF has been default functionality in Core since 28.0. Consequently, non-signaling does not provide great protection against transaction replacement. Equally, potential to raise transaction fees by replacing them is forfeited. CPFP needs an output that can be consumed and is furthermore costlier. Which type of attack were you thinking about?

Transaction data is derived from Electrum only. There is no secondary source. Are confirmed transactions verified using Merkle proofs along with independently validated headers? Although Cofre stops a node siphoning off money, server may untruthfully fail to share information. Examples of this include hiding UTXOs and/or providing false transaction history.

To additionally avoid reusing change addresses, distinctive change indexes could be attributed to different outstanding PSBTs within same session.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!