-
Notifications
You must be signed in to change notification settings - Fork 15
docs: clarify Solana SIGN_TRANSACTION parsing and System Program Transfer account handling #608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,6 +63,25 @@ Turnkey has built a Solana parser which runs in a secure enclave, to parse unsig | |||||||||||||
|
|
||||||||||||||
| As a bonus, Turnkey also takes care of combining the signature with the original payload if you use the `SIGN_TRANSACTION` activity types: the input is the unsigned payload, and the output is the signed Solana transaction, ready to be broadcast onchain. | ||||||||||||||
|
|
||||||||||||||
| ### SIGN_TRANSACTION vs SIGN_RAW_PAYLOAD | ||||||||||||||
|
|
||||||||||||||
| These two signing endpoints have different behaviors that are worth understanding: | ||||||||||||||
|
|
||||||||||||||
| - **`SIGN_TRANSACTION`** passes the transaction through Turnkey's parser before signing. This enables Solana transaction policies (e.g. restricting which programs or accounts can be interacted with) and produces a fully-assembled signed transaction as output. Any transaction that does not parse successfully will return an error before signing occurs. | ||||||||||||||
| - **`SIGN_RAW_PAYLOAD`** does not parse the transaction — it blindly signs the bytes provided. This means no parsing errors, but also no policy evaluation against transaction contents. You receive the raw signature as output and must assemble it back into the transaction yourself. | ||||||||||||||
|
|
||||||||||||||
| If you do not need Solana transaction policies and are working with transactions from third-party APIs that may not conform to common instruction patterns, `SIGN_RAW_PAYLOAD` is a viable fallback. | ||||||||||||||
|
Comment on lines
+71
to
+73
|
||||||||||||||
| - **`SIGN_RAW_PAYLOAD`** does not parse the transaction — it blindly signs the bytes provided. This means no parsing errors, but also no policy evaluation against transaction contents. You receive the raw signature as output and must assemble it back into the transaction yourself. | |
| If you do not need Solana transaction policies and are working with transactions from third-party APIs that may not conform to common instruction patterns, `SIGN_RAW_PAYLOAD` is a viable fallback. | |
| - **`SIGN_RAW_PAYLOAD`** does not parse the Solana transaction — there is no Solana-aware parsing or policy evaluation of the transaction contents. It signs the provided payload after decoding and applying the selected hash function, and can still return errors (for example, for invalid encoding or an unsupported `hashFunction`). You receive the raw signature as output and must assemble it back into the transaction yourself. | |
| If you do not need Solana transaction policies and are working with transactions from third-party APIs that may not conform to common instruction patterns, and you are comfortable handling payload encoding and hash function selection yourself, `SIGN_RAW_PAYLOAD` is a viable fallback. |
Uh oh!
There was an error while loading. Please reload this page.