Ask HN: How do you use Bitcoin in a trustless way?
85 points| JonathanBeuys | 3 years ago | reply
The following is what I got so far. I never used Bitcoin. So correct me, if something is wrong please.
1: Create a seed phrase with dices
2: Write it down on paper or carve it into metal
3: Buy a hardware wallet with no internet connectivity.
4: Never connect that wallet to any other device.
5: Type the seed phrase into the hardware wallet
6: The hardware wallet will display an extended public key
7: Install a software wallet on a computer with internet access
8: Type the extended public key into the software wallet
9: To do transactions: Create a transaction in the software wallet
10: The software wallet will show a hash of the transaction
11: Type that hash into the hardware wallet
12: The hardware wallet will show a signature
13: Type that signature into the software wallet
That's it.
As I understand it, there still is trust involved in steps 3 and steps 6:
3: There is not an easy way to check if the hardware wallet really has no internet connectivity.
6: There is no way to check if the hardware wallet really uses the seed phrase to create the extended public key. It could create an extended public key that the vendor can predict. One could test it a few times with throw-away seed phrases, but one would never be 100% sure.
[+] [-] globalreset|3 years ago|reply
8. You can usually export it more conveniently. 10-13 is overkill. Most wallets have some reasonable way to move txes between hardware wallet and online system (like SD card). They don't really compromise the practical security and are a much better UX.
3. checking if hardware really have no internet connectivity is indeed a thing. You could use Faraday Cage to be certain. Some wallets like ColdCard are translucent so you can inspect the components.
6. It is maximally secure to generate seed phrase manually using dices and paper lookup table. If you enter it into two wallets from two different vendors, you can see if they generate same addresses.
There's one attack you're missing: Hardware wallets could possibly slowly leak your private key by biasing bits in the signatures by grinding nonce. It would take whole lot of txes, but it is theoretically possible.
There's also possibility of someone just analyzing the electromagnetic waves during hw wallet signing txes to extra a key. Very very sophisticated and unlikely, but since we already have the tin foil hat on... just invest in Faraday Cage. :D
For maximum tin foil hat security, use multisig between two or more different devices (and/or parties), signing in different locations.
Edit: Oh. And since you're so into it it's worth mentioning that using seed passphrase is always a good idea!
[+] [-] redox99|3 years ago|reply
That's really cool. I had never thought of that.
All these points make me think that the best way is ditching the hardware wallet, and creating your own hardware wallet on a generic, airgapped PC where you write your own software (you always hear don't roll your own crypto, but in these case where you don't have to worry about side channel attacks, and you would do the random generation with dice, it should be fine).
In such case you're only relying on lets say, Intel, an airgapped generic Linux, GCC and maybe something else. But all these are things that would be extremely hard to modify in a way to affect your custom written software on an airgapped PC.
Plus the incentives to do some sophisticated but funny business on a commercial Hardware Wallet is quite high. While adding such sophisticated attack to GCC or Intel chips somehow would be extremely unlikely.
Add to this multisig with other methods, and the probability of some technical attack is so unlikely compared to a rubberhose attack, that it might as well be 0.
[+] [-] JonathanBeuys|3 years ago|reply
The "leak via grinding nonce" seems scary. That means signing a transaction is not a deterministic process? The same transaction can be signed in multiple ways?
[+] [-] operator-name|3 years ago|reply
This is actually a realistic failure mode - hardware wallets do fail even if rare.
[+] [-] TacticalCoder|3 years ago|reply
> 1: Create a seed phrase with dices
You can do that but you'll need a way to generate the checksum for the seed phrase. A 24 words BIP39 seed contains 264 bits (24 x 11 bits): 256 bits for the seed and 8 bits for the checksum.
> There is not an easy way to check if the hardware wallet really has no internet connectivity.
Indeed but you can at least open / disassemble some of them easily (there are even docs by the manufacturers explaining how to verify that the hardware wallet's PCB looks legit).
Seed exfiltration, even without connectivity, is an issue too.
And some hardware wallets are extremely noisy and impossible to use totally offline (there are mandatory firmware upgrades and mandatory connectivity needed to install the "apps" that allow to sign transactions), so you have to trust the vendor.
> There is no way to check if the hardware wallet really uses the seed phrase to create the extended public key.
Yes there is. Use an airgapped/offline computer which has physically no network connectivity options (no wifi / no ethernet / no bluetooth / no nothing), no HDD, booted from, say, a live Linux CD with contains for example Ian Coleman's BIP39 tools. Then you enter your seed and verify that the extended public key / keys derived is the same as the one shown by your hardware wallet. Data exfiltration from such a computer is still technically possible but I wouldn't worry too much about it: you power that computer for a few minutes, turn it off, and you'll be fine.
[+] [-] olalonde|3 years ago|reply
In theory, you could pick 23 words at random with 11 * 23 coin flips, every 11 flips representing an index in the dictionary. Now to find which 24th word passes the checksum, you could guess it in at most 2048 attempts on your hardware wallet :)
More realistically, it might be possible to develop a Ledger app that, given 23 words, finds the "checksum-passing" 24th word for you.
[+] [-] yencabulator|3 years ago|reply
I so wish there was a USB stick on the market where you can toggle read-only mode with a physical switch. (And where you had reasonable confidence that the firmware is hard to attack, I guess.)
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] rlt|3 years ago|reply
Of course it’s possible to exfiltrate data even without dedicated wireless hardware (TEMPEST etc) so I guess build a faraday cage if you’re really paranoid.
Also: https://glacierprotocol.org/
[+] [-] olalonde|3 years ago|reply
Hardware wallets like Ledger instead connect directly to a computer via USB to receive/transmit transactions to sign. They also transmit the extended public key to the wallet software so you don't have to type it manually. You have to trust the hardware wallet vendor to some degree.
Regarding, your comment on number 6, that's an interesting thought that I hadn't considered. Since you are not supposed to enter your seed on a computer, there really isn't any way to verify that the hardware wallet is really using the seed you provided and not some seed that can be predicted by the hardware manufacturer. I guess you could enter it on a hardware wallet from a different vendor, or on an air-gapped computer[0], and see if it matches.
[0] Make sure that the computer is never connected to the Internet again in case there was a key logger running and waiting for Internet connectivity.
[+] [-] JonathanBeuys|3 years ago|reply
I thought there are air gapped hardware wallets?
Without a keyboard, how do you enter your seed phrase?
Connecting the hardware wallet to the computer brings up a bunch of complex security questions.
[+] [-] larsrc|3 years ago|reply
[+] [-] JonathanBeuys|3 years ago|reply
If you think there is no way around trusting some party, then please name which party that would be. And why one cannot use Bitcoin without trusting them.
[+] [-] FatalLogic|3 years ago|reply
Or, for example, what if all your communications and actions are being monitored continuously by state-level actors with cameras and hidden bugs, recording every keystroke? Or what if we are living in a simulation, and the malicious operators can extract data from your brain, or just alter reality at will?
But I think you can provide a "practical" level of trustless. That means that, if your adversary was powerful enough to steal your Bitcoins, then they'd be so powerful that they could destroy you in many other ways. So it's a moot point.
A practical solution to your question could be to take all the precautions you've said above, and then simply gradually increase the amounts you are transacting, using a variety of methods, and see if anything gets stolen.
Call it a bribe or a bug bounty or a tax. It's quite effective, because organizations are comprised of individuals, who are subject to human temptations. At least two federal agents independently stole funds from the Silk Road marketplace while investigating it, and they were imprisoned later
[+] [-] JonathanBeuys|3 years ago|reply
Say an attacker compromised a certain batch of Ledger wallets.
They might very well wait for a few years before they reap coins of the wallets. Because as soon as they do it for the first time, there will be an uproar and people will analyze whats up and transfer their funds to other wallets.
[+] [-] strbean|3 years ago|reply
[0]: using a lead acid battery so you can disassemble it and verify it isn't bugged.
[+] [-] thfuran|3 years ago|reply
[+] [-] joosters|3 years ago|reply
a) Buy it on an exchange: You need to trust that the exchange won't just run off with/sell your real money/credit card details (but at least in the real world you have a chance of clawing back stolen cash)
b) Buy it via a service like localbitcoins, where you meet a stranger in an alley and hand them hard cash. Not very trustless!
c) Mine the coins yourself. But unless you build a bitcoin miner from scratch, you need to trust the hardware and software (how do you know for sure that it isn't mining to someone else's account?) And your miner needs to be connected to the internet, so hackers could get your coins.
There are no good trustless options. You have to accept some risk.
EDIT: I missed the only tried and true trustless way to get bitcoins:
d) Hack/phish/con someone else out of their bitcoins!
[+] [-] runeks|3 years ago|reply
[+] [-] TacticalCoder|3 years ago|reply
You're missing an easy and obvious option.
You plan to buy 10 Bitcoin (not saying it's a good idea): you wire tx enough to buy one on Gemini or Coinbase (or whatever exchange fits you), wait for the tx to clear, buy one Bitcoin, move it to your hardware wallet. Rinse and repeat 9 more times.
At any one time you're never exposed to more than 1/10th of the amount you planned to buy.
I think a lot of highly speculative investors but still cautious people proceeded that way.
There are even sites tracking the Bitcoin and Ethereum and whatnots addresses accumulating coins on a regular basis.
[+] [-] Geee|3 years ago|reply
[+] [-] 8organicbits|3 years ago|reply
With typical currencies, you can exchange at a currency exchange counter at the border/airport or use your bank/credit card which handles the conversion behind the scenes. I suppose the equivalent for bitcoin is a bitcoin ATM or bitcoin credit card.
[+] [-] JonathanBeuys|3 years ago|reply
[+] [-] teawrecks|3 years ago|reply
Either way, trust of everything outside of owning your coins is irrelevant to the exercise. If you're going to play devil's advocate, you need to come up with relevant counter examples.
[+] [-] pjc50|3 years ago|reply
[+] [-] Yeahsureok|3 years ago|reply
[+] [-] runeks|3 years ago|reply
[+] [-] chromatin|3 years ago|reply
[+] [-] lrvick|3 years ago|reply
[+] [-] lfpeb8b45ez|3 years ago|reply
[+] [-] Peleus|3 years ago|reply
There will always be an infinitely recursive list of trust issues or potential attack vectors, they will just become less and less likely.
What if the hardware wallet is backdoored? Use a Faraday cage. What if both the hardware wallet and Faraday cage is compromised? etc.
[+] [-] mightybyte|3 years ago|reply
[+] [-] ALittleLight|3 years ago|reply
[+] [-] Geee|3 years ago|reply
3: You measure RF signals to verify that there's no wireless connection of any kind.
6: You can verify the public key by using multiple devices from different vendors with the same seed.
Practically speaking, you don't need to verify everything yourself. It's guaranteed that any information about attacks will be quickly available, if someone is able to verify everything.
[+] [-] andreskytt|3 years ago|reply
[+] [-] unknown|3 years ago|reply
[deleted]
[+] [-] _ink_|3 years ago|reply
There is no good solution.
You can specify multiple recipients, so you could send the leftover back to your secure wallet. But reusing adresses after a transaction is considered insecure (I don't know why).
Or you have a second secure hardware wallet, that can receive the leftover.
[+] [-] pcdoodle|3 years ago|reply
[+] [-] shaicoleman|3 years ago|reply
There are various solutions for that, e.g. multi-sig, Shamir's Secret Sharing, etc.
[+] [-] unknown|3 years ago|reply
[deleted]