Repository navigation
Drop version and generate_version from the key registration payload - #48
Open
santiagomed wants to merge 7 commits into
Open
santiagomed wants to merge 7 commits into
santiagomed wants to merge 7 commits into
Conversation
|
|
…ion payload PublicKeyRegistrationPayload carries only public_key in every binding, and generate_keypairs no longer records a signing-key version: the keys are registered under the public_key_version the X API returns, so a local timestamp version only produced signatures that were rejected. Call set_identity with the registered version, or pass it to import_keys when loading saved keys; signing without a version fails in the SDK with the missing signing_key_version error. ChatCore::generate_keypairs_with_version is removed. Every binding suite pins that generated keys sign only once the registered version is set, and that restored keys carry the version import_keys was given.
The register scripts stop sending version and generate_version, and read the registered public_key_version from the X API (the POST response, or the matching entry of GET /2/users/:id/public_keys); when neither has it they stop, and a re-run resumes the saved identity. The bots require CHAT_SIGNING_KEY_VERSION when they load a key blob instead of defaulting to "1", each example's ChatCore refuses set_identity without a version, the browser app asks for the key version next to the blob, and the Juicebox config helpers no longer turn a missing public_key_version into "1".
santiagomed
force-pushed
the
cursor/registered-key-version-1119
branch
from
October 16, 2026 23:53
f933d5b to
79d5b89
Compare
cursor
Bot
changed the base branch from
main
to
cursor/signed-read-receipts-1119
October 16, 2026 23:54
santiagomed
added this pull request to stack #42
October 17, 2026 01:31
Both this branch and its base re-synced the Go prebuilt archives after the rebase onto the stack. The base changed nothing else, so keep this branch's archives: they are built from its code, which already contains the base's.
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.
Problem
generate_keypairs()filled the registration payload'sversionwith a local millisecond timestamp (Date.now()in JS) and also stored that timestamp as the signing-key version. The keys are registered under thepublic_key_versionthe registration returns, not that timestamp. Unless the app then calledset_identity(user_id, public_key_version), every signed action (message delete and edit, reactions, conversation-key changes, group changes) carried the timestamp as itspublic_key_versionand was rejected.Stacked on #49, which is stacked on #47.
Changes
public_key.PublicKeyRegistrationPayloaddropsversionandgenerate_versionin every binding (Rust, Python, Go, JS/WASM, JVM, .NET).ChatCore::generate_keypairs_with_versionis removed, and the WASM binding callsgenerate_keypairs.generate_keypairssets no signing-key version. After registering the keys, callset_identity(user_id, public_key_version)with the version the registration returns, or pass it toimport_keys/import_keys_with_versionwhen loading saved keys. Signing with no version fails in the SDK withsigning_key_version is not set: pass it explicitly or call set_identity() first, instead of sending a version that gets rejected.GET /2/users/:id/public_keys). If neither has it, the register scripts stop, and a re-run resumes the saved identity.CHAT_SIGNING_KEY_VERSIONwhen they load a key blob, instead of defaulting to"1". Each example'sChatCorerefusesset_identitywithout a version (the Rust one now returnsResult), the browser app asks for the key version next to the blob, and the Juicebox config helpers no longer turn a missingpublic_key_versioninto"1".docs/API.md, the binding READMEs, and the doc comments say to callset_identitywith thepublic_key_versionthe registration returns.CHANGELOG.mdgains a breaking-changes entry.Breaking changes
versionorgenerate_version(Version/GenerateVersionin Go and .NET,generateVersionin JS) must stop; POST the payload as returned.ChatCore::generate_keypairs_with_versionswitch togenerate_keypairs.set_identitywith the registered version, or pass a version toimport_keys, need no changes.CHAT_SIGNING_KEY_VERSIONis unset. Set it to thepublic_key_versionthe register script prints.Merge order
This needs the X API to accept public-key registrations without
versiononPOST /2/users/:id/public_keys. Merge and release it only after that is live: until then the endpoint requiresversion, so it rejects the payload this SDK returns. It is the top of the stack (#47 → #49 → #48), so #49 can merge without waiting for it.Testing
-D warnings, cargo-deny, workspace tests, WASM build, Python, JS (Node 20 and 18), JVM, .NET, Go, and all six example suites.import_keyswas given. The Python test passesMessageDeleteParams, since Python takes params classes in this release, and the core tests use numeric sender ids, which per-message keys require.Notes
chore(go): sync libchat_xdk_go.a), not by hand.