Charles Guillemet Profile picture
May 18 29 tweets 5 min read Twitter logo Read on Twitter
1/
I’ve read several misconceptions about how a wallet works. It seems some people thought there is some magic, let me explain how it works.

A thread 👇
2/ A hardware wallet is mostly used as a signing device.

Your private keys are central to everything, and hardware + firmware work hand in hand to protect it.

Let’s review some fundamental cryptography about all hardware wallets, not just Ledgers.
3/ Asymmetric cryptography.

Protocols such as #bitcoin and #ethereum use an algorithm called Elliptic Curve Digital Signature to essentially prove ownership over a public address.

It’s practically impossible to retrieve the private key knowing the public key (thus asymmetic)
4/
How does it apply to a hardware wallet?

When you set up your hardware wallet, the hardware wallet (In Ledger’s case, its Secure Element chip which uses hardware designed for security and randomness) randomly generates a very large number (256 bits).
5/
This number can be put into human readable form (24 words) using BIP-39 standard.
That is your Secret Recovery Phrase.

This is what you write down and should NEVER share with ANYONE, including Ledger.

Ledger does not have access to it, including if you use Ledger Recover.
6/
When you set up a crypto account, private keys are deterministically derived from the seed using the BIP32 standard.
Each blockchain has a different derivation path. From these private keys, it’s possible to compute the public keys and then the public addresses.
7/
The public addresses then leave the hardware wallet to receive funds for instance.

Your private keys must remain secret.

They are used to compute these digital signatures that are the cryptographic primitives for transactions, staking, smart contract interactions…
8/
A digital signature allows you to prove you own the private key corresponding to a public key without revealing it.

A hardware wallet gives more security guarantees since this computation occurs inside it, and it’s not exposed to potential malware on your computer.
9/
The firmware (in our case our Operating System) and hardware (the Secure Element in Ledger’s case) implement all the necessary functions to interact with blockchains, to secure your passwords, and to upgrade itself securely.
10/
It embeds a Ledger attestation that allows any device to prove it’s a genuine one. Thus it implements a lot of different signatures (compute and verify), encryption/decryption, hash… algorithms with various modes of operation.
11/
The blockchain ecosystem is moving fast - new protocols and features pop up everyday.

We would not be able to add Miniscript support for Bitcoin or BLS for Ethereum unless we could upgrade the firmware.
12/
Also, security is not static, it’s a never ending journey.

We are always raising the bar for security, sometimes fixing vulnerabilities. It’s important to be up-to-date.

It’s paramount for the firmware to be upgradable.
13/
Our OS is an open platform. Anyone can write their own app and load it on the device.

The apps are loaded on the OS and can leverage these cryptographic primitives for their needs. Most of our apps have been written by the community and are open source.
14/
But before being published on the “Ledger Manager”, they go through a security evaluation process.
15/
In order to provide some isolation, our model is the following:

- The OS has full access to the private key.
- The apps are locked on a list of given derivation paths according to their need
Ie. Bitcoin can only use Bitcoin keys, Ethereum can only use Ethereum keys.
16/
Whenever a private key is touched by the OS, the user is prompted and their consent is requested:
- When you “allow manager”, you allow the device to mount a SCP with Ledger Hardware Secure Module (HSM). The device proves it’s genuine. The HSM proves it’s Ledger’s HSM.
17/
- When you go through a transaction, you consent to “send xxx BTC to yyy address”. Then the Bitcoin app will request the OS to sign the corresponding transaction with your Bitcoin key.
18/
- If you want to use Ledger Recover, you’ll have to consent on your device for the backup or the recovery process
- It’s the same for staking, interacting with smart contracts, and encrypting data with the OpenPGP app…
19/
Using a wallet requires a minimal amount of trust. If your hypothesis is that your wallet provider is the attacker, you’re doomed.
20/
If the wallet wants to implement a backdoor, there are many ways to do it, in the random number generation, in the cryptographic library, in the hardware itself. It’s even possible to create signatures so that the private key can be retrieved only by monitoring the blockchain
21/
And open source doesn’t really solve this. It’s impossible to have guarantees that the electronic itself is not backdoored, nor that the firmware that runs inside the wallet is the one you audited.
22/
If you want to be completely trustless, you'll have to learn electronics to build your computer, learn ASM to build your compiler, then build a wallet stack, your own node and synchronizer, you'll have to learn cryptography to build your own signature stack.
23/
It’s a great journey, I partly went through this one 😅. But it’s a lifetime journey.
24/
We want to build a platform that provides strong guarantees about the code running on it from the supply chain to everyday's use and doesn't leak secrets when physically attacked.

