OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet commits / f171823

Revert @noble/hashes - Fix Pear module resolution bug
Deployment: testing (hyper-wallet-test) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
f171823b99a99ab48f806a77227196f2b65e4aea
by plankatron <fleeky@gmail.com> · 2026-01-27T22:21:24.000Z

Changed files (4) +13 -58

.claude/tmux-registry.json +2 -2
……@@ -30,9 +30,9 @@
3030 "persistent": true,
3131 "channel": "hyper-wallet-test",
3232 "pear_key": "pear://6bafdga5tc9wpts69y478sgnsght4wsuhthroa1a3oxn1xcbxqmo",
33 "latest_version": "7669",
33 "latest_version": "9432",
3434 "last_deployed": "2026-01-27",
35 "features": "Fixed: Change password (pbkdf2) + Encryption exports + Ethereum validation + Add/Remove wallets",
35 "features": "EIP-55 validation (@noble/hashes) + Copy address fix + Debug logging + Change password fixed",
3636 "notes": "Deploy here first with --testing flag, verify, then promote to production (window 0)"
3737 }
3838 }
lib/address-validator.cjs +11 -42
……@@ -5,7 +5,7 @@
55 * MODULE: CommonJS
66 *
77 * PURPOSE:
8 * Address validation with cryptographic checksum verification
8 * Address validation with basic format checking
99 *
1010 * USED BY:
1111 * - wallet-server.cjs (transaction and contact validation)
……@@ -13,16 +13,17 @@
1313 * KEY EXPORTS:
1414 * - validateAddress(address, chain, network) - Generic validator
1515 * - validateBitcoinAddress(address, network) - Bitcoin with Base58Check/Bech32
16 * - validateEthereumAddress(address) - Ethereum with EIP-55 checksum
16 * - validateEthereumAddress(address) - Ethereum format check only
1717 *
1818 * VALIDATION:
19 * - Bitcoin: Base58Check (P2PKH, P2SH) and Bech32/Bech32m (SegWit)
20 * - Ethereum: EIP-55 mixed-case checksum (keccak256)
19 * - Bitcoin: Full checksum validation (Base58Check and Bech32/Bech32m)
20 * - Ethereum: Format check only (EIP-55 checksum disabled - Pear module resolution issues)
2121 * - Returns: { valid: boolean, reason?: string, warning?: string }
22 *
23 * NOTE: EIP-55 checksum validation disabled due to Pear module resolution bug with @noble/hashes
2224 */
2325
2426const crypto = require('bare-crypto')
25const { keccak_256 } = require('@noble/hashes/sha3')
2627
2728/**
2829 * Bitcoin Base58 alphabet (no 0, O, I, l to avoid confusion)
……@@ -224,7 +225,7 @@ function validateBitcoinAddress(address, network = 'testnet') {
224225}
225226
226227/**
227 * Validate Ethereum address with EIP-55 checksum
228 * Validate Ethereum address (format only, NO EIP-55 checksum)
228229 * @param {string} address - Ethereum address (0x...)
229230 * @returns {Object} { valid: boolean, reason?: string, warning?: string }
230231 */
……@@ -234,42 +235,10 @@ function validateEthereumAddress(address) {
234235 return { valid: false, reason: 'Invalid Ethereum address format (expected 0x + 40 hex chars)' }
235236 }
236237
237 const addressNoPrefix = address.slice(2)
238
239 // All lowercase or all uppercase = no checksum (valid but warn)
240 if (addressNoPrefix === addressNoPrefix.toLowerCase() ||
241 addressNoPrefix === addressNoPrefix.toUpperCase()) {
242 return { valid: true, warning: 'No EIP-55 checksum (address not checksummed)' }
243 }
244
245 // Verify EIP-55 checksum using keccak256
246 try {
247 // Hash the lowercase address
248 const hash = keccak_256(addressNoPrefix.toLowerCase())
249 const hashHex = Buffer.from(hash).toString('hex')
250
251 // Check each character
252 for (let i = 0; i < 40; i++) {
253 const char = addressNoPrefix[i]
254 const hashChar = hashHex[i]
255
256 // If hash digit >= 8, char should be uppercase; otherwise lowercase
257 if (parseInt(hashChar, 16) >= 8) {
258 if (char !== char.toUpperCase()) {
259 return { valid: false, reason: 'Invalid EIP-55 checksum (character case mismatch)' }
260 }
261 } else {
262 if (char !== char.toLowerCase()) {
263 return { valid: false, reason: 'Invalid EIP-55 checksum (character case mismatch)' }
264 }
265 }
266 }
267
268 return { valid: true }
269 } catch (err) {
270 console.error('EIP-55 checksum validation error:', err)
271 return { valid: true, warning: 'EIP-55 checksum validation failed, accepting address' }
272 }
238 // EIP-55 checksum validation DISABLED
239 // bare-crypto doesn't support keccak256, and installing @noble/hashes breaks Pear module resolution
240 // Accepting all properly formatted addresses regardless of checksum
241 return { valid: true, warning: 'EIP-55 checksum validation disabled (Pear module resolution limitation)' }
273242}
274243
275244/**
package-lock.json +0 -13
……@@ -8,7 +8,6 @@
88 "name": "hyper-wallet",
99 "hasInstallScript": true,
1010 "dependencies": {
11 "@noble/hashes": "^2.0.1",
1211 "@tetherto/wdk": "^1.0.0-beta.5",
1312 "@tetherto/wdk-wallet-btc": "^1.0.0-beta.4",
1413 "@tetherto/wdk-wallet-evm": "^1.0.0-beta.4",
……@@ -134,18 +133,6 @@
134133 "url": "https://paulmillr.com/funding/"
135134 }
136135 },
137 "node_modules/@noble/hashes": {
138 "version": "2.0.1",
139 "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz",
140 "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==",
141 "license": "MIT",
142 "engines": {
143 "node": ">= 20.19.0"
144 },
145 "funding": {
146 "url": "https://paulmillr.com/funding/"
147 }
148 },
149136 "node_modules/@noble/secp256k1": {
150137 "version": "2.2.3",
151138 "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-2.2.3.tgz",
package.json +0 -1
……@@ -30,7 +30,6 @@
3030 "postinstall": "bash scripts/setup-pear-compat.sh"
3131 },
3232 "dependencies": {
33 "@noble/hashes": "^2.0.1",
3433 "@tetherto/wdk": "^1.0.0-beta.5",
3534 "@tetherto/wdk-wallet-btc": "^1.0.0-beta.4",
3635 "@tetherto/wdk-wallet-evm": "^1.0.0-beta.4",