Conversation
…them - Listeners were registered per connection and every inbound payload went to all of them, so a second REQ saw the first one's EVENT frames and, worse, was released by the first one's EOSE. Callers that end a query on EOSE — which is every caller — returned a partial result set that varied from call to call. - subscribe(ReqMessage, ...) now records the subscription id and dispatchMessage delivers EVENT, EOSE and CLOSED only to the listener that opened that subscription. - Everything else is unchanged: NOTICE, OK, AUTH and any payload whose id cannot be read still go to every listener, as do listeners registered through the raw-JSON subscribe overload, where no id is parsed. No caller loses a frame it receives today. - The id is read with a scan rather than a JSON parse: this runs on every frame, and the payload is parsed again by whichever listener consumes it. - Found on a live relay: gift-wrap queries returned 0, 2 or 6 of the 5 events the relay holds, differing call to call, while a direct REQ returned all 5 every time. Co-Authored-By: Claude Opus 5 <[email protected]>
…ider
EncryptedPayloads asked for Cipher.getInstance("ChaCha20") and passed an
IvParameterSpec. Only BouncyCastle's JCE provider accepts that; SunJCE requires a
ChaCha20ParameterSpec and throws InvalidAlgorithmParameterException. The provider
was registered nowhere except as a side effect of Schnorr.generatePrivateKey(), so
NIP-44 encryption worked for a caller that had generated a key in this JVM and
failed for one that loaded a key from storage. On Android it could not work at all:
Security.addProvider for the name "BC" is a no-op there, because the platform ships
its own repackaged BouncyCastle under that name.
Both cipher call sites now use BouncyCastle's lightweight ChaCha7539Engine, which
needs no provider lookup and behaves identically on the JVM and on Android.
Schnorr.generatePrivateKey() drops the Security.addProvider call with it and uses
the lightweight ECKeyPairGenerator, so generating a key no longer mutates
process-wide JCE state. Callers that need the provider registered must register it
themselves; every known consumer already does.
NIP-44 is now checked against the specification's own vectors, and the whole test
class runs with the provider de-registered — which is what makes the fixture a
regression test rather than a restatement. The existing MessageCipherTest passed
throughout, because both of its cases generate a key first.
Closes #537
…p44-provider-2026-08-22 fix(client,nip44): subscription routing and provider-independent NIP-44 (2.0.8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes
developtomainfor the 2.0.8 release.Carries #538 — subscription routing (
fix(client)) and provider-independent NIP-44(
fix(nip44), closes #537) — plus the release commit. Also catchesdevelopup withmain, which it had drifted behind by ~20 commits.Artifacts are already published to
maven.398ja.xyz/releases; tagv2.0.8follows this merge.