Merge branch 'bunker-44' into 'main'

Switch to NIP-44 bunker encryption

See merge request soapbox-pub/ditto!608
This commit is contained in:
Alex Gleason 2024-12-18 08:00:07 +00:00
commit bb50ad7a43
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(),