Now that we understand how to read data from SOON Network, let’s learn how to write data to it. On SOON, we interact with the network by sending transactions made up of instructions, just like on Solana. However, these transactions benefit from SOON’s Layer 2 architecture, offering faster finality and lower costs while maintaining Ethereum’s security guarantees.

Let’s walk through two common operations - transferring SOL and creating a token - to understand how transactions work on SOON Network.

Transfer SOL

First, let’s send a simple SOL transfer from your wallet to another account. This requires invoking the transfer instruction on the System Program. Open this example in Solana Playground:

import {
    LAMPORTS_PER_SOL,
    SystemProgram,
    Transaction,
    sendAndConfirmTransaction,
    Keypair,
} from "@solana/web3.js";

// Get our sender's keypair from the playground wallet
const sender = pg.wallet.keypair;

// Generate a new keypair for the receiver
const receiver = new Keypair();

// Create the transfer instruction
const transferInstruction = SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: receiver.publicKey,
    lamports: 0.01 * LAMPORTS_PER_SOL,  // Transfer 0.01 SOL
});

// Add the instruction to a new transaction
const transaction = new Transaction().add(transferInstruction);

// Send and confirm the transaction
const transactionSignature = await sendAndConfirmTransaction(
    pg.connection,
    transaction,
    [sender],
);

// Log the transaction URL - note we use SOON's explorer
console.log(
    "Transaction Signature:",
    `https://explorer.fc.devnet.soo.network/tx/${transactionSignature}`
);

This code demonstrates several key concepts:

  1. Creating an instruction (the transfer)

  2. Building a transaction from that instruction

  3. Sending and confirming the transaction

  4. Using SOON’s explorer to verify the result

When you run this code, you’ll see the transaction signature and a link to view it in SOON’s explorer. Click the link to see details about your transaction, including its rapid confirmation time - a benefit of SOON’s Layer 2 architecture.

Create a Token

Now let’s try something more complex - creating a new token. This requires multiple instructions working together. Open this example in Solana Playground:

import {
    MINT_SIZE,
    TOKEN_2022_PROGRAM_ID,
    createInitializeMint2Instruction,
    getMinimumBalanceForRentExemptMint,
} from "@solana/spl-token";

// Generate a new keypair for the mint account
const mint = new Keypair();

// Calculate rent-exempt balance for mint account
const rentLamports = await getMinimumBalanceForRentExemptMint(pg.connection);

// Create instruction for new account
const createAccountInstruction = SystemProgram.createAccount({
    fromPubkey: pg.wallet.publicKey,
    newAccountPubkey: mint.publicKey,
    space: MINT_SIZE,
    lamports: rentLamports,
    programId: TOKEN_2022_PROGRAM_ID,
});

// Create instruction to initialize the mint
const initializeMintInstruction = createInitializeMint2Instruction(
    mint.publicKey,     // mint account
    2,                  // decimals
    pg.wallet.publicKey, // mint authority
    pg.wallet.publicKey, // freeze authority
    TOKEN_2022_PROGRAM_ID
);

// Combine both instructions into one transaction
const transaction = new Transaction().add(
    createAccountInstruction,
    initializeMintInstruction
);

// Send and confirm the transaction
const transactionSignature = await sendAndConfirmTransaction(
    pg.connection,
    transaction,
    [pg.wallet.keypair, mint]  // Both keypairs needed
);

console.log(
    "\nTransaction Signature:",
    `https://explorer.fc.devnet.soo.network/tx/${transactionSignature}`
);

console.log(
    "\nMint Account:",
    `https://explorer.fc.devnet.soo.network/address/${mint.publicKey}`
);

This example shows how to:

  1. Calculate space and rent for a new account

  2. Create and initialize a mint account

  3. Combine multiple instructions in one transaction

  4. Sign with multiple keypairs

When you run the code, you’ll get two links:

  • One for the transaction details

  • One for the newly created mint account

Examining these in SOON’s explorer shows how our Layer 2 processes complex transactions with multiple instructions efficiently.

Understand Transaction Confirmations

On SOON Network, transactions confirm quickly thanks to our Layer 2 architecture, but they inherit Ethereum’s security through our rollup design. When you see "confirmed" status, it means:

  1. The transaction has been processed by SOON’s network

  2. The transaction is included in a rollup batch

  3. The transaction data is available for verification

This gives you both speed and security - fast confirmations backed by Ethereum’s consensus.

Next Steps

Now that you understand how to write data to SOON Network through transactions, you’re ready to:

  • Deploy your own programs

  • Create more complex transactions

  • Build applications that leverage SOON’s Layer 2 performance

Continue to the next section to learn about deploying programs on SOON Network.