Professional ยท 09 Who the wallet trusts for its view of the chain
Servers explained.
A wallet server is a computer that keeps the whole Bitcoin blockchain indexed and answers a phone's questions about it. The phone asks which payments touched its addresses and hands over transactions to send. The server learns every address it is asked about and can hide or invent payments, but it never holds a key, so it cannot sign or move coins.
01 The problem
A phone cannot hold the whole blockchain, so the wallet asks a server about it
The Bitcoin blockchain is every transaction since 2009, hundreds of gigabytes of it, and it grows by a block about every ten minutes. A full node downloads all of it and checks every rule itself. A phone has neither the disk nor the battery for that.
So the wallet does what nearly every phone wallet does: it asks a server that has done the work. With the Basic setup, OnlyBits savings syncs through mempool.space, a public server. You can switch to an Esplora server you run yourself; this page covers what that gains and what it costs.
What you see: the Basic setup says "Real bitcoin on mainnet. The wallet syncs through mempool.space and the spending account uses ACINQ, the provider behind Phoenix."
What it hides: the protocol the server speaks, the list of fallback servers, and the fact that a different server can be set under Advanced.
Look underneath
The server type is Esplora, the HTTP API first written by Blockstream and also served by mempool.space's backend. It sits on top of a Bitcoin Core node and adds an index from each output script to the transactions that touch it, which Core does not keep.
The wallet side is BDK (bdk_wallet 3.2 with bdk_esplora 0.22). The URL is a plain base such as https://mempool.space/api; the app checks only that it starts with http:// or https:// and has no spaces.
Why not a light client
The other phone-sized option is a light client that downloads block headers and compact block filters (BIP157/158) and decides for itself which blocks to fetch. OnlyBits does not do this today. It trusts the server's answers, which is why the server's power to lie gets two beats of its own below.
02 The questions
The wallet asks a server about address histories, unspent coins, fees and broadcasts
Almost everything the savings screen shows is an answer from the server. There are four kinds of question behind it.
The first is history: for each of the wallet's addresses, which transactions paid to it or spent from it. From those histories the wallet works out the second, its unspent coins, which are what the balance is made of. The third is fees: how many sats per virtual byte it takes to get into a block soon. The fourth is not a question at all. To pay someone, the phone signs the transaction itself and gives it to the server to pass on to the network.
What you see: "Syncing. The first sync scans the whole wallet." and fee choices labelled Fast, Normal and Slow.
What it hides: the per-address requests, the scan that stops after 20 unused addresses, and the mapping from Fast, Normal and Slow to the server's 2, 6 and 144-block estimates.
Look underneath
The Esplora calls behind each question
GET /scripthash/:hash/txs # history of one output script GET /tx/:txid # a transaction, raw GET /tx/:txid/outspend/:vout # is this output spent, and by what GET /fee-estimates # {"2": 12.1, "6": 8.4, "144": 2.0, ...} GET /blocks/tip/height # chain tip GET /block/:hash # incl. mediantime, used by locks POST /tx # broadcast, body is raw hex
The :hash is the SHA-256 of the output script, byte-reversed, so the server sees exactly which script is being asked about.
Scanning
- The first sync after the app opens is a full scan of the receive and change keychains with a stop gap of 20: it walks addresses until 20 in a row have no history. Up to 16 requests run in parallel.
- Later syncs ask only about addresses already revealed. Chain state is cached encrypted on the phone so the balance shows before the scan finishes.
- Unspent coins are derived from the histories: an output paying one of the wallet's scripts that no known transaction spends.
Fees
Fast, Normal and Slow take the estimate for the closest target at or below 2, 6 and 144 blocks. A server that returns no estimates is skipped for the next one. Regtest is fixed at 1 sat/vB. Any rate above 1,000 sat/vB is refused.
03 What it learns
A server learns every address the wallet asks about and can link them to one person
To answer "what happened at this address", the server has to be told the address. A wallet with forty addresses asks about forty addresses, from one connection, within a few seconds.
That is enough for the server to group them: these forty belong to one wallet. Fresh addresses for every payment, which OnlyBits hands out by default, protect you from strangers reading the blockchain. They do not protect you from the server, because the wallet asks about all of them together. The server also sees the internet address the phone connects from, which usually points to a home or a mobile carrier, and it sees each broadcast transaction before anyone else does.
On the chain, the wallet's addresses sit apart. Someone reading the blockchain sees no link between them.
To sync, the phone asks the server about every one of them, from one connection, within a few seconds.
That is enough for the server to group them: these addresses belong to one wallet.
It also sees the internet address the phone connects from, and each transaction the phone broadcasts, before anyone else does.
What you see: a new address on every Receive, and "Their phone gives a fresh address for every payment." for contacts.
What it hides: that every one of those addresses is reported to whichever server answers the next sync.
Look underneath
- Address clustering. Requests arrive over the same HTTP connection pool, close together, for script hashes derived from one xpub. Even without the xpub, the timing and source address are enough to cluster them.
- Gap addresses. The full scan asks about 20 addresses past the last used one, so the server also learns addresses not handed out yet.
- Broadcast origin.
POST /txfrom the phone's IP is a strong hint that its owner authored the transaction, which ordinary peer-to-peer relay tries hard to hide. - Shared wallet. Every co-signer's phone asks its own server about the one shared address, so each of their servers learns it.
Nothing here is specific to Esplora. Electrum servers learn the same things. Only a full node that scans blocks locally, or a filter-based light client, avoids telling someone else which scripts matter.
04 What it cannot do
A server never sees a key, so it cannot sign a transaction or move a coin
Spending a bitcoin needs a signature from the key that locks it. The wallet's keys are made from the recovery phrase on the phone and never leave it.
The server gets the finished transaction, already signed. If it changed one byte, say the address being paid, the signature would no longer match and every node on the network would reject it. So the worst a server can do with a payment it is handed is fail to send it. It cannot redirect it, raise its fee or spend other coins, and that holds for a public server, for your own server, and for one that has been hacked.
The phone signs the payment with a key that never leaves it. The signature covers the whole transaction.
The phone hands the signed transaction to the server to pass on to the network.
Suppose the server changes one byte, say the address being paid. The signature no longer matches.
Every node on the network checks the signature, so the edited transaction is rejected.
The only version the network accepts is the one the phone signed. The server can pass it on or fail to send it, nothing else.
What you see: the confirm line "Pay X to Y. Network fee Z, total T." before anything is sent.
What it hides: signing happens on the phone with keys derived from the seed; only the signed transaction is ever given to a server.
Look underneath
Savings outputs are Taproot (BIP86, tr([fp/86'/coin'/0']xpub/0/*)). A key-path spend carries one 64-byte Schnorr signature over the BIP341 sighash, which commits to every input's outpoint, amount and script, every output, the version and the lock time. Changing any of those invalidates the signature.
What the server never receives: the seed, any private key, the xpub. It receives script hashes (as requests) and signed raw transactions.
Broadcast
Broadcast is not raced. The app hands the transaction to each server in turn, starting with the one that answered last, until one accepts it or reports it already known. If any server could not be reached, the result is "may have gone out": the wallet counts the coins as spent and resending is safe, because it resends the identical transaction.
05 What it can fake
A server can hide transactions, misstate balances and fees, and quietly drop a broadcast
Every read in beat 02 is the server's word. OnlyBits does not check that word against the chain's own proof of work.
A server can leave a payment out of an address history, and the wallet shows a smaller balance. It can claim a coin is still unspent, or already spent. It can report fee rates far too high, so you overpay, or far too low, so a payment sits unconfirmed. It can accept a broadcast and never pass it on. And because the app does not verify block headers, a server can also describe a payment that never happened and call it confirmed. None of that moves a coin on the real chain, but all of it changes what you believe and do next.
What you see: balances, "Arriving" rows and confirmation counts, all shown with the same confidence whichever server supplied them.
What it hides: the app has no indicator of which server answered, and no cross-check between servers.
Look underneath
What the app does check
- A fetched transaction must hash to the txid that was asked for (
tx.compute_txid() == txid). A server cannot substitute different contents for a known txid. - A server with no fee estimates is skipped. Fee rates above 1,000 sat/vB are refused.
- Broadcast falls through to the next server when one rejects or fails.
What it does not check
- No block header chain, no proof-of-work check, no Merkle inclusion proof. "Confirmed in block N" is the server's claim.
- No comparison of histories between servers. The first answer wins.
- No check that a broadcast reached any other node.
With headers and Merkle proofs a server could still hide things (you cannot prove an absence), but it could no longer invent a confirmed payment without mining a block. That is the gap between this design and SPV.
06 The default list
With a default server the wallet races a list of public servers and keeps the fastest
A single public server can be down, slow, or blocked on someone's network. So with the default, the app does not depend on any one of them.
It asks the server that answered last time. If no answer comes within 2 seconds, the next server on the list joins the race, then the next, every 2 seconds, until one answers. The first answer wins and the winner is asked first next time. If the winner is not the first server on the list, the first gets another try after 5 minutes. On mainnet, a build of the app can also carry a relay run by the OnlyBits developer, which goes ahead of every public server and reaches its own Esplora node over iroh, the peer-to-peer network the app uses for contacts.
The wallet asks the server that answered last time. Here that is the relay, and it stalls.
After 2 seconds with no answer, the next server on the list, mempool.space, joins the race.
2 seconds later there is still no answer, so blockstream.info joins too.
mempool.space answers first. Its answer is used and the other requests are dropped.
Next time the winner is asked first. Because it is not first on the list, the first server gets another try after 5 minutes.
What you see: one URL under Settings, Advanced, "Server".
What it hides: the five other public servers behind that URL, the race between them, and the developer's relay in front of them on mainnet.
Look underneath
The public lists (src/network.rs)
Mainnet mempool.space, blockstream.info, mempool.bitaroo.net,
mempool.bullbitcoin.com, mempool.cakewallet.com, mempool.emzy.de
Testnet4 mempool.space/testnet4, mempool.emzy.de/testnet4
Signet mempool.space/signet, blockstream.info/signet, mempool.emzy.de/signet
Regtest (none)
Order for a public URL: relay (if set for that network), then the chosen URL, then the rest of that network's list.
The race (src/chain.rs, ask_each)
- The preferred server starts alone. Every
RACE_STAGGER(2 s) without an answer, or as soon as every running request has failed, the next server joins. - An empty answer (for example no fee estimates, or an unknown txid) counts as a failure and keeps the race going.
- The first good answer wins; the others are dropped.
RETRY_FIRST(5 min) after the preference moved off server 0, server 0 is tried first again. - Request timeout 30 s, connect timeout 10 s.
The relay
On Android, setEsploraRelay is called for mainnet only, with an iroh endpoint ID baked into the build. The phone opens a loopback HTTP proxy and pipes each connection as an iroh stream (ALPN onlybits/esplora/1) to the developer's backend, which pipes it to one upstream Esplora server. The relay does not parse requests, but the upstream server it reaches sees them like any other. After a relay failure, connections fail at once for 30 s so the sync moves on to the public servers.
The Lightning node (ldk-node) takes one Esplora URL: the first server from this same list that answers at start.
07 Your own server
A server you set yourself is asked alone, so your addresses reach nobody else
To use your own Bitcoin Core node with an Esplora index, open Settings, then Advanced, tap Change server, and paste its URL.
From then on the wallet asks that one server and no other. There is no race and no fallback list, and the relay is skipped too. The rule is deliberate: a public server on the fallback list would learn your addresses the first time your server was slow, which defeats the reason for setting it. The wallet then scans again from the start against your server, so the balance is built from your own node's copy of the chain. The price is that when your server is off, the wallet cannot sync or send.
What you see: "Any Esplora server for Mainnet works, including your own. The wallet scans again after a change." with a "Use default" button to go back.
What it hides: that the switch also removes every fallback, and that the Lightning node now uses the same single server.
On mainnet the spending account normally runs on ACINQ's engine, and that engine watches the chain through ACINQ's own Electrum server, whatever you set here. It needs Electrum and asks it about the swap-in address it uses to move money into your channel. Savings addresses are not part of that conversation, but ACINQ already sees the channel, so this is one party seeing more of what it already knows.
Look underneath
// src/network.rs, esplora_servers() if !public.contains(&url.as_str()) { return vec![url.clone()]; // asked alone: no relay, no fallback }
"Not public" means not byte-for-byte one of that network's default URLs after trimming a trailing slash. A mirror of mempool.space at a different URL counts as your own.
Running it
- The server must speak the Esplora HTTP API: Blockstream's
electrs(esplora branch) or the mempool.space backend, each running beside a Bitcoin Core node and keeping its own address index. - The app accepts
http://andhttps://. Plain HTTP over the open internet shows every request to the network path, so put it on a home network, a VPN, or behind TLS. - After a change the app reopens the wallet, which runs a full scan (stop gap 20) against the new server.
ACINQ
lightning-kmp connects to electrum.acinq.co:50002 over TLS. Its Electrum watcher follows the swap-in wallet and channel funding outputs. ACINQ co-signs every swap-in, so it already knows those outputs. The ldk-node engine (other providers) uses your Esplora server instead.
08 Networks
Each wallet lives on one of four networks, and only mainnet coins have value
The same software runs four separate Bitcoin networks. A server serves one of them, and a wallet is created on one of them.
Mainnet is real bitcoin. Testnet4 and Signet are public test networks whose coins are given away for free by faucets and are worth nothing, so they are the place to try a payment flow without risk. Regtest is a private network on one computer, where the person running it mines blocks on demand; there is no public server for it, so it needs your own. A mainnet wallet needs a mainnet server. A Signet server would answer, and every answer would be about the wrong chain.
What you see: under Advanced setup, "Choose the network. Signet and Testnet4 use test coins with no value." and, for Regtest, "Regtest needs your own Esplora server." Mainnet needs the "I understand" tick.
What it hides: the coin type in every derivation path, and that the network cannot be changed later; a different network means a new wallet.
Look underneath
WalletNetwork:Bitcoin,Testnet4,Signet,Regtest. The UI labels the first "Mainnet".- BIP44-style coin type is 0 on mainnet and 1 on all three test networks, so the same phrase gives the same test addresses on Testnet4, Signet and Regtest, and different ones on mainnet.
- Pasted addresses are checked against the wallet's network; a
tb1address is refused by a mainnet wallet. - Lightning is refused on Testnet4 (an ldk-node limitation). ACINQ is mainnet only. The trade account runs on mainnet and Signet only.
09 Co-signers
In a shared wallet each signer checks a payment against their own server before signing
Alice and Bob share a 2-of-2 wallet. A payment needs both of their signatures, and each signs on their own phone.
When Alice proposes a payment, Bob's phone does not take her word for which coins it spends. It asks Bob's own server for each coin the payment uses, checks that the coin really belongs to the shared wallet and has not been spent elsewhere, and works out the fee from those answers. If Alice uses her own server and Bob uses mempool.space, a liar would have to control both servers to fool both of them.
Alice and Bob share a 2-of-2 wallet. Alice's phone uses her own Esplora server, Bob's uses mempool.space.
Alice proposes a payment, built from her server's answers. It lists the coins it spends and the outputs.
The proposal goes to Bob's phone.
Bob's phone does not take her word for the coins. It asks Bob's own server about each one.
From those answers it checks that each coin belongs to the shared wallet and is not spent elsewhere, and works out the fee.
To fool both phones, a liar would have to control both servers.
What you see: "Needs your approval", the amount, the destination and the fee, then "Approve".
What it hides: the lookups of every input on the signer's own server, and the checks run before the Approve button does anything.
Look underneath
Checks before signing (src/taproot.rs)
- For each input, fetch the parent transaction from the signer's server; its txid must match. The referenced output must pay the shared wallet's script, or the proposal is refused with
ForeignInput. - Ask the server whether that output is already spent by a different transaction; if so,
AlreadySpent. - Exactly one payment output, at most one change output back to the shared address.
- Fee no more than 1,000 sat/vB. A "high fee" flag when the rate is above 20 sat/vB and above twice the signer's own server's fast estimate.
- No relative lock times, no absolute lock time beyond tip + 2. At most 100 inputs.
Only after every signer has approved do the MuSig2 rounds run live over iroh.
10 A hidden payment
A lying server can hide an incoming payment, and the money stays safe on chain
Bob pays Alice 50,000 sats and the payment is mined. Suppose the server Alice's phone asks leaves it out of her address history.
Alice's balance does not move, while Bob's phone shows the payment sent and confirmed. Payer and payee now disagree about whether it happened, which can lead to paying twice. The coins themselves are fine: they sit at her address on the real chain, and they appear as soon as her phone asks an honest server or her own node. A hiding server can delay what the payee sees. It cannot take the coins.
Bob pays Alice 50,000 sats.
The payment is mined. Bob's phone shows it sent and confirmed.
Alice's phone asks a server that leaves the payment out of her address history. Her balance does not move.
Payer and payee now disagree about whether the payment happened, which can lead to paying twice.
The coins sit at her address on the real chain. They appear as soon as her phone asks an honest server or her own node.
A server can show a payment that never happened. Because OnlyBits does not check block headers or Merkle proofs, a malicious server can invent a transaction paying Alice and report it with six confirmations. If the payee hands over goods for it, the goods are lost; the coins will never be spendable. Against your own server this needs your node to be compromised; against a public server it needs that operator to be malicious and to win the race. There is no in-app mitigation today beyond checking a large payment on a second server.
What you see: "Arriving" for unconfirmed coins from others, then "1 confirmation" up to "Confirmed".
What it hides: every one of those states comes from the server, with no proof attached.
Look underneath
Hiding is unprovable from the client side: a server returning [] for /scripthash/:hash/txs looks the same as an unused address. The wallet's defence against hiding is fallbacks, and only for failures, not for lies: a server that answers wrongly but quickly wins the race.
For an invented payment, the fake transaction can have any inputs, since nothing checks they exist. The confirmation count is tip_height - block_height + 1 from heights the same server reports.
Practical checks: open the transaction on a block explorer run by someone other than your server, or compare against a full node you control. On your own server, the node behind it validated every block itself, which is the strongest answer to both attacks.
11 A fake input
A server that feeds a co-signer a fake input gets a signature that cannot move real coins
Suppose Alice tries to trick her co-signer Bob. She proposes a payment that claims to spend a large coin of the shared wallet, and she controls the server Bob's phone asks.
The server can tell Bob's phone that the coin exists and is unspent. It cannot change what the coin is: a transaction is identified by the hash of its contents, so Bob's phone rejects any parent that does not hash to the id in the proposal. And Bob's signature covers the amount and script of every coin being spent, so if the server lied about those, the signature would not fit the real coin. The most the trick achieves is a signature for a transaction the network will refuse. What it can still do is narrower: report fee rates so high that a costly fee does not raise Bob's high-fee warning.
Alice proposes a payment that claims to spend a large coin of the shared wallet. She also controls the server Bob's phone asks.
Bob's phone asks that server for the coin's parent transaction. The server can send anything.
The phone hashes what it got and compares the result with the txid named in the proposal.
Changed contents give a different hash, and the proposal is refused. Lying about the amount does not help either: Bob's signature covers it, so the signature would not fit the real coin.
An invented parent that was never mined still has a matching txid, so Bob signs. The payment spends a coin that does not exist, and the network refuses it.
What you see: the review on Bob's phone with amount, destination and fee, and a warning when the fee looks high.
What it hides: the per-input lookups on Bob's server, and that the high-fee warning is measured against that same server's fee estimate.
Look underneath
- Substituted contents.
Chain::transactionkeeps an answer only iftx.compute_txid() == txid. A second-preimage on SHA-256d is not available to anyone. - Lied amounts. BIP341 sighash includes
sha_amountsandsha_scriptpubkeysof all inputs. A MuSig2 signature made over wrong amounts is invalid for the real transaction. - Invented parent. A parent transaction that was never mined still has a txid, and the server can claim it is unspent. The resulting signature is for a transaction with a missing input, which no node accepts. It cannot be replayed on another transaction, because the sighash commits to all outpoints and outputs.
- Spent-or-not. A server saying a real coin is spent makes Bob refuse (
AlreadySpent), a denial of service. Saying a spent coin is unspent leads to a double-spend the network rejects. - Fee warning. The fee itself is computed from authenticated prevouts and is shown in sats. Only the "high fee" flag depends on the server's fast estimate, and it is capped by the hard 1,000 sat/vB limit regardless.
12 The bill
Running a node costs disk, time and upkeep, and public servers cost privacy
Switching to your own server is a trade with two sides.
Your own server costs hundreds of gigabytes of disk for the chain plus an address index on top, a first sync that can take days on modest hardware, a machine left on, and a way for the phone to reach it from outside the house. When that machine is off, the wallet cannot see new payments or send. It also does not undo the past: public servers used before the switch already saw the wallet's addresses, and those addresses are still yours. The other side is the default: it works with no setup and keeps working when a server fails, and in exchange mempool.space, five other operators and the OnlyBits relay can each see every address in the wallet and the IP it came from.
What you see: the Advanced setup line "The wallet syncs through an Esplora server. You can use your own."
What it hides: the setup choice does not mention that the default list shares your addresses with several operators, or that a custom server has no fallback.
Look underneath
What did not get traded away
In both columns the keys stay on the phone, every payment is signed there, and no server can redirect or spend a coin. The choice of server is a choice about privacy and about whose copy of the chain you believe, not about custody. That is a better deal than any custodial wallet offers, and a worse one than a full node in your pocket, which no phone has the room for.
What would narrow the gap
- Header verification with Merkle proofs would stop invented payments, though not hidden ones.
- Compact block filters (BIP157/158) would stop the server learning which addresses matter, at the cost of downloading filters and some blocks.
- Neither is in OnlyBits as of October 2026.
Summary
A server sees everything and signs nothing
- The server
- An Esplora index over a full node that answers address, coin and fee questions and passes transactions on.
- The leak
- Every address the wallet asks about, grouped into one wallet, plus the phone's IP.
- The limit
- Signatures cover every byte of a transaction, so a server can drop a payment but never change or forge one.
- The lie
- Without header checks a server can hide a payment, invent one, or misstate fees, and the app takes its word.
- The race
- With defaults, a new public server joins every 2 seconds until one answers, and the winner is asked first next time.
- Your own
- A custom URL is asked alone, with no relay and no fallback, so nobody else sees the addresses.
- The bill
- A node costs disk, days and uptime; the defaults cost privacy to several operators.
Checked against the OnlyBits source as of October 2026: src/network.rs for the server lists and the asked-alone rule, src/chain.rs for racing, broadcast and the txid check, esplora/ and backend/ for the relay, src/taproot.rs for co-signer checks, and the Android screens for every quoted line. Where a comment and the code disagreed, the code won. The 2-second stagger, 5-minute retry, stop gap of 20 and 1,000 sat/vB cap are exact. The 50,000-sat payment, the addresses, the balance and the race timings in the figures are illustrative, and "hundreds of gigabytes" and "days" for a node are rough on purpose. The public server list is the detail that will age first, followed by the relay, which only some builds carry. Read Shared wallets explained first if the co-signer beats are unfamiliar, and The trade account explained next for the one part of the app where someone else does hold the coins.