Cosmos App Chain -> Solana

Halt the chain and claim on Solana

Use this runbook when you are retiring a live Cosmos SDK or CosmWasm chain and moving users, assets, governance, and product infrastructure onto Solana. It follows the real migration sequence: decision-making, shutdown operations, token architecture, address linking, Solana launch, program migration, user comms, and decommissioning.
الترحيل في لمحة
تعامل مع هذا الترحيل على أنه إيقاف وإعادة إطلاق منسّقان.
ترحيل سلسلة تطبيقات Cosmos ليس ترقية روتينية للسلسلة. فأنت تُخرج من الخدمة سلسلة Layer 1 عاملة، وتحافظ على الالتزامات التي كانت تحتفظ بها، وتعيد إطلاق المنتج والرمز والحوكمة والعمليات على سولانا.
01
خطّط للإيقاف قبل إعادة الكتابة
يجب حسم الحوكمة والتنسيق مع المدققين ومواعيد قطع IBC وإشعار المنصات واستراتيجية الأرشفة قبل اعتماد برامج الوجهة بصيغتها النهائية.
02
افصل ترحيل الرمز عن ترحيل المنتج
ينبغي أن تكون قواعد اللقطة ومسارات المطالبة وآليات الجسر وسياسة الرموز غير المطالَب بها مشاريع واضحة، لكل منها مسؤولوها ومشغّلوها ودلائل الدعم الخاصة بها.
03
أطلق على سولانا كما لو كان انتقالًا إلى بيئة الإنتاج
يجب أن يتم إطلاق سك الرمز والبيانات الوصفية وصلاحيات الخزائن وبرنامج المطالبة والسيولة والحوكمة ومراسلات المستخدمين وفق تسلسل يمكنك التدرّب عليه والدفاع عنه.

1. Before You Start

This runbook covers the halt-and-claim path: the Cosmos chain stops, and holders claim their balances on Solana. If the chain needs to keep running, follow the IBC bridge guide instead. The app chain overview compares the two paths and maps Cosmos concepts to Solana.

Prerequisite: the code-level work of rewriting CosmWasm contracts and custom modules as Solana programs is covered in the CosmWasm migration guide. The phases below assume that rewrite is planned or underway.

On Solana, a program is executable onchain code, an account is the durable state that programs read and write, and a transaction is the signed bundle of instructions that asks programs to do work.

Sentinel is a reference implementation of this path. Its design choices appear throughout the runbook and are summarized in the case study.

2. المرحلة 0: التخطيط والإعلان

التوافق الداخلي

نفّذ هذه الخطوات قبل صدور أي رسالة علنية.

  • اتفقوا داخليًا على نافذة زمنية مستهدفة للإيقاف. تسعون يومًا من الإعلان العلني حد أدنى معقول.
  • احصر كل أصل يملكه المستخدمون: الأرصدة السائلة، والأرصدة المرهونة، وعمليات فك الربط، ومراكز LP، ورموز NFT، والاستحقاق التدريجي، وحسابات الضمان، وأرصدة العقود.
  • صنّف كل عقد ووحدة ضمن أحد ثلاثة مسارات: ترحيل، أو استبدال، أو إيقاف.
  • راجع كل قناة IBC نشطة وحدد مشغّلي relayers الخارجيين وفرق الأطراف المقابلة.
  • تواصل بشكل خاص مع كبار مشغّلي validators قبل الإعلان العلني.
  • امنح المنصات المدرجة مهلة إشعار كافية قبل بدء نافذة الترحيل العلنية.
  • أعدّ خطة تواصل منسقة مع المستخدمين: إعلانات متزامنة عبر قنواتك مع إشعارات ثابتة على موقعك وتطبيقاتك ومستكشفات الكتل، يرتبط كل منها بصفحة معلومات رئيسية عن الترحيل. تُعد خطة التواصل عبر كل قناة في المرحلة 6 القالب الذي ينبغي أن تبدأ بملئه الآن.
  • صُغ مقترح الحوكمة ودليل الإيقاف التقني بالتوازي.
  • حدد ما ستحتاجه بوابة الترحيل لربط الهوية وتقديم المطالبات.

حوكمة المجتمع

حتى إن كان بإمكان الفريق تنسيق إيقاف validators دون حوكمة رسمية، فإن تجاوز الحوكمة يهدم الثقة عادةً. النهج السليم تشغيليًا هو نشر نقاش لجسّ النبض (temperature check) أولًا، ثم إجراء حوكمة ملزم لاحقًا.

ينبغي أن يشرح المقترح الأصل الجديد على سولانا بوضوح. تتحول معظم الرموز القابلة للاستبدال المرحّلة إلى رموز SPL: وهي رموز تديرها token programs في سولانا بدلًا من سلسلة Cosmos المتقاعدة الخاصة بك.

Text
Title: [Deprecation Proposal] Shut Down CHAIN_NAME and Migrate to Solana

Summary:
The team proposes to sunset CHAIN_NAME on DATE, migrate TOKEN to Solana as an SPL token,
and redirect development resources to the Solana ecosystem.

Rationale:
- Security, liquidity, ecosystem, or product fit reasons
- Data supporting the decision

Migration plan:
- Token migration architecture
- Smart contract migration path
- Timeline and exchange coordination
- Unclaimed token policy

الجدول الزمني الموصى به

