Skip to content

Commit ef27ea6

Browse files
Merge pull request #16 from jjohare/fix/remove-fake-bech32
fix: remove broken bech32 nsec/npub stub functions
2 parents c051833 + 1072ba5 commit ef27ea6

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

src/crypto.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -161,35 +161,3 @@ export function isValidPublicKey (publicKey) {
161161
if (publicKey.length !== 64) return false;
162162
return /^[0-9a-fA-F]{64}$/.test(publicKey);
163163
}
164-
165-
/**
166-
* Convert private key to nsec format (Bech32)
167-
* @param {string} privateKeyHex - 64-char hex private key
168-
* @returns {string} nsec1... format
169-
*/
170-
export function privateKeyToNsec (privateKeyHex) {
171-
// TODO: Implement bech32 encoding
172-
// For now, return hex with nsec prefix as placeholder
173-
return `nsec_${privateKeyHex}`;
174-
}
175-
176-
/**
177-
* Convert nsec to private key hex
178-
* @param {string} nsec - nsec1... format
179-
* @returns {string} 64-char hex private key
180-
*/
181-
export function nsecToPrivateKey (nsec) {
182-
// TODO: Implement bech32 decoding
183-
// For now, strip nsec_ prefix as placeholder
184-
return nsec.replace(/^nsec_/, '');
185-
}
186-
187-
/**
188-
* Convert public key to npub format (Bech32)
189-
* @param {string} publicKeyHex - 64-char hex public key
190-
* @returns {string} npub1... format
191-
*/
192-
export function publicKeyToNpub (publicKeyHex) {
193-
// TODO: Implement bech32 encoding
194-
return `npub_${publicKeyHex}`;
195-
}

0 commit comments

Comments
 (0)