solana-kit-migration

Guides migration from @solana/web3.js v1 to @solana/kit with API mappings and analysis scripts.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill solana-kit-migration-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solana-kit-migration
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/solana-kit-migration
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill solana-kit-migration-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Solana developers face uncertainty when deciding between @solana/web3.js (v1) and @solana/kit, and migrating existing codebases involves breaking API changes, async keypair handling, BigInt conversions, and Anchor incompatibility risks. ## Core Features & Use Cases - Migration Analysis: Scans a codebase with shell and Node scripts to count v1 patterns (Connection, Keypair, PublicKey, Transaction) and classify migration complexity as low, medium, or high. - API Mapping Reference: Provides side-by-side v1-to-Kit conversions for RPC calls, keypairs, transactions, subscriptions, and program instructions. - Edge Case Handling: Documents gotchas like BigInt JSON serialization, missing .send() calls, async keypair generation, and hybrid Anchor setups using @solana/compat. - Use Case: A developer with an existing Solana dApp runs the analyzer, discovers 120 migration points and an Anchor dependency, and receives a recommendation to use a hybrid approach with @solana/compat instead of a full rewrite. ## Quick Start Analyze my Solana project and tell me whether I should migrate from @solana/web3.js to @solana/kit.

Frequently Asked Questions about solana-kit-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from @solana/web3.js to @solana/kit?

Replace Connection with createSolanaRpc, PublicKey with address(), Keypair with async createKeyPairSignerFromBytes, and Transaction classes with pipe()-based createTransactionMessage composition. Run the analyze-migration.sh script to count migration points and get a complexity recommendation first.

Should I use @solana/kit or @solana/web3.js for a new project?

Use @solana/kit for new projects without Anchor dependencies, since it offers tree-shaking, smaller bundles, and faster crypto operations. Stay on @solana/web3.js v1 if you depend on Anchor, which does not support Kit yet.

Does Anchor work with @solana/kit?

No, Anchor currently requires @solana/web3.js v1 and does not support Kit natively. Use a hybrid approach with @solana/compat to bridge types, keeping v1 for Anchor program calls and Kit for non-Anchor operations.

Why does my @solana/kit RPC call return a pending object instead of data?

Kit RPC methods return a request builder that requires a .send() call to execute. Write await rpc.getBalance(address).send() and destructure the result as { value } to get the actual balance.

How do I fix BigInt JSON serialization errors after migrating to Kit?

Kit uses native BigInt for all lamport amounts, which JSON.stringify cannot serialize by default. Convert values with .toString() before serialization or pass a custom replacer function that converts bigint values to strings.

What is @solana/compat used for in gradual migrations?

@solana/compat is an interoperability layer that converts between v1 and Kit types, such as fromLegacyPublicKey, toLegacyPublicKey, and fromLegacyKeypair. It enables gradual, module-by-module migration when a full rewrite is impractical.