Skip to content

Latest commit

 

History

History
195 lines (165 loc) · 8.27 KB

README.md

File metadata and controls

195 lines (165 loc) · 8.27 KB

Lamina1 Chain Configuration and Integration Guide

Overview

Lamina1 is a custom Avalanche subnet using the Ethereum Virtual Machine (EVM). This guide provides essential information for integrating with the Lamina1 blockchain, including API endpoints, node setup, and other important details for exchange integration and wallet support.

Chainlist

All 4 Lamina1 Chains are on Chainlist

Lamina1 Mainnet Information

Lamina1 Testnet (Fuji) Information

Node Installation and Configuration

To run a Lamina1 node, follow the Avalanche subnet node installation documentation:

  • Node Installation Guide: Avalanche Subnet Node Installation
  • Disk Size Requirement: <50 GB is needed initially when only syncing the Lamina1 chain and the Avalanche P-Chain. <128 GB is probably safe for the next year or so. Avalanche recommends 1 TB SSD generally for validators.
  • Configuration Directory: Avalanche Node Configuration

Customizing RPC Port and Data Directory

Upgrades

The Lamina1 subnet can undergo upgrades, which require an upgrade file to be provided to avalanchego. This is done according to the standard procedure of upgrading a subnet EVM to enable new precompiles for example.

The following link from avalanche docs provides a good overview of the upgrade procedure: https://docs.avax.network/build/subnet/upgrade/upgrade-precompile

Essentially, in order to sync an upgrade, a file named upgrade.json has to be created and placed in the chain config directory of avalanchego. When using default locations, for the Lamina1 main subnet, the file should be placed at: ~/.avalanchego/configs/chains/UhReZTXT8Cqsjat9ghRtCe5kBQPQexQB5zG5Fvf3egrdYfyoJ/upgrade.json.

There have been two upgrades to the Lamina1 subnet:

  • Activated RewardManager precompile on 24 July 2024 00:00 UTC
  • Activated NativeMinter precompile on 7 November 2024 13:00 UTC

The contents of the upgrade.json file are as follows:

{
  "precompileUpgrades": [
    {
      "rewardManagerConfig": {
        "adminAddresses": ["0x444B4a012a240Bc0B898E91c70152CAeE8BE26FB"],
        "blockTimestamp": 1721779200
      }
    },
    {
      "contractNativeMinterConfig": {
        "blockTimestamp": 1730984400,
        "adminAddresses": ["0xD95b19ef90eE8862C47415d21E1E8BA0D6Ce359f"]
      }
    }
  ]
}

The contents of this file will be updated in this repo whenever new upgrades are executed.

API Information

Lamina1 supports standard EVM JSON-RPC methods and you can use the following public API endpoints:

Alternatively you can use libraries like ethers or web3.js that interact with EVM chains.

See the RPC API Instructions.md document for more detailed information.

Common API Methods

Get Account Balance

{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0xYourAccountAddress", "latest"],
    "id": 1
}
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xYourAccountAddress", "latest"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Get Latest Block Number

{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
}
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Get Transaction by Hash

{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionByHash",
    "params": ["0xYourTransactionHash"],
    "id": 1
}
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xYourTransactionHash"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Verify Transaction Receipt

{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0xYourTransactionHash"],
    "id": 1
}
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xYourTransactionHash"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Note: status: "0x1" means the transaction was successful, while status: "0x0" means it failed.

Transfer Process

To transfer L1 tokens, you must sign the transaction offline and broadcast it online.

Sign Transaction Offline (using web3.js):

const Web3 = require('web3');
const web3 = new Web3();

const account = web3.eth.accounts.privateKeyToAccount('0xYourPrivateKey');

const tx = {
    to: '0xRecipientAddress',
    value: web3.utils.toWei('0.1', 'ether'),
    gas: 2000000
};

const signedTx = account.signTransaction(tx);

Broadcast Signed Transaction:

{
    "jsonrpc": "2.0",
    "method": "eth_sendRawTransaction",
    "params": ["0xSignedTransactionData"],
    "id": 1
}
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xSignedTransactionData"],"id":1}' -H "Content-Type: application/json" http://localhost:8545

Network Details

  • Block Producing Rate: Average block time ~2 seconds (blocks are only produced when there are transactions to process)
  • Transaction Precision: 18 decimal places
  • Address Format: Addresses begin with 0x followed by 40 alphanumeric characters

Wallet Information

Additional Information

  • Account Memo Function: EVM-based, similar to standard Ethereum accounts
  • Creating Account: Follow standard EVM account creation processes
  • Preventive Measures to Avoid Chain Forking: Not needed due to PoS mechanism
  • Restoring and Recovering Accounts: Use standard Ethereum account recovery methods (e.g., mnemonic phrases, private keys)
  • Cross-Chain Bridge: Not currently implemented; earliest possible date is June 15, 2024, subject to Open Metaverse Foundation (OMF) decision
  • Proof of Stake: Prevents 51% attacks inherently
  • Rollback Policy: No rollback
  • Transaction Timeout Mechanism: No timeout mechanism for transactions in the tx pool
  • Rent or Reservation: No rent or reservation requirements
  • Node IP Whitelisting: Not required

For further technical details, you can refer to the following resources: