Chaingpt org official solana

From jiayaoqijia/cryptoskill · View interactive version

Chaingpt org official solana is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Solana signing foundation — build unsigned native SOL and SPL token transfers. Custody-free. Returns base64 VersionedTransaction the user signs externally with Phantom / Backpack / Solflare / hardware wallet. The foundation that Drift / Marginfi / Kamino signed actions build on.

How to use this skill

Skill file

Solana signing

This skill exposes a small foundation for building unsigned Solana transactions from chat. The plugin never sees a Solana private key — every state-changing tool returns a base64-encoded VersionedTransaction that the user signs in their wallet.

When to use this skill

What the surface is

Custody model

Identical to the rest of the plugin: custody-free. The plugin builds the transaction; the user signs it elsewhere. There is no MCP tool that accepts a secretKey, mnemonic, or seedPhrase parameter, and a unit test asserts this surface contract so future additions cannot accidentally break it.

There is no autonomous Solana signer: the user signs every Solana transaction in their own wallet. (The agent wallet's only signer is an ERC-4337 session key on EVM chains.)

Mainnet safety gate

When network=mainnet, the build tool refuses unless acknowledgeMainnet=true is also passed. The refusal message lists what to verify before re-call (recipient address, amount, mint, network). This matches feedback_mainnet_default: mainnet is the target, but mainnet transactions require an explicit ack.

Typical flow

User: "Build a 0.5 USDC transfer from 7uDsTC...EUd to 9WzDXw...WWM on mainnet"
Agent: chaingpt_solana_build_transfer_tx({
  from: "7uDsTC1u4eRkxsfvQHvi3vCSqGBHc4uS9wpYbobcdEUd",
  to:   "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  amount: "0.5",
  mint:  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",  // USDC mint
  network: "mainnet",
  acknowledgeMainnet: true
})
→ returns:
  - decoded summary (from ATA, to ATA, amount in base units, decimals)
  - the base64 VersionedTransaction
  - the blockhash + lastValidBlockHeight
  - next-step instructions for the signer
User: paste base64 into Phantom → review → sign → submit.

RPC endpoints

Default public RPC fallback per network:

| Network | Endpoints |

|----------|---------------------------------------------------------------|

| mainnet | api.mainnet-beta.solana.com → solana-rpc.publicnode.com |

| devnet | api.devnet.solana.com |

| testnet | api.testnet.solana.com |

Override via SOLANA_RPC_URL env var (Helius / QuickNode / Triton recommended for production loads).

Why `TransferChecked` instead of `Transfer`

The classic SPL Token program has two transfer instructions:

We always emit TransferChecked. The mint/decimals check prevents an attacker from swapping an unrelated ATA into the destination slot to redirect funds.

What this skill does NOT do (yet)

When you build those follow-ups, the pattern is:

  1. Import buildVersionedTransaction, serializeUnsigned, makeConnection, parseAddress from lib/solana-sign.ts.
  2. Build the protocol-specific TransactionInstruction[] (account derivation + IDL-encoded data).
  3. Call buildVersionedTransaction({ payer, instructions, connection }).
  4. Return serializeUnsigned(tx) plus a decoded summary.
  5. Gate any mainnet build behind acknowledgeMainnet:true.
  6. Add a vitest with mocked Connection.getLatestBlockhash so the test never touches the network.

Reference

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.