the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets...

15
the future of hardware wallets [email protected] @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

Transcript of the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets...

Page 1: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

the future of hardware wallets

[email protected]

@StepanSnigirev

D419 C410 1E24 5B09 0D2C  46BF 8C3D 2C48 560E 81AC

Page 2: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

hardware wallets can :

spend funds

receive funds

multisig

user input spending output

user input user output

💩 do shitcoins

Page 3: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

hardware wallets could do :

CoinJoin

Lightning

sidechains

custom scripts

user input external output

external input user output

external outputexternal input

user input channel

channel unilateral moneyback

Page 4: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

Coin Join

register inputs with CoinJoin server

sign CoinJoin transaction

retry if someone fails

Page 5: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

attack with Coin Join

user input

attacker outputuser input

user output

external outputexternal input

Page 6: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

proof of (not) ownership

input

https://github.com/satoshilabs/slips/blob/slips-19-20-coinjoin-proofs/slip-0019.md

signature( proof body )

sign( UTI || proof_body, input_key )hmac( id_key, txid || vout )

can be wallet-specifichost may collect them for utxos

prevents DoS on CoinJoin serveronly wallet can sign

not replayable

Page 7: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

beyond P2WPKH

input witness( proof body )

hmac( id_key2, txid || vout )hmac( id_key1, txid || vout ) ||

https://github.com/satoshilabs/slips/blob/slips-19-20-coinjoin-proofs/slip-0019.md

0 signature1 signature2 witness_script

Page 8: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

challenges

https://github.com/satoshilabs/slips/blob/slips-19-20-coinjoin-proofs/slip-0019.md

requires script verification on HW

needs full previous transactions for signature verification

Schnorr and Taproot — fix-size proofs?

Page 9: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

Lightning

some keys need to be online

timelocks everywhere

monitor blockchain

Page 10: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

secrets in Lightning

on-chain keys

channel keys

revocation secrets

funding

commitment

+

mutual close

channel updates

+or

+or

+or

+or

Page 11: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

just storing secrets is not enough

Manual: - Open channel - Pay invoice

Automatic: - Remote open - Route payments - Close channel

Checks: - First commitment tx - HTLC propagation

Extensions: - Custom derivation path - Revocation calculation - Storage / encrypted DB

Operations: Extra functionality:

- Backup channel

- Blocks parsing- Real time clock

- Channel lock

Page 12: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

initial hardware wallet support

on-chain keys

channel keys

revocation secrets

funding

commitment

+

mutual close

channel updates

+or

+or

+or

+or

hardware walletno changes in hardware wallets

can steal funds with lightning payments

Page 13: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

initial hardware wallet support

Funding

Commitment

+

Mutual close

Channel updates

+or

+or

+or

+or

trusted node

our node

hardware wallet

Page 14: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

thanks ,,,^_^,,,

[email protected]

@StepanSnigirev

D419 C410 1E24 5B09 0D2C  46BF 8C3D 2C48 560E 81AC

Page 15: the future of hardware wallets - Breaking Bitcoin · the future of hardware wallets stepan@cryptoadvance.io @StepanSnigirev D419 C410 1E24 5B09 0D2C 46BF 8C3D 2C48 560E 81AC

Additional attack surface

MCU-based: - Side channels with automatic

signing

SE-based: - Parsing transactions on the

secure element

Manual: - Open channel - Pay invoice

Automatic: - Remote open - Route payments - Close channel

Checks: - First commitment tx - HTLC propagation - Channel lock

Extensions: - Custom derivation path - Revocation calculation - Storage / encrypted DB - Blocks parsing - Real time clock - Backup channel

Operations: Extra functionality:Increased attack surface: