Skip to content

Conversation

@steveluscher
Copy link
Collaborator

@steveluscher steveluscher commented Oct 24, 2025

This PR introduces partiallySignOffchainMessageEnvelope​ and signOffchainMessageEnvelope​ methods that you can use to sign an offchain message using a CryptoKey​.

See the next PR in this stack for the implementation of the Signers API.

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

🦋 Changeset detected

Latest commit: a9a8c4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 42 packages
Name Type
@solana/offchain-messages Minor
@solana/errors Minor
@solana/kit Minor
@solana/accounts Minor
@solana/addresses Minor
@solana/assertions Minor
@solana/codecs-core Minor
@solana/codecs-data-structures Minor
@solana/codecs-numbers Minor
@solana/codecs-strings Minor
@solana/compat Minor
@solana/instruction-plans Minor
@solana/instructions Minor
@solana/keys Minor
@solana/options Minor
@solana/programs Minor
@solana/react Minor
@solana/rpc-api Minor
@solana/rpc-spec Minor
@solana/rpc-subscriptions-channel-websocket Minor
@solana/rpc-subscriptions-spec Minor
@solana/rpc-subscriptions Minor
@solana/rpc-transformers Minor
@solana/rpc-transport-http Minor
@solana/rpc-types Minor
@solana/rpc Minor
@solana/signers Minor
@solana/subscribable Minor
@solana/sysvars Minor
@solana/transaction-confirmation Minor
@solana/transaction-messages Minor
@solana/transactions Minor
@solana/rpc-graphql Minor
@solana/rpc-parsed-types Minor
@solana/rpc-subscriptions-api Minor
@solana/codecs Minor
@solana/fast-stable-stringify Minor
@solana/functional Minor
@solana/nominal-types Minor
@solana/promises Minor
@solana/rpc-spec-types Minor
@solana/webcrypto-ed25519-polyfill Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bundlemon
Copy link

bundlemon bot commented Oct 24, 2025

BundleMon

