Holdfast

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 happensWhat they can takeWhat you do
You're robbed and forced to sendThe allowanceCancel the withdrawal from home, or have your guardian cancel it. Then freeze.
They make you open the appThe allowanceType your duress PIN. The vault freezes quietly while the screen looks normal.
Your phone is stolenThe allowance, if they get past your lockFreeze with your home code or guardian, then recover to a new phone.
You lose your phoneNothingOn 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 codeNothingIf 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 youNothingThey can freeze or cancel, but not send. Remove them with phone and home code.
This website goes awayNothingThe 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.

TestWhat it provesTransaction
CreateThe wallet can fund a contract that carries its own state8dbbb25b
Contract spendThe wallet can sign a spend that updates that state04108f18
WaitThe same spend works when gated by a time lockecfaaecb
WithdrawMoney can come back out of the contract to the wallet682c878e
Two keysOne spend can need two signers, the base of guardian approvalbcc703ae

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.

StepTransaction
Vault created from Paytaca over WizardConnect (0.003 BCH in)ae9de6a9
Phone spends within the allowance (0.0001); the fee also counts against the allowanceb6a713b4
Phone starts a bigger withdrawal (0.001): it must wait 1 day5d0294b4
Phone starts a second withdrawal (0.0005)14cdfb01
Home code cancels the 0.0005 withdrawal, with no wallet involved0417c013
Home code freezes the vaultd45548cc
Home code cancels the 0.001 withdrawal while frozen7ba6f392
Home code unfreezes the vault; both fees came out of the allowance314e5fad

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.

StepTransaction
Vault created from Paytaca over WizardConnect (0.003 BCH in, 0.0001 fee)5d4e7cac
Phone spends within the allowance (0.0001), signed in Paytaca1243b504
Phone starts a bigger withdrawal (0.001): it must wait 1 dayaf31478b
Phone starts a second withdrawal (0.0005), the one cancelled below08f8538e
Home code cancels a waiting withdrawal (0.0005) with no wallet involvedfdec605d
After the wait, the withdrawal is released (0.00098 to the recipient, 2,000 sat fee), no wallet signature neededba9ee1e9
Home code freezes the vault4acd7c88
Home code unfreezes the vault71d50061
Duress PIN quietly freezes the vault while showing only the allowancead5c27ea
Home code unfreezes it again48f2f9e4

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.