Text
Day 0:   Public announcement and forum proposal
Day 14:  On-chain governance vote opens
Day 21:  Governance vote closes
Day 28:  Migration portal opens and exchange work begins
Day 90:  Chain halts at the pre-announced block height
Day 180: Optional migration-claim deadline

ينبغي للمجتمعات الكبيرة أن تميل إلى نوافذ أطول لا أقصر.

3. Phase 1: Cosmos Chain Shutdown (Technical)

Set the halt block height

Choose a height far enough in the future that validators, exchanges, relayers, and users can act. Every validator should configure the same halt height.

TOML
# ~/.chain/config/app.toml
halt-height = 12345678
Bash
chaind start --halt-height=12345678

The halt block is committed. Nodes stop before processing the next block. If the chain is on an older Cosmos SDK version, insist on exact binary consistency across validators before the halt.

Export final state

Bash
chaind export --height=12345678 --for-zero-height > final_state.json

Use the resulting state as the canonical record for balance extraction and later audit work.

Bash
cat final_state.json | jq '.app_state.bank.balances' > final_balances.json
cat final_state.json | jq '.app_state.staking.delegations' > final_delegations.json
cat final_state.json | jq '.app_state.staking.unbonding_delegations' > final_unbonding.json

Compute the canonical snapshot

For a 1:1 token migration, merge bank balances, delegations, unbondings, module balances you intend to honor, and any contract-side token balances you promise to preserve.

Python
# snapshot_merge.py - pseudocode
snapshot = {}

for entry in balances:
    addr = entry["address"]
    amount = sum(c["amount"] for c in entry["coins"] if c["denom"] == "utoken")
    snapshot[addr] = snapshot.get(addr, 0) + int(amount)

for delegation in delegations:
    addr = delegation["delegator_address"]
    tokens = shares_to_tokens(delegation["shares"], delegation["validator_address"])
    snapshot[addr] = snapshot.get(addr, 0) + int(tokens)

for entry in unbonding:
    addr = entry["delegator_address"]
    for ubd in entry["entries"]:
        snapshot[addr] = snapshot.get(addr, 0) + int(ubd["balance"])

Do not trust the pipeline until totals reconcile to the supply you intend to preserve. Sentinel's sentinel-snapshot tool is a Go reference for this step: before it reads balances, it checks the halt header against a commit signed by more than two-thirds of the validator set and recomputes the state root, then it reconciles every leaf plus the treasury against total supply at the halt height. It also flags module and IBC-escrow addresses whose balances would otherwise end up unclaimable.

Handle IBC channels

  • Pause relayers before the halt so no new packets enter the queue.
  • Drain or timeout in-flight packets intentionally.
  • Notify counterparty chains and relayer operators with real dates, not vague warnings.

Transfer (ICS-20) channels cannot be force-closed with close-init; the transfer module rejects user-initiated closes. Wind them down by pausing relayers and letting in-flight packets time out, then coordinate counterparties on the halt date.

Validator offboarding

  • Ask validators to archive their final node state and signing-state files.
  • Pay or reconcile any final commission or support obligations before they disappear.
  • Publish a formal validator offboarding memo with the halt height, export steps, and archive expectations.
Text
Subject: Validator Offboarding - Action Required

The chain will halt at block HEIGHT on DATE.
1. Configure halt-height=HEIGHT
2. Export final state after halt
3. Archive your node data to cold storage
4. Confirm your final commission destination

4. Phase 2: Token Migration Architecture

For most chain shutdowns, the cleanest design is a snapshot-driven Merkle tree claimer on Solana. Instead of keeping a bridge alive after the Cosmos chain halts, you finalize balances off-chain, commit one Merkle root on Solana, fund a claim vault, and let each user prove their entitlement once.

A Merkle root is a compact cryptographic commitment to the full claims file. A claim vault is a token account funded with the migration supply. The claim program verifies each proof, releases the right SPL token amount, and records that the claim is complete. A working reference is available in the example Merkle token claimer.

Recommended architecture: Merkle tree claimer

  1. Take a final Cosmos snapshot and normalize the balance dataset you intend to honor.
  2. Convert each claim into a deterministic leaf. With pre-registration, the leaf names the Solana recipient: {index, recipient, amount}. With signature claims, it names the Cosmos account instead: {index, cosmos_address, amount}. See address linking.
  3. Build the Merkle tree off-chain and publish the root plus the full snapshot artifact for community review.
  4. Deploy a Solana claim program that stores the Merkle root, vault authority, token mint or token-vault accounts, and claim window.
  5. Fund the claim vault with the full migration supply.
  6. Require each claimant to submit their amount, leaf index, and Merkle proof, then mark that leaf as claimed in onchain state and transfer their SPL tokens.

What the Solana claimer should own

In the Rust-style structs below, Address is the current Solana SDK type for an address: the base58-encoded public key of an account, program, mint, vault, or wallet. Anchor programs still name the same 32-byte type Pubkey, which is why the Anchor snippets in this guide use that name.

Rust
pub struct Distributor {
    pub merkle_root: [u8; 32],
    pub mint: Address,
    pub vault: Address,
    pub vault_authority_bump: u8,
    pub claim_window_end_ts: i64,
}

pub struct ClaimStatus {
    pub index: u64,
    pub claimed: bool,
}

