This guide demonstrates how developers can interact with rollups from their code. We’ll cover connecting to the Elder testnet, preparing transactions, and sending them to the rollup.

Elder.js Documentation

Official Elder.js documentation for rollup interactions

Join the Community

Get support and connect with other builders
Shib Alpha Layer provides seamless rollup interaction through the Elder testnet, enabling developers to connect, prepare transactions, and send them to rollups with instant confirmations.

Connect to Elder Testnet

The first step is to establish a connection to the Elder testnet. This involves signing a message with your Ethereum wallet to derive your Elder address and public key.

Basic Connection Setup

Understanding the Connection Process

When connecting to the Elder testnet, the function:
  1. Signs a message using your Ethereum wallet
  2. Derives your Elder address and public key from the signature
  3. Returns connection details including both Ethereum and Elder addresses
The elder_address and elder_public_key are crucial as they’ll be used when building raw Elder transactions.

Prepare Ethereum Transaction Object

Before sending a transaction to the rollup, you need to prepare an Ethereum transaction object. This can be a PreparedTransactionRequest, PopulatedTransactionRequest, ContractTransaction, or any TransactionLike object.
You can prepare transactions for any contract interaction, token transfer, or other operations supported by the rollup.

Send Elder Transaction

Once you have prepared your transaction, you can send it to the Elder network using the following code:

Using the sendTransaction Function

To send your prepared transaction to the rollup:
Transactions are confirmed in seconds with instant inclusion finalities, providing a seamless user experience.

Complete Example

Here’s how you might use these functions together in a complete workflow:

Environment Variables

Make sure to set up the following environment variables for your application:
These variables are essential for configuring the connection to the Elder network and your specific rollup. Ensure they are properly set before attempting to connect.

Use with Viem

If you’re using Viem instead of Ethers, you can convert your Viem wallet client to an Ethers signer:
This approach allows you to use your existing Viem setup while still leveraging the Elder.js functions that expect an Ethers signer.

Key Benefits of Rollup Interaction

Instant Confirmations

Transactions confirmed in seconds with instant inclusion finalities

Enhanced Interoperability

Seamless cross-chain operations with improved security

Single Account System

Use your existing wallet to interact with multiple rollups

Developer Friendly

Simple APIs and comprehensive documentation for easy integration

Next Steps

Now that you understand how to interact with your rollup, you can:
  • Develop smart contracts for your rollup
  • Create dApps that leverage the rollup’s capabilities
  • Integrate with existing Ethereum applications
  • Build cross-chain applications using the enhanced interoperability features

Interacting with rollups on Shib Alpha Layer provides instant confirmations, enhanced interoperability, and a unified account system that simplifies development. Join the ecosystem that’s bringing Web2 simplicity to Web3 innovation!