Files updated (4)
Status Path Size Limits
offchain-messages/dist/index.browser.mjs
4.24KB (+415B +10.58%) -
offchain-messages/dist/index.native.mjs
4.23KB (+415B +10.59%) -
offchain-messages/dist/index.node.mjs
4.23KB (+414B +10.56%) -
@solana/kit production bundle
kit/dist/index.production.min.js
38.23KB (+104B +0.27%) -
Unchanged files (129)
Status Path Size Limits
rpc-graphql/dist/index.browser.mjs
18.82KB -
rpc-graphql/dist/index.native.mjs
18.81KB -
rpc-graphql/dist/index.node.mjs
18.81KB -
errors/dist/index.node.mjs
16.99KB -
errors/dist/index.browser.mjs
16.97KB -
errors/dist/index.native.mjs
16.97KB -
transaction-messages/dist/index.browser.mjs
7.29KB -
transaction-messages/dist/index.native.mjs
7.29KB -
transaction-messages/dist/index.node.mjs
7.29KB -
codecs-data-structures/dist/index.browser.mjs
4.69KB -
codecs-data-structures/dist/index.native.mjs
4.69KB -
codecs-data-structures/dist/index.node.mjs
4.69KB -
webcrypto-ed25519-polyfill/dist/index.node.mj
s
3.6KB -
webcrypto-ed25519-polyfill/dist/index.browser
.mjs
3.59KB -
webcrypto-ed25519-polyfill/dist/index.native.
mjs
3.57KB -
instruction-plans/dist/index.browser.mjs
3.42KB -
instruction-plans/dist/index.native.mjs
3.42KB -
instruction-plans/dist/index.node.mjs
3.41KB -
codecs-core/dist/index.browser.mjs
3.41KB -
codecs-core/dist/index.native.mjs
3.41KB -
codecs-core/dist/index.node.mjs
3.41KB -
rpc-subscriptions/dist/index.browser.mjs
3.37KB -
rpc-subscriptions/dist/index.node.mjs
3.34KB -
rpc-subscriptions/dist/index.native.mjs
3.31KB -
addresses/dist/index.browser.mjs
2.93KB -
rpc-transformers/dist/index.browser.mjs
2.93KB -
rpc-transformers/dist/index.native.mjs
2.93KB -
addresses/dist/index.native.mjs
2.93KB -
addresses/dist/index.node.mjs
2.93KB -
rpc-transformers/dist/index.node.mjs
2.93KB -
transactions/dist/index.browser.mjs
2.9KB -
transactions/dist/index.native.mjs
2.9KB -
transactions/dist/index.node.mjs
2.9KB -
signers/dist/index.browser.mjs
2.63KB -
signers/dist/index.native.mjs
2.63KB -
signers/dist/index.node.mjs
2.62KB -
codecs-strings/dist/index.browser.mjs
2.53KB -
codecs-strings/dist/index.node.mjs
2.48KB -
codecs-strings/dist/index.native.mjs
2.45KB -
transaction-confirmation/dist/index.node.mjs
2.41KB -
transaction-confirmation/dist/index.native.mj
s
2.36KB -
transaction-confirmation/dist/index.browser.m
js
2.35KB -
sysvars/dist/index.browser.mjs
2.35KB -
sysvars/dist/index.native.mjs
2.34KB -
sysvars/dist/index.node.mjs
2.34KB -
react/dist/index.browser.mjs
2.31KB -
react/dist/index.native.mjs
2.31KB -
react/dist/index.node.mjs
2.31KB -
rpc-subscriptions-spec/dist/index.node.mjs
2.18KB -
rpc-subscriptions-spec/dist/index.native.mjs
2.13KB -
rpc-subscriptions-spec/dist/index.browser.mjs
2.13KB -
keys/dist/index.browser.mjs
2.08KB -
keys/dist/index.native.mjs
2.08KB -
keys/dist/index.node.mjs
2.08KB -
codecs-numbers/dist/index.native.mjs
2.01KB -
codecs-numbers/dist/index.browser.mjs
2.01KB -
codecs-numbers/dist/index.node.mjs
2.01KB -
rpc/dist/index.node.mjs
1.95KB -
rpc-transport-http/dist/index.browser.mjs
1.91KB -
rpc-transport-http/dist/index.native.mjs
1.9KB -
rpc/dist/index.native.mjs
1.81KB -
rpc/dist/index.browser.mjs
1.8KB -
subscribable/dist/index.node.mjs
1.8KB -
subscribable/dist/index.native.mjs
1.75KB -
subscribable/dist/index.browser.mjs
1.74KB -
rpc-transport-http/dist/index.node.mjs
1.72KB -
kit/dist/index.browser.mjs
1.69KB -
kit/dist/index.native.mjs
1.68KB -
kit/dist/index.node.mjs
1.68KB -
rpc-types/dist/index.browser.mjs
1.53KB -
rpc-types/dist/index.native.mjs
1.53KB -
rpc-types/dist/index.node.mjs
1.53KB -
rpc-subscriptions-channel-websocket/dist/inde
x.node.mjs
1.33KB -
rpc-subscriptions-channel-websocket/dist/inde
x.native.mjs
1.27KB -
rpc-subscriptions-channel-websocket/dist/inde
x.browser.mjs
1.26KB -
options/dist/index.browser.mjs
1.18KB -
options/dist/index.native.mjs
1.18KB -
options/dist/index.node.mjs
1.17KB -
accounts/dist/index.browser.mjs
1.13KB -
accounts/dist/index.native.mjs
1.12KB -
accounts/dist/index.node.mjs
1.12KB -
rpc-api/dist/index.browser.mjs
976B -
rpc-api/dist/index.native.mjs
975B -
rpc-api/dist/index.node.mjs
973B -
compat/dist/index.browser.mjs
969B -
compat/dist/index.native.mjs
968B -
compat/dist/index.node.mjs
966B -
rpc-spec-types/dist/index.browser.mjs
962B -
rpc-spec-types/dist/index.native.mjs
961B -
rpc-spec-types/dist/index.node.mjs
959B -
rpc-subscriptions-api/dist/index.native.mjs
870B -
rpc-subscriptions-api/dist/index.node.mjs
869B -
rpc-subscriptions-api/dist/index.browser.mjs
868B -
rpc-spec/dist/index.browser.mjs
852B -
rpc-spec/dist/index.native.mjs
851B -
rpc-spec/dist/index.node.mjs
850B -
promises/dist/index.browser.mjs
799B -
promises/dist/index.native.mjs
798B -
promises/dist/index.node.mjs
797B -
assertions/dist/index.browser.mjs
783B -
instructions/dist/index.browser.mjs
769B -
instructions/dist/index.native.mjs
768B -
instructions/dist/index.node.mjs
767B -
fast-stable-stringify/dist/index.browser.mjs
726B -
fast-stable-stringify/dist/index.native.mjs
725B -
assertions/dist/index.native.mjs
724B -
fast-stable-stringify/dist/index.node.mjs
724B -
assertions/dist/index.node.mjs
723B -
programs/dist/index.browser.mjs
329B -
programs/dist/index.native.mjs
327B -
programs/dist/index.node.mjs
325B -
event-target-impl/dist/index.node.mjs
230B -
functional/dist/index.browser.mjs
154B -
functional/dist/index.native.mjs
152B -
text-encoding-impl/dist/index.native.mjs
152B -
functional/dist/index.node.mjs
151B -
codecs/dist/index.browser.mjs
137B -
codecs/dist/index.native.mjs
136B -
codecs/dist/index.node.mjs
134B -
event-target-impl/dist/index.browser.mjs
133B -
ws-impl/dist/index.node.mjs
131B -
text-encoding-impl/dist/index.browser.mjs
122B -
text-encoding-impl/dist/index.node.mjs
119B -
ws-impl/dist/index.browser.mjs
113B -
crypto-impl/dist/index.node.mjs
111B -
crypto-impl/dist/index.browser.mjs
109B -
rpc-parsed-types/dist/index.browser.mjs
66B -
rpc-parsed-types/dist/index.native.mjs
65B -
rpc-parsed-types/dist/index.node.mjs
63B -