A simple implementation uses one Program Derived Address (PDA) or bitmap entry per leaf index to prevent double claims. A PDA is a deterministic address controlled by a program instead of a user's private key. The claim instruction recomputes the leaf hash, verifies the Merkle proof against the stored root, transfers or mints the exact SPL amount, and then records the claim status before returning.

At large holder counts, split the claims into shards: one Merkle root and one claim bitmap per shard, with the shard derived from the Cosmos address. Sentinel uses 128 shards, each with a bitmap PDA of at most 8 KiB, which keeps proofs short and avoids one rent-paying receipt account per claim.

Rust
pub fn claim(
    ctx: Context<Claim>,
    index: u64,
    amount: u64,
    proof: Vec<[u8; 32]>,
) -> Result<()> {
    require!(!ctx.accounts.claim_status.claimed, ClaimError::AlreadyClaimed);
    require!(
        verify_proof(
            ctx.accounts.distributor.merkle_root,
            hash_leaf(index, ctx.accounts.recipient.key(), amount),
            &proof,
        ),
        ClaimError::InvalidProof
    );

    transfer_from_vault(&ctx, amount)?;
    ctx.accounts.claim_status.claimed = true;
    Ok(())
}

transfer_from_vault is where a Cross Program Invocation (CPI) happens: the claim program calls the SPL Token program to move tokens from the vault into the claimant's token account. Because the vault authority is a PDA, the program signs that CPI with the authority's seeds instead of a private key. In Anchor the transfer looks like this:

Rust
token::transfer(
    CpiContext::new_with_signer(
        ctx.accounts.token_program.to_account_info(),
        token::Transfer {
            from: ctx.accounts.vault.to_account_info(),
            to: ctx.accounts.recipient_token_account.to_account_info(),
            authority: ctx.accounts.vault_authority.to_account_info(),
        },
        &[&[b"vault_authority", &[ctx.bumps.vault_authority]]],
    ),
    amount,
)?;

If per-claim rent matters at your scale, a rent-free variant tracks spent claims in Merkle state instead of in receipt accounts. Each claim submits an exclusion proof that its leaf is not yet in a stored spent-claims root plus the updated root that includes it, the program verifies both against the same sibling path, and then swaps the root in place. The Solana Foundation's private-channel escrow program implements this pattern with a sparse Merkle tree. It is cheaper to administer and removes the rent barrier for claimants, in exchange for serializing claims on the root account and requiring your proof service to track the evolving spent set.

Why this architecture is usually better

  • You only need one canonical balance export, not a live cross-chain relay after shutdown.
  • Anyone can audit the published claims file and recompute the Merkle root before launch.
  • The on-chain program stays small: proof verification, token release, and replay protection.
  • Support operations get simpler because each failed claim is tied to a specific leaf, proof, and recipient address.

Unclaimed token policy

Policy Description Tradeoff
BurnUnclaimed balances disappear after the window.Simple but punitive.
Community treasuryUnclaimed balances move to multisig or DAO control.Flexible but politically sensitive.
Extended claim escrowHold balances for a longer claim period under a governed escrow.User-friendly but more operational work.
Permanent program escrowLeave unclaimed balances claimable in the program escrow forever, with no deadline.The least hostile to users, but the "real" circulating supply stays permanently uncertain.
Decaying claimsBuild a decay factor into the claim program: for example, 100% of the allocation for the first year, then decreasing linearly to zero by year two.Creates urgency without a hard cliff, but adds program logic and still needs a destination for the decayed remainder.

A long or permanent escrow-based claim window is usually the least hostile choice for real users.

5. Address Linking

Cosmos users usually hold Bech32-encoded account addresses backed by secp256k1 keys, while Solana wallets use base58-encoded Ed25519 public keys. Neither can be derived from the other, so every claim needs a way to prove that the person receiving tokens on Solana controls the Cosmos account in the snapshot.

Keep the layers separate in your design: Bech32 is an address format, Cosmos account keys are usually secp256k1 for transaction signing, and validator consensus keys are a different identity entirely. Do not assume a validator key or node operator identity should map to a user claim.

There are two ways to link addresses. Many migrations offer both.

Pre-registrationSignature claim
When the holder actsBefore the snapshot, on CosmosAfter the snapshot, on Solana
What the leaf containsThe Solana recipientThe Cosmos address
What the claim program checksThe signer is the recipient in the leafA secp256k1 signature from the Cosmos key over the Solana recipient
Wallet requirementAny Cosmos wallet before the haltA Cosmos wallet that signs arbitrary data (ADR-036), such as Keplr's signArbitrary
Holders who miss itNeed a fallback pathCan claim at any time the program allows

Option 1: pre-registration

Before the snapshot, let users register their Solana address on Cosmos so the migration artifact already contains the intended destination. The claim program then only checks that the signer matches the recipient in the leaf.

Example: pre-registration record

JSON
{
  "cosmos_address": "osmo1...",
  "solana_address": "7Yp...base58...",
  "snapshot_height": 12345678,
  "nonce": "migration-v1"
}

Option 2: signature claim with the Cosmos key

The holder signs a message with their original Cosmos key that names the Solana wallet to pay. The claim program recovers the secp256k1 public key from that signature, derives the Cosmos address from it, and checks the Merkle proof for that address. Nothing has to happen before the snapshot, and the transaction can be paid for by anyone, because the beneficiary is fixed by the signature.

