IntentRail: Solana transaction intent protocol (infra + dev tools)

IntentRail is a portable manifest format for Solana transaction intents. Define constraints, set preconditions, and let wallets show users exactly what they're signing.

npm install @intentrail/sdk

Signed & Verified

Ed25519 signatures with deterministic hashing. Wallets can verify intent integrity before signing transactions.

Constraints Built-in

Define max spend, min receive, allowed programs, and forbidden accounts. Enforce slippage protection at the protocol level.

Multi-SDK Support

TypeScript, Rust, and Python SDKs with identical canonicalization. Same hash output across all implementations.

Features

IntentRail provides a complete specification for expressing what a transaction should do, before it's built.

Portable JSON Manifests

Human-readable JSON format that can be stored, transmitted, and validated anywhere. No binary dependencies.

Deterministic Hashing

Canonical JSON serialization ensures the same manifest produces identical hashes across TypeScript, Rust, and Python.

Expiration & TTL

Built-in expiration timestamps and blockhash TTL. Stale intents are rejected automatically.

Execution Hints

Specify compute unit limits, priority fees, and recommended RPC endpoints. Transaction builders get all the context they need.

Network Aware

Explicit network field prevents mainnet intents from being replayed on devnet. No more cross-network mistakes.

Precondition Checks

Define required accounts, token account existence, and slot range constraints. Fail fast before wasting compute.

How it works

From intent creation to execution, every step is verifiable and auditable.

01

Create Intent

dApp creates an intent manifest with constraints, preconditions, and metadata. No transaction building yet.

02

Sign Manifest

User reviews the human-readable summary in their wallet and signs the intent hash with Ed25519.

03

Verify & Validate

Transaction builder verifies signature, checks preconditions, and ensures constraints can be satisfied.

04

Execute

Build and submit the actual transaction. If constraints are violated, execution fails safely.

Example

The SDK provides a simple, ergonomic interface for creating and verifying intents. Full TypeScript support with strict types and helpful error messages.

  • Create intents with auto-generated IDs and timestamps
  • Sign with any Ed25519 wallet adapter
  • Verify signatures and check expiration
  • Generate wallet-friendly summaries
  • Enforce constraints against observed state
example.tstypescript
1{{KEYWORD:import}} { createIntent, signIntent, verifyIntent, SOL_MINT } {{KEYWORD:from}} {{STRING:"@intentrail/sdk"}};
2
3{{COMMENT:// Create an intent manifest}}
4{{KEYWORD:const}} intent = createIntent({
5 expires_at: {{KEYWORD:new}} Date(Date.now() + 15 * 60 * 1000).toISOString(),
6 network: {{STRING:"mainnet-beta"}},
7 action: {{STRING:"swap"}},
8 actor: { wallet_pubkey: wallet.publicKey.toBase58() },
9 constraints: {
10 max_spend: [{ mint: SOL_MINT, amount: {{STRING:"1000000000"}} }], {{COMMENT:// 1 SOL}}
11 min_receive: [{ mint: USDC_MINT, amount: {{STRING:"95000000"}} }], {{COMMENT:// 95 USDC}}
12 allowed_programs: [{{STRING:"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"}}],
13 forbidden_accounts: [],
14 },
15 preconditions: {
16 required_accounts: [],
17 token_accounts: [],
18 blockhash_ttl_seconds: 60,
19 },
20 metadata: {
21 dapp: { name: {{STRING:"Jupiter"}}, url: {{STRING:"https:{{COMMENT://jup.ag"}} },}}
22 human_summary: {{STRING:"Swap 1 SOL {{KEYWORD:for}} at least 95 USDC via Jupiter"}},
23 },
24});
25
26{{COMMENT:// Sign with wallet}}
27{{KEYWORD:const}} signed = {{KEYWORD:await}} signIntent(intent, {
28 publicKey: wallet.publicKey.toBase58(),
29 sign: (msg) => wallet.signMessage(msg),
30});
31
32{{COMMENT:// Verify before execution}}
33{{KEYWORD:const}} result = {{KEYWORD:await}} verifyIntent(signed);
34{{KEYWORD:if}} (result.ok) {
35 console.log({{STRING:"Intent verified, ready to execute"}});
36}

SDKs

Consistent canonicalization and hashing across all implementations. The same intent manifest produces identical hashes in TypeScript, Rust, and Python.

TypeScript

@intentrail/sdk

Full-featured SDK for Node.js and browsers. Includes creation, signing, verification, and summarization.

npm install @intentrail/sdk

Rust

intentrail

Native Rust crate for high-performance validation. Perfect for on-chain programs and validators.

cargo add intentrail

Python

intentrail

Python SDK with CLI tools. Ideal for scripting, testing, and backend services.

pip install intentrail

Security

IntentRail is designed from the ground up with security in mind. Every manifest is verifiable, and every constraint is enforceable.

Ed25519 Signatures

Intent manifests are signed using the same Ed25519 keys as Solana transactions. Verify signer identity cryptographically.

Expiration Timestamps

Every intent has an expiration time. Stale intents are rejected automatically, preventing replay after the user's intended window.

Canonical Hashing

Deterministic JSON serialization ensures the same manifest produces identical hashes. No ambiguity, no tampering.

Allowlist/Denylist

Specify which programs may be invoked and which accounts must never be touched. Prevent unwanted interactions at the intent level.

Replay Protection

Unique Intent IDs

Each intent has a UUIDv4 identifier. Transaction builders can track which intents have been executed to prevent double-spend.

Network Isolation

The network field (mainnet-beta, devnet) is part of the signed hash. Intents cannot be replayed across networks.

Blockhash TTL

The blockhash_ttl_seconds field specifies how fresh the blockhash must be. Prevents execution with outdated chain state.

Get Started

Start integrating transaction intents into your dApp today.

Open source under MIT License. Contributions welcome.