# Ledger Wallet 真的安全嗎？

By [CompoundWater 複水](https://paragraph.com/@compoundwater) · 2023-08-03

---

> \*\*作者：[CompoundWater 複水](https://compoundwater.framer.website/) ; Contents May Also Contribute to [MatrixDAO](https://matrixdaoresearch.xyz/)本篇主整理來自 MatrixDAO GM 的週分享內容 。  
> URL: \*\*
> 
> [![]({{DOMAIN}}/editor/youtube/play.png)](https://www.youtube.com/watch?v=GwUQNvX4x38)

`Contents`

*   `Intro`
    
*   `首先 Ledger 的架構如何運行?`
    
*   `為什麼 Ledger 需要 Firmware Update?`
    
*   `Firmware 韌體如何更新？`
    
*   `哪種情況下 Ledger 是可信任的?`
    
*   `大家以為 Ledger 安全元件是用特殊應用 ASIC 晶片，實際上可能是微控制器`
    
*   `Conclusion`
    

### Intro

近期 Ledger 推出新服務——Ledger Recover。一個基於ID的密鑰恢復訂閱的方案。此功能將用戶的助記詞分割成三個加密片段，由不同實體保存。

看似乎提供了額外的安全性，但該功能發布後引發不少用戶對隱私和安全的擔憂，尤其是涉及到存儲私鑰助記詞並與護照或 ID 證件相關聯等操作，顯然違背了加密社區的隱私價值觀與去中心化。

[https://www.odaily.news/post/5187141](https://www.odaily.news/post/5187141)

### 首先 Ledger 的架構如何運行?

[https://developers.ledger.com/docs/embedded-app/bolos-hardware-architecture/](https://developers.ledger.com/docs/embedded-app/bolos-hardware-architecture/)

根據官網，Ledger 的架構如下，外圍與許多不同的設備連接，例如屏幕、按鈕、通過 USB 連接的主機，或 Ledger 的藍牙和 NFC。

且額外的 STM32 微控制器（MCU）連接到[安全元件（SE）](https://www.st.com/en/secure-mcus/st31-arm-sc000.html)，作為安全元件和外圍設備之間的“啞路由器”。微控制器不執行任何應用程序邏輯，也不存儲 BOLOS 使用的任何加密秘密，它只是管理外圍設備並在準備好接收新數據時通知安全元件。BOLOS 應用程序完全在安全元件上執行。

![A detailed BOLOS architecture diagram](https://storage.googleapis.com/papyrus_images/794ef23eeee3affa6530d2d057b5c83ca04298148d4307de4a3ca731b4933c96.png)

A detailed BOLOS architecture diagram

**安全元件 (Secure Element, SE）**

*   用於存儲 BIP-32 種子和密碼 (Stores BIP-32 seed & passcode)
    

**韌體 (Firmware: BOLOS)**

*   可訪問助記詞的介面 （a kernel with access to the seed）
    
*   運行下載更新在應用端程序 （an app loader that runs each app in a sandbox）
    
*   韌體更新 BOLOS 介面程序 (Each firmware update BOLOS kerne)l
    

### **為什麼 Ledger 需要 Firmware Update?**

因為當新的鏈協議(Ex: Aptos)和簽名演算法方式出現，之前的軟體無法配合硬體，所以當任何惡意固件升級都可能導致攻擊者竊取您的種子

→ any malicious FW upgrade can lead attacker stealing your seed

### **Firmware** 韌體如何更新？

*   新韌體更新必須由 Ledger 簽名 （The new FW has to be signed by Ledger）
    
*   用戶也須使用他們的密碼批准 （the user has to approve the update with their passcode）
    

**→ 所以每個用戶更新不是被逼的，而是可以自己決定是否更新韌體**

![](https://storage.googleapis.com/papyrus_images/0f074c94c2562224839eb1cf01e363183515c8bd06e26639181302788f26f4c5.png)

### 哪種情況下 Ledger 是可信任的?

1.  只信任安全元件完整性 （Assuming only trust in SE hardware integrity）
    
    *   即 Ledger 公司和連接到該設備的電腦可能會受到損害 （i.e, Ledger the company, and the computer attached to the device might be compromised）
        
    *   用戶密碼是唯一阻止攻擊者提取種子的東西 （the user passcode is the only thing preventing an attacker from extracting the seed）
        
2.  消費者自己的選擇 （Options for consumers ）
    
    *   新的區塊鏈發佈時扔掉你的設備 （throw away your device every time a new blockchain ships）
        
    *   理論上信任賬本一次，因為你永遠不會“被迫”升級韌體 (in theory, Trust ledger once, since you are never “forced” to upgrade firmware)
        

### **大家以為 Ledger 安全元件是用特殊應用 ASIC 晶片，實際上可能是微控制器**

Ledger 官網提到的安全元件 ST31 晶片，網上查了下可能是安謀晶片公司 ARM 的商用微控制器晶片 [ST31 ARM SC000](https://www.st.com/en/secure-mcus/st31-arm-sc000.html)，能根據韌體更新調整其行為，所以可能並不像我們認為其安全元件使用了 ASIC 特殊晶片。

簡單科普，ASIC 是一種定制化的積體電路，專為特定的應用或功能而設計。處理特定的任務或執行特定固定的功能，其晶片行為是固定的，例如只做錢包簽章的固定行為。

而微控制器是一種整合了處理器（CPU）、記憶體、輸入/輸出接口和其他必要電路的單片電腦系統，通常用於控制和監控應用等嵌入式系統。**微控制器具有可程式性，開發人員可以通過編寫軟體指令來控制其行為。**

![](https://storage.googleapis.com/papyrus_images/30478d8413f9706ae9a31fd95cde2a06a13629f19732a249e36b7c94d69ed029.png)

> **Ledger 自己也說有機會可以由更新韌體去擷取硬體上儲存的Key → 等於= 碰得到註記詞種子 Seed，還拿得出來 (韌體有風險的雙向傳輸設計)**

### Conclusion

本次探討了硬體錢包Ledger的架構和安全性，包括Ledger Recover的隱私和安全問題，以及韌體更新的必要性和更新方式。Ledger的安全元件（SE）存儲BIP-32種子和密碼，搭配韌體BOLOS運行。更新韌體需要Ledger簽名和用戶密碼批准。然而，似乎只有相信SE硬件完整性，用戶密碼才能防止攻擊者提取種子，因為 Ledger 也承認更新韌體可能擷取硬體上儲存的Key。

* * *

**轉載請註明出處與作者**

**聯繫郵件：**[**nctu.frank@gmail.com**](http://mailto:nctu.frank@gmail.com/)

**更多關於我:** [**CompoundWater複水**](https://compoundwater.framer.website/)

[**IG**](https://www.instagram.com/compoundwater)**/**[**TG**](https://t.me/compoundwater)**/**[**YT**](https://www.youtube.com/channel/UC_S6XK91Xmg0dOyc9MPOFzQ)**/**[**FB**](https://www.facebook.com/compoundwater/)**/**[**Linkedin**](https://www.linkedin.com/in/compoundwater/)**/**[**Twitter**](https://twitter.com/compoundwater)**: 頻道搜尋 @compoundwater**

**歡迎自由斗內支持(ERC20): 0xc2Ac7F93D54dfbf9Bf7E4AeD21F817F2ce598D28**

---

*Originally published on [CompoundWater 複水](https://paragraph.com/@compoundwater/ledger-wallet)*