Use the ADR-036 format that Cosmos wallets already support for signing arbitrary data. The wallet signs the SHA-256 hash of this amino JSON sign doc:

JSON
{
  "account_number": "0",
  "chain_id": "",
  "fee": { "amount": [], "gas": "0" },
  "memo": "",
  "msgs": [
    {
      "type": "sign/MsgSignData",
      "value": {
        "data": "BASE64(claim:SOLANA_BENEFICIARY:ROOTS_COMMITMENT_HEX:CLAIM_PROGRAM_ID)",
        "signer": "osmo1..."
      }
    }
  ],
  "sequence": "0"
}

The sign doc above is indented for reading. The wallet signs a different byte string: the same document as compact JSON with no whitespace, keys sorted alphabetically at every level, and data as standard base64 with padding. Your program must rebuild exactly those bytes before hashing, or valid wallet signatures will fail to verify. Check your implementation against this test vector:

Text
Payload (UTF-8):
claim:9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin:00000000000000000000000000000000000000000000000000000000000000aa:Claim1111111111111111111111111111111111111

Signer:
osmo1example

Signed bytes (compact JSON, keys sorted, data as padded standard base64):
{"account_number":"0","chain_id":"","fee":{"amount":[],"gas":"0"},"memo":"","msgs":[{"type":"sign/MsgSignData","value":{"data":"Y2xhaW06OXhRZVd2RzgxNmJVeDlFUGpIbWFUMjN5dlZNMlpXYnJycFpiOVB1c1ZGaW46MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBhYTpDbGFpbTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTE=","signer":"osmo1example"}}],"sequence":"0"}

SHA-256 of the signed bytes:
09a87f23fa7dd8b180b992efb6fd8c4f1616844e230c8cb785495b211c397ea9

Put everything the signature must commit to in the payload: the beneficiary, a commitment to the snapshot roots, and the claim program ID. Without the last two, a signature for one deployment or dataset could be replayed against another. The program side uses the sol_secp256k1_recover syscall:

Rust
// Sketch of the claim check. Helpers such as adr036_sign_doc, is_high_s,
// compress, hash160, and hash_leaf are yours to implement. adr036_sign_doc must
// return the exact compact, sorted-key bytes shown in the test vector above.
let payload = format!(
    "claim:{}:{}:{}",
    beneficiary,               // Solana wallet that receives the tokens
    hex(&roots_commitment),    // ties the signature to this snapshot
    crate::ID,                 // ties the signature to this program
);
let digest = sha256(adr036_sign_doc(&cosmos_address, payload.as_bytes()).as_bytes());

require!(!is_high_s(&signature), ClaimError::MalleableSignature);
let key = secp256k1_recover(&digest, recovery_id, &signature)
    .map_err(|_| ClaimError::BadSignature)?;

// A Cosmos account address is RIPEMD160(SHA256(compressed public key)).
require!(
    hash160(&compress(&key.to_bytes())) == cosmos_address_bytes,
    ClaimError::WrongSigner
);
require!(
    verify_proof(root, hash_leaf(index, &cosmos_address_bytes, amount), &proof),
    ClaimError::InvalidProof
);

Details that matter in production:

  • Reject high-S signatures before recovery so each claim has exactly one valid signature.
  • Try both recovery IDs when the wallet does not return one. Recovery is cheap compared to a failed claim.
  • Handle accounts that never sent a transaction. Their public key is not on chain, so the snapshot cannot include it. Commit a placeholder key in the leaf and accept any recovered key whose hash matches the address.
  • Accounts without a usable key, such as module accounts and IBC escrow addresses, cannot sign. Route their balances to a treasury instead of leaving them unclaimable.

Sentinel's distributor implements this flow end to end, including sharded roots and vesting. See sentinel-programs/programs/distributor and the distributor_adr036 crate in sentinel-solana.

6. المرحلة 3: الإطلاق على سولانا

إنشاء رمز SPL

يتضمن رمز SPL حساب mint account يحدد خانات الكسور العشرية للرمز وضوابط المعروض والجهات المخوّلة. طابِق دقة الرمز المرحَّل عن قصد، وقرر ما إذا كنت بحاجة إلى Token Program القياسي أو Token Extensions لميزات مثل رسوم التحويل والبيانات الوصفية وضوابط الامتثال.

Bash
solana-keygen new --outfile migration-authority.json
solana config set --keypair migration-authority.json
solana config set --url mainnet-beta

spl-token create-token --decimals 6 > token_address.txt

إن mainnet-beta هو عنقود الإنتاج في سولانا. جرّب الإطلاق الكامل على validator محلي أو على devnet قبل تشغيل هذه الأوامر فعليًا.

بما أنك ستنشر برنامج مطالبة على أي حال، ففكّر في إنشاء mint بصورة حتمية من ذلك البرنامج بدلًا من keypair عبر CLI: هيّئ mint عند PDA مع جهة مخوّلة يتحكم فيها البرنامج، بحيث يُشتق عنوان mint من برنامجك ويصبح تسليم الصلاحيات منطقًا صريحًا في البرنامج وليس خطوة تشغيلية. يوضح مثال برنامج create-token إنشاء mint من شيفرة البرنامج.

إضافة البيانات الوصفية

من دون البيانات الوصفية للرمز، ستعرض المحافظ والمجمِّعات عنوان mint غامضًا. عالج ذلك قبل توجيه المستخدمين إلى السلسلة الجديدة.

