Repository navigation
feat(sdk-coin-sol): durable-nonce support in ConfidentialTransferBuilder v1 - #9968
Merged
Merged
Conversation
Contributor
Contributor
|
|
…der v1 Mirror V1TransactionBuilder's buildV1: inject AdvanceNonceAccount first when durable nonce is set, assemble signatures in message-signer order, and carry nonceInfo on the metadata transaction. Add a durable-nonce CT build test asserting the 0x81 wire, 2 signers (user + gas-tank nonce authority), nonce blockhash, and AdvanceNonceAccount discriminator. (Refs: CHALO-1091)
bhavidhingra
force-pushed
the
bhavi/chalo-1603-sdk-v1-transfer-builder
branch
from
October 15, 2026 08:44
48a0132 to
b089405
Compare
bhavidhingra
added a commit
that referenced
this pull request
Oct 21, 2026
…LO-1883) - sdk-core: configureAccount opt-out flag flows through BuildTokenEnablementOptions, PrebuildTransactionWithIntentOptions, intent payloads, and the BuildParams codec - sdk-coin-sol: ConfidentialTransferBuilder.createAta accepts CreateAssociatedTokenAccount so one v1 tx carries CreateATA + ConfigureAccount + VerifyPubkeyValidity - sdk-coin-sol: fix ConfigureAccount data layout - add the required 32-byte new_account_elgamal_pubkey (span 47 -> 79, matching the on-chain ConfigureAccountInstructionData); the PR #9968 layout omitted it and would have been rejected on-chain - sdk-coin-sol: Transaction.fromRawTransaction parses v1 (0x81) wires into a metadata SolTransaction (verify/explain no longer assume legacy serialization) - sdk-coin-sol: verifyTransaction accepts CT enable txs (type ConfidentialTransfer) under type enabletoken, keeping token name/address spoof checks - instructionParamsFactory: preserve CreateATA metadata on ConfidentialTransfer-typed parses (CT enablement round-trips keep the ATA entry) - sdk-coin-sol: CT builder buildV1 now matches the v1 payment builder: injects AdvanceNonceAccount for durable nonce and fills signatures in compiled-signer order with zero-filled placeholders (server-side unsigned builds keep a valid v1 wire)
bhavidhingra
added a commit
that referenced
this pull request
Oct 21, 2026
…LO-1883) - sdk-core: configureAccount opt-out flag flows through BuildTokenEnablementOptions, PrebuildTransactionWithIntentOptions, intent payloads, and the BuildParams codec - sdk-coin-sol: ConfidentialTransferBuilder.createAta accepts CreateAssociatedTokenAccount so one v1 tx carries CreateATA + ConfigureAccount + VerifyPubkeyValidity - sdk-coin-sol: fix ConfigureAccount data layout - add the required 32-byte new_account_elgamal_pubkey (span 47 -> 79, matching the on-chain ConfigureAccountInstructionData); the PR #9968 layout omitted it and would have been rejected on-chain - sdk-coin-sol: Transaction.fromRawTransaction parses v1 (0x81) wires into a metadata SolTransaction (verify/explain no longer assume legacy serialization) - sdk-coin-sol: verifyTransaction accepts CT enable txs (type ConfidentialTransfer) under type enabletoken, keeping token name/address spoof checks - instructionParamsFactory: preserve CreateATA metadata on ConfidentialTransfer-typed parses (CT enablement round-trips keep the ATA entry) - sdk-coin-sol: CT builder buildV1 now matches the v1 payment builder: injects AdvanceNonceAccount for durable nonce and fills signatures in compiled-signer order with zero-filled placeholders (server-side unsigned builds keep a valid v1 wire)
bhavidhingra
added a commit
that referenced
this pull request
Oct 21, 2026
…LO-1883) - sdk-core: configureAccount opt-out flag flows through BuildTokenEnablementOptions, PrebuildTransactionWithIntentOptions, intent payloads, the BuildParams codec and the PopulatedIntent type - sdk-coin-sol: ConfidentialTransferBuilder.createAta emits the idempotent CreateATA plus the Token-2022 Reallocate that adds the ConfidentialTransferAccount extension (ConfigureAccount fails on-chain without it) - sdk-coin-sol: fix the ConfigureAccount data layout - add the required 32-byte new_account_elgamal_pubkey (span 47 -> 79, matching ConfigureAccountInstructionData); the PR #9968 layout omitted it and would have been rejected on-chain - sdk-coin-sol: Transaction.fromRawTransaction parses v1 (0x81) wires, derives the transaction type from the parsed instructions (shared with the legacy path) and classifies CreateATA + ConfigureAccount txs as ConfidentialTransfer, not ATA-init - sdk-coin-sol: verifyTransaction accepts CT enable txs (ConfidentialTransfer) under type enabletoken, keeping the token name/address spoof checks - instructionParamsFactory: preserve CreateATA and CT metadata on CT-typed parses - sdk-coin-sol: CT buildV1 parity with the v1 payment builder - AdvanceNonceAccount injection and compiled-order signature zero-fill for unsigned server builds - tests: v1 enablement wire (4 instructions incl. Reallocate), CT verify acceptance and token-name tamper rejection
bhavidhingra
added a commit
that referenced
this pull request
Oct 21, 2026
…LO-1883) - sdk-core: configureAccount opt-out flag flows through BuildTokenEnablementOptions, PrebuildTransactionWithIntentOptions, intent payloads, the BuildParams codec and the PopulatedIntent type - sdk-coin-sol: ConfidentialTransferBuilder.createAta emits the idempotent CreateATA plus the Token-2022 Reallocate that adds the ConfidentialTransferAccount extension (ConfigureAccount fails on-chain without it) - sdk-coin-sol: fix the ConfigureAccount data layout - add the required 32-byte new_account_elgamal_pubkey (span 47 -> 79, matching ConfigureAccountInstructionData); the PR #9968 layout omitted it and would have been rejected on-chain - sdk-coin-sol: Transaction.fromRawTransaction parses v1 (0x81) wires, derives the transaction type from the parsed instructions (shared with the legacy path) and classifies CreateATA + ConfigureAccount txs as ConfidentialTransfer, not ATA-init - sdk-coin-sol: verifyTransaction accepts CT enable txs (ConfidentialTransfer) under type enabletoken, keeping the token name/address spoof checks - instructionParamsFactory: preserve CreateATA and CT metadata on CT-typed parses - sdk-coin-sol: CT buildV1 parity with the v1 payment builder - AdvanceNonceAccount injection and compiled-order signature zero-fill for unsigned server builds - tests: v1 enablement wire (4 instructions incl. Reallocate), CT verify acceptance and token-name tamper rejection
bhavidhingra
added a commit
that referenced
this pull request
Oct 21, 2026
…LO-1883) - sdk-core: configureAccount opt-out flag flows through BuildTokenEnablementOptions, PrebuildTransactionWithIntentOptions, intent payloads, the BuildParams codec and the PopulatedIntent type - sdk-coin-sol: ConfidentialTransferBuilder.createAta emits the idempotent CreateATA plus the Token-2022 Reallocate that adds the ConfidentialTransferAccount extension (ConfigureAccount fails on-chain without it) - sdk-coin-sol: fix the ConfigureAccount data layout - add the required 32-byte new_account_elgamal_pubkey (span 47 -> 79, matching ConfigureAccountInstructionData); the PR #9968 layout omitted it and would have been rejected on-chain - sdk-coin-sol: Transaction.fromRawTransaction parses v1 (0x81) wires, derives the transaction type from the parsed instructions (shared with the legacy path) and classifies CreateATA + ConfigureAccount txs as ConfidentialTransfer, not ATA-init - sdk-coin-sol: verifyTransaction accepts CT enable txs (ConfidentialTransfer) under type enabletoken, keeping the token name/address spoof checks - instructionParamsFactory: preserve CreateATA and CT metadata on CT-typed parses - sdk-coin-sol: CT buildV1 parity with the v1 payment builder - AdvanceNonceAccount injection and compiled-order signature zero-fill for unsigned server builds - tests: v1 enablement wire (4 instructions incl. Reallocate), CT verify acceptance and token-name tamper rejection
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.
Summary
Adds durable-nonce support to the Solana Token-2022
ConfidentialTransferBuilderv1 (SIMD-0296/0385) path, closing the gap wherebuildV1()did not injectAdvanceNonceAccount(required bycompileTransactionMessagefor durable nonce) even thoughV1TransactionBuilderalready had the working pattern.This unblocks wallet-platform's confidential-transfer (CT) v1 submission path (CHALO-1091): the server builds CT transactions with durable nonce, and the gas-tank nonce authority co-signs in message-signer order.
Changes
modules/sdk-coin-sol/src/lib/confidentialTransferBuilder.tsbuildV1()now mirrorsV1TransactionBuilder:AdvanceNonceAccountfirst when durable nonce is set (nonce address + nonce authority).nonceInfoon the metadata transaction (matching the v0 model).modules/sdk-coin-sol/test/unit/transactionBuilder/confidentialTransferV1.tsAdvanceNonceAccountdiscriminator (4) as the first instruction, andverifyV1Signaturesround-trip.Test plan
npx tsc -p tsconfig.json --noEmit— clean.Refs: CHALO-1091