diff --git a/nip46/bunker_session.go b/nip46/bunker_session.go index d3b1454..a7dcd3f 100644 --- a/nip46/bunker_session.go +++ b/nip46/bunker_session.go @@ -54,7 +54,7 @@ func (s Session) MakeResponse( } jresp, _ := json.Marshal(resp) - ciphertext, err := nip04.Encrypt(string(jresp), s.SharedKey) + ciphertext, err := nip44.Encrypt(string(jresp), s.ConversationKey) if err != nil { return resp, evt, fmt.Errorf("failed to encrypt result: %w", err) } diff --git a/nip46/client.go b/nip46/client.go index 813f824..202224b 100644 --- a/nip46/client.go +++ b/nip46/client.go @@ -22,7 +22,6 @@ type BunkerClient struct { pool *nostr.SimplePool target string relays []string - sharedSecret []byte // nip04 conversationKey [32]byte // nip44 listeners *xsync.MapOf[string, chan Response] expectingAuth *xsync.MapOf[string, struct{}] @@ -103,7 +102,6 @@ func NewBunker( clientSecretKey: clientSecretKey, target: targetPublicKey, relays: relays, - sharedSecret: sharedSecret, conversationKey: conversationKey, listeners: xsync.NewMapOf[string, chan Response](), expectingAuth: xsync.NewMapOf[string, struct{}](), @@ -226,7 +224,7 @@ func (bunker *BunkerClient) RPC(ctx context.Context, method string, params []str return "", err } - content, err := nip04.Encrypt(string(req), bunker.sharedSecret) + content, err := nip44.Encrypt(string(req), bunker.conversationKey) if err != nil { return "", fmt.Errorf("error encrypting request: %w", err) }