أرفقها باستخدام برنامج Metaplex Token Metadata الذي يعمل مع mints من كلٍّ من Token Program وToken-2022، أو استخدم امتداد البيانات الوصفية المدمج إذا أنشأت mint باستخدام Token-2022. وإذا كنت تنفّذ الإطلاق عبر سكربت بدلًا من CLI، فإن إنشاء Token Mint يشرح الخطوات نفسها برمجيًا ويربط بخياري البيانات الوصفية في النهاية. ويشير كلا المسارين إلى ملف JSON تستضيفه:

JSON
{
  "name": "Your Token Name",
  "symbol": "TKN",
  "description": "Migrated from CHAIN_NAME Cosmos chain to Solana.",
  "image": "https://your-metadata-server.com/logo.png",
  "external_url": "https://yourproject.com"
}

سكّ المعروض وقفل الصلاحيات بشكل مدروس

Bash
spl-token create-account MINT_ADDRESS
spl-token mint MINT_ADDRESS 1000000000
spl-token authorize MINT_ADDRESS mint --disable
spl-token authorize MINT_ADDRESS freeze --disable

يمكن للجهة المخوّلة بالسك إنشاء المزيد من الرموز، ويمكن للجهة المخوّلة بالتجميد تجميد حسابات token account. لا تلغِ هذه الصلاحيات إلا بعد التحقق من المعروض وحفظ الخزنة والموقّعين التشغيليين. تعطيلها إجراء لا رجعة فيه.

Multisig وقوائم الرموز والسيولة

  • انقل التحكم في الخزينة وخزنة الترحيل إلى multisig مثل Squads.
  • اجسر أصول الخزينة التي تحتاجها في اليوم الأول: ينتقل USDC الأصلي من Cosmos (Noble) إلى سولانا عبر بروتوكول النقل عبر السلاسل من Circle، أما الأصول الأخرى فتحتاج إلى مسار جسر راسخ سبق أن جرّبته بتحويل صغير أولًا.
  • موّل المحافظ التشغيلية بـ SOL على mainnet لعمليات النشر وrent ودافعي الرسوم قبل أسبوع الانتقال، وراجع صفحة المنح والتمويل لدى مؤسسة سولانا للاطلاع على برامج دعم المنظومة.
  • قدّم البيانات الوصفية للرمز إلى المنصات والسجلات التي سيعتمد عليها مستخدموك.
  • أطلق منصة سيولة مؤثرة واحدة على الأقل قبل بدء اندفاع الترحيل.

7. Phase 4: Smart Contract / Program Migration

The contract rewrite itself is covered in the CosmWasm migration guide. Operationally, this phase is about deciding which live chain state must survive and how it will be represented as Solana accounts.

Categorize every contract and module

Text
Category A - Migrate with state
Category B - Migrate logic only
Category C - Deprecate
Category D - Replace with native Solana equivalents

For anything in Category A, design the target account layout before writing migration jobs. Solana programs are stateless executables, so durable balances, positions, schedules, and configuration must live in accounts owned by the relevant program.

Vesting migration

Financial obligations such as vesting schedules need exact treatment. Export them explicitly and initialize equivalent Solana state, not ad-hoc spreadsheets. In Anchor, a Rust framework for Solana programs, #[account] marks a struct that will be serialized into a Solana account.

Bash
cat final_state.json | jq '.app_state.wasm.contracts' |   python3 extract_vesting.py > vesting_positions.json
Rust
#[account]
pub struct VestingSchedule {
    pub recipient: Pubkey,
    pub total_amount: u64,
    pub start_timestamp: i64,
    pub end_timestamp: i64,
    pub claimed_amount: u64,
    pub bump: u8,
}

The program around that state needs two instructions: a funding instruction that locks the tokens and a claim instruction that releases only what time has unlocked.

  • create_new_vest: validate the schedule before writing it: amounts above zero, start_timestamp before end_timestamp, and a recipient that matches the exported Cosmos data. Initialize the schedule PDA from stable seeds such as [b"vesting", recipient], store the bump, set claimed_amount to zero, and transfer the full allocation into a vault owned by the program's PDA authority in the same transaction, so a schedule can never exist unfunded.
  • claim_vest: require the claimant to sign and match schedule.recipient, read the current time from the Clock sysvar, and compute the vested amount with checked math: linear interpolation between the timestamps, plus whatever cliff rules you exported. Pay out vested - claimed_amount, update claimed_amount before transferring from the vault via the PDA signer, and reject claims where nothing new has vested.

You do not have to design this from scratch. The Solana developer bootcamp's token-vesting project is a buildable Anchor program with exactly this instruction shape (create the schedule accounts, then a Clock-driven claim with cliff handling), and Bonfida's token-vesting program is a Kudelski-audited implementation deployed on mainnet. If your exported schedules are standard cliff-plus-linear shapes, also consider loading them into an existing vesting product such as Jupiter Lock or Streamflow instead of operating a custom program.

If vesting accounts are part of the token migration, you can also carry them in the claim itself. Sentinel's leaves hold a liquid amount, a locked amount, and a hash of the vesting schedule. At claim time the program pays the liquid part, checks the schedule against the hash, and opens a vesting account for the locked part, which anyone can trigger to release unlocked tokens to the beneficiary. Large schedules are uploaded in chunks to a buffer account first, because they do not fit in one transaction.