Total files change +1.32KB +0.35%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

Documentation Preview: https://kit-docs-8jlkfjxq9-anza-tech.vercel.app

@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from d55bac1 to a484c1a Compare October 27, 2025 22:41
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from fea355e to 20a5a3c Compare October 27, 2025 23:00
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from a484c1a to a1ea049 Compare October 27, 2025 23:00
Copy link
Collaborator Author

Added code that verifies the message starts with the signing domain before signing it.

@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from a1ea049 to 0b93aa0 Compare October 28, 2025 23:22
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from 5ef6547 to c543d03 Compare October 29, 2025 20:32
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 0b93aa0 to ed801e2 Compare October 29, 2025 20:32
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from c543d03 to 9fbcb37 Compare October 29, 2025 20:33
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch 2 times, most recently from 869ed66 to 5c5dca7 Compare October 29, 2025 20:44
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from 489ce4d to fd499f3 Compare October 29, 2025 20:50
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch 2 times, most recently from 4a7997a to a7dba9f Compare October 29, 2025 22:26
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from fd499f3 to c3058bb Compare October 29, 2025 22:26
Comment on lines +220 to +212
function uint8ArraysEqual(arr1: ReadonlyUint8Array, arr2: ReadonlyUint8Array) {
return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a nice one to add next to containsBytes as equalBytes or something on @solana/codecs-core.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with this - we have this copied in a few places now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from a7dba9f to 929898e Compare October 31, 2025 01:50
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from dacb5f4 to e8781ec Compare November 13, 2025 19:51
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch 2 times, most recently from 7de741a to de31b52 Compare November 17, 2025 19:04
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from e8781ec to d8b4eb4 Compare November 17, 2025 19:04
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from de31b52 to 0fc610e Compare November 17, 2025 19:06
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from 12f263f to bb721da Compare November 18, 2025 21:52
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 0fc610e to cab36be Compare November 18, 2025 21:52
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from cab36be to 0c9fd99 Compare November 18, 2025 22:14
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch 2 times, most recently from 0cc9210 to 533e9a4 Compare November 19, 2025 20:29
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 0c9fd99 to 86bb124 Compare November 19, 2025 20:29
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from 533e9a4 to e86203c Compare November 19, 2025 20:46
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 86bb124 to 330a70f Compare November 19, 2025 20:46
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from e86203c to ccbaf1e Compare November 19, 2025 20:52
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 330a70f to 06766b6 Compare November 19, 2025 20:52
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from ccbaf1e to b02e5c9 Compare November 19, 2025 21:51
@steveluscher steveluscher force-pushed the 09-10-helpers_for_encoding_and_decoding_offchain_messages branch from 06766b6 to 23a561d Compare November 19, 2025 21:51
Copy link
Collaborator Author

steveluscher commented Nov 19, 2025

Merge activity

  • Nov 19, 10:37 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 19, 10:43 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 19, 10:45 PM UTC: @steveluscher merged this pull request with Graphite.

@steveluscher steveluscher changed the base branch from 09-10-helpers_for_encoding_and_decoding_offchain_messages to graphite-base/984 November 19, 2025 22:38
@steveluscher steveluscher changed the base branch from graphite-base/984 to main November 19, 2025 22:41
@steveluscher steveluscher force-pushed the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch from b02e5c9 to a9a8c4f Compare November 19, 2025 22:42
@steveluscher steveluscher merged commit 32214f5 into main Nov 19, 2025
13 checks passed
@steveluscher steveluscher deleted the 10-24-add_functions_that_let_you_sign_offchain_message_envelopes branch November 19, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants