Switch to NIP-44 bunker encryption

https://gitlab.com/soapbox-pub/ditto/-/issues/279
This commit is contained in:
Alex Gleason 2024-12-18 01:56:53 -06:00
parent 75f9c90a8c
commit 139e600b79
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 2 additions and 0 deletions

View file

@ -119,6 +119,7 @@ async function getToken(
const nip46Seckey = generateSecretKey(); const nip46Seckey = generateSecretKey();
const signer = new NConnectSigner({ const signer = new NConnectSigner({
encryption: 'nip44',
pubkey: bunkerPubkey, pubkey: bunkerPubkey,
signer: new NSecSigner(nip46Seckey), signer: new NSecSigner(nip46Seckey),
relay: await Storages.pubsub(), // TODO: Use the relays from the request. relay: await Storages.pubsub(), // TODO: Use the relays from the request.

View file

@ -25,6 +25,7 @@ export class ConnectSigner implements NostrSigner {
async init(signer: NostrSigner): Promise<NConnectSigner> { async init(signer: NostrSigner): Promise<NConnectSigner> {
return new NConnectSigner({ return new NConnectSigner({
encryption: 'nip44',
pubkey: this.opts.bunkerPubkey, pubkey: this.opts.bunkerPubkey,
// TODO: use a remote relay for `nprofile` signing (if present and `Conf.relay` isn't already in the list) // TODO: use a remote relay for `nprofile` signing (if present and `Conf.relay` isn't already in the list)
relay: await Storages.pubsub(), relay: await Storages.pubsub(),