NFT migration

CW721 metadata is closer to Solana's than it looks. A CW721 token points at off-chain JSON through token_uri (or stores the same fields on-chain in its metadata extension), and those fields follow the OpenSea-style standard. Metaplex JSON shares the core fields, so name, description, image, animation_url, external_url, and attributes usually carry over unchanged; a well-formed existing token_uri can often be reused as-is.

Map the differences deliberately: Metaplex JSON also expects a category and a properties.files array with a URI and MIME type per file; royalty configuration moves out of the JSON into onchain royalty settings such as the Metaplex Core Royalties Plugin; and CW721-only fields like background_color and youtube_url have no direct equivalent. Re-host any metadata or media you do not control on durable storage before the source chain halts.

  • Pick the Solana NFT or digital-asset standard before writing claim logic. For large collections, Bubblegum compressed NFTs keep mass minting affordable (on the order of 5 SOL all-in for a million assets), but wallets and marketplaces read them through DAS-API indexers rather than plain account fetches, so confirm your target tooling supports them first.
  • Preserve provenance and identifiers intentionally where external integrations depend on them.
  • Distribute with the same Merkle pattern as the token claimer: snapshot CW721 ownership as {contract, token_id, owner, solana_address} leaves, publish the root, and let each owner claim a mint of the corresponding Solana asset (for compressed assets, the claim instruction mints via CPI into Bubblegum).

DeFi positions

Liquidity positions: snapshot LP balances and the asset ratios you need to honor at migration time. Decide whether users receive migrated LP positions, underlying assets, or a fresh liquidity program entry on Solana.

Lending and borrowing: snapshot collateral, liabilities, and risk state. Resolve bad debt and policy exceptions before migration so you do not import insolvency into a new environment.

Delegation and rewards: define how staking, pending unbonding, and accrued rewards map into the Solana-side product.

What usually does not migrate 1:1

  • Validator operations: your app no longer owns a dedicated validator set after the move.
  • IBC channels and client state: these need a new cross-chain integration plan rather than a literal port.
  • Module internals: Cosmos module parameters and store layouts rarely map cleanly into Solana account layouts.
  • Indexer assumptions: dashboards and support tooling usually need a new read model built around Solana accounts and logs.

Solana constraints to plan around

  • Programs are stateless: durable migration data must live in accounts, not inside the executable.
  • Account allocation has cost: account sizing, rent, and resize strategy affect both migration design and user experience.
  • Transaction envelopes are bounded: large claims, proof payloads, or fan-out jobs may need to be chunked across multiple instructions or batches.
  • Compute per transaction is finite: expensive verification or multi-program flows need budgeting and profiling before production rollout.
  • Operational jobs must be restartable: large migrations should assume retries, partial completion, and resumable execution.
  • Read models often move off-chain: dashboards, audits, and support tools usually depend on indexed account data rather than on-chain query entrypoints.

8. المرحلة 5: هجرة الحوكمة

تُعد Realms الواجهة الرئيسية لإدارة المنظمات اللامركزية المستقلة (DAO) وخزائنها على سولانا. وهي مبنية فوق SPL Governance، وهو برنامج الحوكمة في سولانا، وتوفر لك مسارات عمل للمقترحات، وإعدادات التصويت، وخزائن DAO، وتنفيذًا محكومًا للإجراءات مثل تحويلات الخزينة وترقيات البرامج.

إذا كانت سلسلة Cosmos الخاصة بك تستخدم الحوكمة على السلسلة للإشارة إلى التوجهات أو التحكم بالخزينة أو الموافقة على الترقيات، فإن الوجهة الأقرب في سولانا هي عادةً Realm مع خزينة محكومة واحدة أو أكثر. والهجرة ليست مطابقة تمامًا: فحوكمة Cosmos تتحكم في حالة السلسلة، بينما تتحكم الحوكمة في سولانا عادةً في الأصول وصلاحيات البرامج وسير العمل التشغيلي.

نموذج Cosmos الوجهة في سولانا
المقترحات النصيةSnapshot أو أي عملية حوكمة أخرى خارج السلسلة
تغييرات المعلماتبرنامج إداري محكوم أو صلاحية برنامج يتحكم بها متعدد التوقيعات
مقترحات الترقيةSquads أو مسار مشابه لصلاحية الترقية المتحكَّم بها
مجمّع المجتمعRealms أو متعدد التوقيعات للخزينة

Realms مقابل Squads

يوصف كلاهما بأنه إدارة للخزينة، مما يجعل الخلط بينهما سهلًا. لكنهما يحلّان مشكلات مختلفة:

  • تمثل Realms حوكمة موزونة بالرموز. تأتي قوة التصويت من رموز المجتمع (أو المجلس) المودعة في الـRealm، ويصوّت حاملو الرموز على المقترحات، وتنفّذ المقترحات التي تم اعتمادها تعليماتها على السلسلة. وهي الأقرب إلى وحدة x/gov ومجمّع المجتمع في Cosmos.
  • أما Squads فهي محفظة متعددة التوقيعات. تعتمد مجموعة صغيرة ومحددة من مفاتيح الأعضاء المعاملات وفق عتبة M-من-N، دون أي تصويت بالرموز. وهي الأداة المناسبة للحفظ التشغيلي: العمليات اليومية للخزينة، وصلاحية ترقية البرامج، وصلاحيات الإصدار (mint) أو التجميد (freeze).