Only a smartcard (Secure Element chip) can match those requirements
25/
But smartcards come with restrictive NDAs.

The chip datasheet isn't public, which means there will never be a fully Open Source firmware for a smartcard - however we can gradually go to a Raspberry Pi model, with most of the code open and a small binary blob for the rest.
26/
All our applications are already Open Source, which is quite unique for a smartcard.

Ledger has the largest 3rd party developers ecosystem. And we plan to publish more low level components: we already released part of the crypto lib library, and the dashboard will come next.
27/
TL;DR:

A hardware wallet is mostly used as a signing device

It generates and safeguards your private keys.

Your private keys never leave the hardware wallet. Whenever they are used, your consent is requested.
28/
You want to use Ledger Recover, your seed will be splitted into 3 shards and encrypted before being stored in shards backup providers.

All wallets need access to your seed/private keys in order to interact with blockchain protocols.
29/
Hardware wallets give a higher level of security since keys are not manipulated in plaintext in a non secure environment.

FIN.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Charles Guillemet

Charles Guillemet Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @P3b7_

May 16
Ledger Recover is our upcoming and optional service for users who want a secure backup of their Secret Recovery Phrase. Do you want to learn more about the onboarding process and specificities?

A thread 🧵
Let’s first clarify something key: Ledger Recover is a service that you can choose if you want to use it. There is no auto opt-in with firmware updates.
If you plan to subscribe to Ledger Recover through Ledger Live, you will have to create an account and go through an ID verification process.
Read 17 tweets
Sep 17, 2021
Fun fact about Taproot:

Taproot is a #bitcoin upgrade which will occur at block #709632, ie. in Nov 2021

It brings several new innovations and features but one of them is especially interesting: Schnorr Signatures.

Let me tell you the brief history of asymetric cryptography 🧵
Asymmetric cryptography is a process that uses a pair of keys: public / private key.

Its most interesting application is *Digital signature*. It's a process where you can prove you know your private key without revealing it while anyone with your public key can verify your proof
This is exactly what we do, when we "send" #bitcoin

Asymmetric cryptography has been publicly discovered by the famous Diffie, Hellman, and then Merkle in the 70s. Then, in the late 70s, Rivest Shamir and Adleman invented the famous RSA cryptosystem which is still widely used.
Read 9 tweets
Dec 15, 2020
On the threat model of @Ledger Nano and its ETH app when using DeFi.

Thread
[1/n] Image
Ledger Nano devices threat model is quite simple and could be summarized as follows:

1. Confidentiality of keys
2. Secure use with user consent
3. Genuineness check
4. Users' privacy

[2/n]
donjon.ledger.com/threat-model/
To ensure user consent, the device implements a Trusted Display. Only the info displayed on the device's screen can be trusted.

When you want to make an ETH transaction, you have to verify amount, recipient and fees on the device

[3/n] Image
Read 8 tweets
Nov 12, 2020
Thread #PLATYPUS

PLATYPUS is a novel side-channel attack targeting Intel x86 CPU (including AES-NI, SGX).
> platypusattack.com

I'm not surprised that we discover new attacks on Intel CPU, while I'm very surprised this attack has just been discovered now.

(1/n)
PLATYPUS is a Side Channel Attack allowing to _remotely_ extract secrets from Intel CPU incl. SGX enclave and AES-NI.
It uses the unprivileged access to RAPL (Running Average Power Limit) interface to get an internal measurement of the power consumption of the chip.

(2/n)
From an attacker PoV, this interface is great since it's unpriviledged and can be accessed remotely.

On the other side, it's quite low resolution, you can only get samples at 20kHz. This later limitation is overcome by several of techniques (cf paper).

(3/n)
Read 10 tweets
May 29, 2020
I've read several misconceptions about Common Criteria certifications. Typically:
- "Components producers pay for certification"
- "Certifications test only against a known set of predefined scenarios"
- "Certifications are not a replacement for independant review"

Thread👇
(2/n)
In a Common Criteria Certification process (for a circuit). There are 4 actors:
1. The sponsor (SP)
2. The chip manufacturer (CM)
3. The 3rd party evaluation lab (lab)
4. The Certification body (CB)
(3/n)
Often SP and CM is the same entity, but not always.

The lab is an independant security eval entity accredited by the CB. There's no commercial relationship between lab and the CB. Regularly, the CB audits the lab to verify its skills.

Labs can lose their accreditation.
Read 10 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(