@confidentialkit/kit
v0.2.0
Published
@solana/kit adapter for ConfidentialKit — submit confidential-transfer instruction plans.
Maintainers
Readme
@confidentialkit/kit
@solana/kit adapter for ConfidentialKit. The core @confidentialkit/sdk emits
library-agnostic InstructionDescriptors; this package maps them onto
@solana/kit instructions and submits multi-transaction plans.
Install
npm install @confidentialkit/kit @confidentialkit/sdk @solana/kitWhat's here
inspectConfidentialAccount(rpc, account, keys?)— fetch a confidential account via@solana/kitand decode/decrypt it (the network counterpart to the core SDK's offlinedecodeConfidentialAccount; the SDK itself stays network-free).toKitInstruction(descriptor, signers?)— convert anInstructionDescriptorto a kit instruction, attachingTransactionSigners to signer-role accounts.sendInstructionPlan({ rpc, rpcSubscriptions, feePayer, signers, plan })— sign and send an ordered plan (array of transactions) one at a time, awaiting confirmation between them. Returns the landed signatures.submitConfidentialTransfer({ ... })— end-to-end: generates the ephemeral context-state account signers, fetches rent, builds the plan viabuildConfidentialTransferPlan, and submits it.
Example
import { createSolanaRpc, createSolanaRpcSubscriptions } from "@solana/kit";
import { generateTransferProofs } from "@confidentialkit/sdk";
import { submitConfidentialTransfer } from "@confidentialkit/kit";
const proofs = await generateTransferProofs({ /* ... */ });
const signatures = await submitConfidentialTransfer({
rpc: createSolanaRpc(url),
rpcSubscriptions: createSolanaRpcSubscriptions(wsUrl),
feePayer,
owner,
sourceTokenAccount, mint, destinationTokenAccount,
proofs,
newSourceDecryptableAvailableBalance, // AES-encrypted new balance under the source key
});⚠️ Liveness. Landing a confidential transfer additionally requires the
@solana/zk-sdkproof version to match the target cluster's ZK ElGamal program (seedocs/FORK-FINDINGS.md). The submission mechanism is validated on a fork viascripts/kit-submit-mechanism.mjs; the proof-bearing steps are version-gated.
MIT