ينتهي الأمر بمعظم الفرق باستخدام كليهما: فالقرارات على مستوى المجتمع وخزينة المجتمع تكون في Realm، بينما تكون الصلاحيات التشغيلية والأموال العاملة في محفظة Squads متعددة التوقيعات تخضع بدورها لمساءلة الـDAO.

كيفية هجرة الحوكمة بسلاسة

  • أنشئ الـDAO الجديد في Realms قبل إطلاق الرمز أو بالتزامن معه، حتى لا يبقى التحكم بالخزينة وصلاحية البرنامج بيد موقّع مؤقت لفترة أطول من اللازم.
  • حدّد ما إذا كانت قوة الحوكمة ستأتي من رمز المجتمع المهاجَر، أو من رمز المجلس، أو من هيكل مزدوج يتولى فيه مجلس أصغر العمليات العاجلة.
  • انقل أصول الخزينة وصلاحية الإصدار وصلاحية التجميد وصلاحية الترقية إلى حسابات محكومة عن قصد بدلًا من تركها في محافظ النشر.
  • أعد صياغة أنواع مقترحات Cosmos المتكررة كإجراءات صريحة في سولانا: تحويلات الخزينة، وتحديثات المعلمات عبر البرامج الإدارية، وترقيات البرامج عبر التنفيذ المحكوم.

المطابقة العملية

صلاحية الترقية هي الموقّع المسموح له باستبدال الشيفرة التنفيذية لبرنامج سولانا القابل للترقية. ويتحول مقترح ترقية البرنامج في Cosmos عادةً إلى مقترح ترقية برنامج في سولانا بعد نقل هذه الصلاحية إلى الحوكمة. أما قرارات الخزينة ومجمّع المجتمع فتتحول عادةً إلى مقترحات خزينة في Realms تنفّذها محافظ محكومة.

الخيار التصميمي الأهم هو من يحق له الاقتراح ومن يحق له النقض. تبدأ كثير من عمليات الهجرة بـRealm يتحكم فيه مجلس من أجل الأمان، ثم تتوسع نحو تصويت أوسع بالرموز بعد استقرار الرمز والخزينة وصلاحيات البرامج على سولانا.

9. Phase 6: User Migration & Communication

Communication plan

This is the plan you drafted during planning and announcement, now running against real dates. Day 0 is the public announcement.

Channel Timing Purpose
Blog postDay 0Full rationale, timeline, and migration mechanics
Discord, Telegram, XDay 0Short-form announcement and reminder cadence
EmailDay 0Direct notice to known users and partners
Site, app, and explorer bannersDay 0 to haltPersistent countdown and a link to the canonical migration info page
Validator and exchange outreachBefore public launchOperational heads-up and cutover coordination

Migration portal requirements

  • Connect Cosmos and Solana wallets in the same flow. On the Solana side, wallet-adapter is the established React integration, and the @solana/kit react-app example shows a complete connect and sign-in flow built on the newer wallet-standard hooks.
  • Show eligibility and claimable amount from the canonical snapshot.
  • Support your chosen address-linking option: show pre-registered destinations, or request an ADR-036 signature from the Cosmos wallet for signature claims.
  • Provide status tracking, transaction signatures, and a user-visible audit trail.

The portal is the frontend over the claim program from Token Migration Architecture: it looks up the user's leaf in the published claims file, fetches the Merkle proof, submits the claim transaction, and surfaces the resulting signature as the audit trail.

Exchange coordination

Custodial platforms need the new mint address, conversion ratio, cutover date, test transaction, and a real technical contact. Large exchanges usually need more notice than your community does.

10. المرحلة 7: إيقاف تشغيل بنية Cosmos التحتية

احصر كل شيء أولًا

في سولانا، تتيح خدمات RPC الوصول إلى بيانات الحسابات والمعاملات للمحافظ والمفهرسات ولوحات المعلومات وأدوات الدعم. أبقِ ما يكفي من بنية Cosmos التحتية لـRPC وLCD وgRPC ومستكشف الكتل قيد التشغيل ليتمكن المستخدمون من التحقق من السجل التاريخي بينما يصبح المنتج على سولانا هو المصدر المرجعي.

Text
Validators:
  - primary validator
  - sentry nodes
  - seed nodes

API and RPC:
  - public RPC
  - LCD or REST
  - gRPC
  - websocket

Indexers and explorers:
  - Mintscan, Big Dipper, internal explorer

Relayers:
  - Hermes or Go Relayer instances

Storage and DNS:
  - databases
  - snapshots
  - subdomains

الأرشفة قبل الإغلاق

Bash
tar -czf chain-archive-final-$(date +%Y%m%d).tar.gz ~/.chain/
aws s3 cp chain-archive-final-*.tar.gz s3://your-archive-bucket/

chaind export --height=HALT_HEIGHT > final_state_archive.json
gzip final_state_archive.json
aws s3 cp final_state_archive.json.gz s3://your-archive-bucket/

تكتسب هذه الأرشيفات أهميتها في الدعم القانوني ونزاعات المستخدمين وقابلية تدقيق الخزينة والتحقق التاريخي.

