Writing to Network
Now that we understand how to read data from the Lucent Network, let's learn how to write data to it. We interact with the Lucent network by sending transactions made up of instructions. These transactions benefit from Lucent's Layer 2 architecture, offering faster finality and lower costs while maintaining Ethereum's security guarantees.
Let's walk through how to transfer SOL to understand how transactions work on the 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:
This code demonstrates several key concepts:
Creating an instruction (the transfer)
Building a transaction from that instruction
Sending and confirming the transaction
Using explorer to verify the result
When you run this code, you'll see the transaction signature and a link to view it in the explorer. Click the link to see details about your transaction, including its rapid confirmation time - a benefit of Layer 2 architecture.
Create a Token
Now let's try something more complex - creating a new token. This requires multiple instructions working together:
This example shows how to:
Calculate space and rent for a new account
Create and initialize a mint account
Combine multiple instructions in one transaction
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
Understand Transaction Confirmations
Transactions confirm quickly thanks to Layer 2 architecture, but they inherit Ethereum's security through rollup design. When you see "confirmed" status, it means:
The transaction has been processed by the network
The transaction is included in a rollup batch
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 the Network through transactions, you're ready to:
Deploy your own programs
Create more complex transactions
Build applications that leverage Layer 2 performance
Last updated