What Holdfast protects against
Most crypto security assumes the thief never meets you. Holdfast assumes they might: that they have your phone, your PIN and you, standing right there.
Worst case, what a thief leaves with
- Robbed and forced to send
- The allowance
- Forced to open the app
- The allowance
- Phone stolen
- The allowance
- A guardian turns on you
- Nothing
- This website goes away
- Nothing
What happens when things go wrong
| If this happens | What they can take | What you do |
|---|---|---|
| You're robbed and forced to send | The allowance | Cancel the withdrawal from home, or have your guardian cancel it. Then freeze. |
| They make you open the app | The allowance | Type your duress PIN. The vault freezes quietly while the screen looks normal. |
| Your phone is stolen | The allowance, if they get past your lock | Freeze with your home code or guardian, then recover to a new phone. |
| You lose your phone | Nothing | On the real vault page, tap "Lost your phone? Use your home code" and enter your vault code and home code. Freeze fully, then recover with your home code and guardian. With no guardian, the home code alone recovers once the vault has been fully frozen for your normal wait. |
| You lose your home code | Nothing | If the vault isn't frozen, your phone can still withdraw with the normal wait: move everything into a new vault. If it is frozen when you lose the home code, the BCH stays locked. |
| A guardian turns on you | Nothing | They can freeze or cancel, but not send. Remove them with phone and home code. |
| This website goes away | Nothing | The contract keeps its rules on Bitcoin Cash. With your vault code, home code and wallet, run the open-source app from GitHub to cancel, freeze and recover. |
What it can't stop
Holdfast limits what a robber gains. It doesn't make you safe from them, and it can't help if they hold you for longer than your wait or find your home code too.
- Keep the home code somewhere a robber wouldn't reach in the same trip.
- Pick a guardian who won't be with you when it happens.
- If you're in danger, hand over the allowance. That's what it's for.
Money already sent out of the vault, including the allowance, is gone. Bitcoin Cash payments can't be reversed.
Proof so far
Before kickoff we tested the riskiest assumption: that Paytaca on a phone can sign the kind of contract transactions Holdfast needs. Each of these was signed in Paytaca over WizardConnect on chipnet, the Bitcoin Cash test network.
| Test | What it proves | Transaction |
|---|---|---|
| Create | The wallet can fund a contract that carries its own state | 8dbbb25b |
| Contract spend | The wallet can sign a spend that updates that state | 04108f18 |
| Wait | The same spend works when gated by a time lock | ecfaaecb |
| Withdraw | Money can come back out of the contract to the wallet | 682c878e |
| Two keys | One spend can need two signers, the base of guardian approval | bcc703ae |
Mainnet Contract version 2, Nov 21
A second real vault on the current contract. The page ran on one phone and Paytaca on another: on a single iPhone, signing requests stalled while Paytaca was in the background. The duress PIN then showed only the 0.00026 BCH allowance. This vault's 1-day wait ends after the deadline, so the release step is shown on version 1 below.
| Step | Transaction |
|---|---|
| Vault created from Paytaca over WizardConnect (0.003 BCH in) | ae9de6a9 |
| Phone spends within the allowance (0.0001); the fee also counts against the allowance | b6a713b4 |
| Phone starts a bigger withdrawal (0.001): it must wait 1 day | 5d0294b4 |
| Phone starts a second withdrawal (0.0005) | 14cdfb01 |
| Home code cancels the 0.0005 withdrawal, with no wallet involved | 0417c013 |
| Home code freezes the vault | d45548cc |
| Home code cancels the 0.001 withdrawal while frozen | 7ba6f392 |
| Home code unfreezes the vault; both fees came out of the allowance | 314e5fad |
Mainnet Contract version 1, Nov 16 and 17
The real vault, run on Bitcoin Cash mainnet on Nov 16 and 17 with Paytaca on one phone. These ran on contract version 1. A security review on Nov 19 found holes in it, which version 2 closes.
| Step | Transaction |
|---|---|
| Vault created from Paytaca over WizardConnect (0.003 BCH in, 0.0001 fee) | 5d4e7cac |
| Phone spends within the allowance (0.0001), signed in Paytaca | 1243b504 |
| Phone starts a bigger withdrawal (0.001): it must wait 1 day | af31478b |
| Phone starts a second withdrawal (0.0005), the one cancelled below | 08f8538e |
| Home code cancels a waiting withdrawal (0.0005) with no wallet involved | fdec605d |
| After the wait, the withdrawal is released (0.00098 to the recipient, 2,000 sat fee), no wallet signature needed | ba9ee1e9 |
| Home code freezes the vault | 4acd7c88 |
| Home code unfreezes the vault | 71d50061 |
| Duress PIN quietly freezes the vault while showing only the allowance | ad5c27ea |
| Home code unfreezes it again | 48f2f9e4 |
You can run the same tests yourself on the signing test page.
Still to do
The vault contract is written, with tests that include attempts to break it, but it hasn't had an outside audit. Until it has, treat Holdfast as an experiment and keep only small amounts in it.
How the contract works, and the attacks it's tested against: Under the hood.
The code is open: github.com/ohjay-official/holdfast. Found a problem? Open an issue there.