تسلسل إيقاف التشغيل

  1. أوقف المرحِّلات (relayers).
  2. أوقف المدققين وصدّر الحالة النهائية.
  3. أبقِ خدمات RPC أو LCD للقراءة فقط قيد التشغيل لفترة كافية ليتمكن المستخدمون والمستكشفون من الاطلاع على السجل التاريخي.
  4. أعد توجيه نطاقات التطبيقات القديمة إلى المنتج الجديد على سولانا.
  5. انقل البنية التحتية القديمة إلى حالة أرشفة أو إيقاف صريحة بدلًا من إنهائها بصمت.

تنظيف السجل وDNS

  • حدّث chain-registry والوثائق العامة لتحديد السلسلة على أنها متقاعدة.
  • أبلغ مشغّلي المرحِّلات والأطراف المقابلة.
  • أعد توجيه نطاقات RPC وLCD والتطبيقات القديمة أو أوقفها وفق جدول زمني معلن.
  • علّم معرّفات الرموز القديمة على أنها مهجورة في واجهات بيانات السوق حيثما أمكن.

11. Full Migration Checklist

Decision and planning

  • Align internally on destination chain, migration scope, and halt window.
  • Complete legal review and asset inventory.
  • Classify contracts and modules as migrate, replace, or deprecate.
  • Audit IBC channels, relayers, counterparties, validators, and exchange dependencies.

Community and communication

  • Publish a forum rationale before the binding governance action.
  • Coordinate exchanges, validators, relayers, and counterparties before the public rush.
  • Publish a repeated reminder schedule with exact dates and heights.

Cosmos shutdown

  • Set and verify the halt height across validators.
  • Pause relayers and unwind IBC where needed.
  • Export final state and derive the canonical balance and entitlement ledgers.
  • Archive node data and state artifacts to durable storage.

SPL launch and migration mechanics

  • Create the token mint, metadata, treasury accounts, and multisig control plane.
  • Confirm halt and claim is the right path; compare it with the IBC bridge.
  • Choose the address-linking option: pre-registration, signature claims, or both.
  • Define the unclaimed-token policy before launch.
  • Deploy and rehearse the claim or bridge programs.

Governance migration

  • Create the new Realm, council, and governed treasury accounts before handing over critical authorities.
  • Move mint authority, freeze authority, treasury control, and program upgrade authority into the chosen governance system.
  • Decide which actions require token voting, council approval, or multisig execution during the transition period.

Programs and product migration

  • Recreate stateful obligations such as vesting, escrow, and rewards intentionally.
  • Rewrite the frontend and support tooling for Solana wallets and transaction semantics.

Post-migration operations

  • Monitor claim completion rate and support queues.
  • Publish a post-migration report with totals, deadlines, and leftover policy.
  • Retire or archive remaining Cosmos infrastructure on a public schedule.

12. تعلّم من الفرق الأخرى

ما نجح في عمليات الترحيل السابقة

  • نوافذ الترحيل أحادية الاتجاه ذات الموعد النهائي المعلن والتنسيق مع المنصات خلقت حالة من الإلحاح وحققت معدلات إتمام مرتفعة.
  • عمليات طلب العروض أو التقييم العلنية منحت المجتمع إطار قرار حقيقيًا بدلًا من إعلان فضفاض.
  • فترات الإشعار الطويلة التي تتراوح بين 60 و90 يومًا قللت من الأرصدة العالقة وفوضى الدعم.
  • أرشفة حالة السلسلة حافظت على إمكانية التدقيق وعلى بيانات الدعم التاريخية.

ما أخفق

  • نوافذ الإشعار القصيرة تركت جزءًا كبيرًا من المعروض عالقًا.
  • تجاهل التنسيق مع المنصات ترك المستخدمين الذين تحتفظ المنصات بأصولهم خارج العملية.
  • الفرق التي لم تؤرشف الحالة فقدت سجلًا موثوقًا للأرصدة وتاريخ البروتوكول.

13. Case Study: Sentinel

Sentinel runs a decentralized VPN on its own Cosmos SDK chain and is moving it to Solana with this path. The code is open source in sentinel-solana, a monorepo of the programs, Go SDK, client, daemon, and snapshot tooling. No mainnet deployment was published when this guide was written, so check the repository for current status.

What they built

  • A dVPN program that replaces the chain's node, provider, plan, and subscription modules, with escrowed payment channels between users and nodes.
  • A distributor program that pays out the final snapshot from a Token-2022 vault, with signature claims, 128 sharded Merkle roots, a claim bitmap per shard, and vesting carried in the leaves.
  • A snapshot tool in Go that authenticates the halt state against the validator set and reconciles every leaf against total supply.
  • A Go client generated from the programs' IDLs on every build, used by the SDK and daemon through solana-go.

Design choices worth copying

  • No pre-registration. Holders sign with their Cosmos key after the snapshot, and the signature fixes the Solana beneficiary, so someone else can pay the transaction fee.
  • A setup that checks itself. The final genesis step refuses to run unless the roots match the expected commitment, the vault holds exactly the claimable total, vault plus treasury equals mint supply, and the mint and freeze authorities are already revoked.
  • Corrections only before finalization. Totals and bitmaps can be fixed during setup. After the final step, no admin instruction can change the claims. The program's upgrade authority still exists, so hold it in a multisig.
Halt a Cosmos App Chain and Claim on Solana | Solana