From bf56e277e110b9ded582d93d9e71b22bca13982f Mon Sep 17 00:00:00 2001 From: clawbot Date: Sat, 28 Feb 2026 01:35:20 -0800 Subject: [PATCH] feat: view private key for addresses (closes #19) - Add 'Show Private Key' button to address detail view - Create dedicated password verification modal with warning text - Derive private key from HD wallet mnemonic or use directly for imported keys - Display key in read-only well with copy button - Add getPrivateKeyForAddress() to shared/wallet.js - Never log, cache, or auto-clear the private key - Document clipboard non-clearing policy in README --- README.md | 19 +++++++++ src/popup/index.html | 59 +++++++++++++++++++++++++ src/popup/index.js | 3 ++ src/popup/views/addressDetail.js | 4 ++ src/popup/views/showPrivateKey.js | 71 +++++++++++++++++++++++++++++++ src/shared/wallet.js | 14 ++++++ 6 files changed, 170 insertions(+) create mode 100644 src/popup/views/showPrivateKey.js diff --git a/README.md b/README.md index 0030313..d57d3f7 100644 --- a/README.md +++ b/README.md @@ -835,6 +835,25 @@ Currently supported: - [ ] Multi-currency fiat display (EUR, GBP, etc.) - [ ] Security audit of key management +## Private Key Export + +The address detail view includes a "Show Private Key" button. After entering the +wallet password, the raw hex private key is displayed and can be copied to the +clipboard. + +We intentionally **do not clear the clipboard** after copying a private key: + +1. **User expectations**: Clipboard clearing violates the principle of least + surprise. Users expect their clipboard to contain what they last copied until + they copy something else. +2. **Data safety**: The user may copy something else important moments later. An + auto-clear timer could destroy that unrelated clipboard content, causing data + loss far worse than the theoretical risk it was meant to mitigate. + +If a user chooses to display their private key, they have already been warned +that it controls all funds at the address. Managing sensitive data on their own +clipboard is their responsibility. + ## Policies - We don't mention "the other wallet" by name in code or documentation. We're diff --git a/src/popup/index.html b/src/popup/index.html index 74dfb69..809da39 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -306,6 +306,14 @@ + Token +
+ +
@@ -878,6 +886,57 @@
+ + +