Zircuit Testnet

C9MR...nT41
26 Jan 2024
34

What is Zircuit?

🔥Zircuit is a fully EVM-compatible zero-knowledge rollup powering the limitless potential of web3. Backed by pioneering L2 research, the network’s unique hybrid architecture combines battle-tested infrastructure with zero-knowledge proofs to give developers the best of both worlds. With cutting-edge performance and security at the sequencer level, users can explore new frontiers with faster transactions, reduced fees, and complete peace of mind.

What are the main features of Zircuit?

🔥Pioneering Research: Over the last year and a half, we’ve been at the forefront of research into topics like rollup security tooling, rollup compression, and scaling cryptography. This work has earned us multiple L2 research grants from the Ethereum Foundation.

🔥Hybrid Architecture: 100% EVM-compatible, Zircuit is the first zkEVM built on Bedrock, the leading rollup development framework. Our hybrid approach combines battle-tested infrastructure with zero-knowledge proofs, providing developers the best of both worlds.

🔥Security at the Sequencer Level: Zircuit will protect users at the sequencer level by monitoring the mempool for malicious transactions and preventing their inclusion into a block. In comparison to typical security efforts that focus on the application and smart contract levels, Zircuit’s revolutionary approach goes directly to the underlying sequencer level.

🔥Secure Native Bridge: Zircuit’s native bridge infrastructure incorporates best-in-class security architecture and safety practices. The canonical bridge is straightforward and easy to use while maximizing user security.

🔥Cutting-Edge Performance: By decomposing circuits into specialized parts and aggregating proofs, Zircuit achieves greater efficiency and lower operating costs. Combined with larger transaction batches and accelerated proof processing, users benefit via faster and cheaper transactions.

🔥Ethereum Application Compatibility: Zircuit works with all your favorite Ethereum apps. It supports all major wallets such as MetaMask, as well as tools like Hardhat. Deploy Ethereum dApps seamlessly without the need to learn a new programming language or framework.

What does it mean that Zircuit is EVM-compatible?

🔥For the developers and users of our network, this means that tooling and wallets will work just as they are used to, resulting in minimal development overhead. Anyone can deploy Ethereum dApps seamlessly without the need to learn a new programming language or framework—simply change the deployment endpoints when you’re ready to go live. All gas fees on Zircuit are paid in ETH. Zircuit can deploy smart contract code that is compatible with the Ethereum Virtual Machine (EVM), which powers the Ethereum network itself.

How do I join the Zircuit community as a member or builder?

🔥You can find us on Twitter or on Discord .

Which wallets are supported?

🔥Zircuit supports all major wallets such as MetaMask and Coinbase Wallet.

What tech stack is Zircuit built on?
🔥Zircuit is composed of best-in-class technology improved by proprietary research efforts. The tech stack consists of:
Geth (Ethereum’s go client)
Halo2 (proof system)
Optimism Bedrock (the battle tested framework for rollups)

How does Zircuit work an a nutshell?
🔥There are two actors involved in a rollup chain: Sequencer and User.
We maintain the account Merkle tree on-chain which can be updated by sending SNARK proofs. Users send transactions to the sequencer with signatures via RPC/APIs. The sequencer collects all the transactions and creates a batch which is processed by the SNARK circuit. If the circuit finds all transactions in the batch to be valid, it emits a proof. This validity proof will be submitted and verified on-chain which signifies that state was updated properly off-chain. This updates the on-chain account Merkle tree.

How does Zircuit handle circuits differently than other L2s?
🔥Zircuit uses proprietary proof aggregation technology which separates circuits into fast parallel processes. This results in many smaller proofs which are faster to generate and which are later aggregated by Zircuit.

What does "security at the sequencer level" mean?
🔥Zircuit services will constantly monitor the mempool for malicious transactions, exploit contracts, and more. Once detected and verified as malicious, Zircuit can prevent their inclusion into the next block. This means that every transaction on Zircuit will go through security checks resulting in a more secure chain for projects and end users.

Does Zircuit have a token?
🔥Zircuit uses native ETH and does not currently have a governance token.

🎁Quick Start
Connecting to Zircuit Testnet
There are only a few simple steps to get started with Zircuit Testnet:
Get Testnet ETH
Add Zircuit Testnet to Your Wallet
Deposit ETH from Sepolia to Zircuit (L1 -> L2)
Get Testnet ETH
First, you'll need an Ethereum wallet such as Metamask (recommended). Zircuit Testnet uses Sepolia ETH -- If you don't already have some in your wallet, you'll need to acquire some from the Sepolia Faucet , a helpful friend, or another source. Some third-party faucet options include:

✅ Alchemy
✅Infura
✅Tatum


Add Zircuit Testnet to Your Wallet
To start using Zircuit, you need to add the chain's RPC endpoint to your wallet. The following instructions are for MetaMask but should apply generally to any wallet. Click on the MetaMask extension on your browser, click MetaMask's network selector dropdown, and then click the Add Network button at the bottom. Click Add a network manually and provide the following information for Zircuit Testnet:

- Network Name: `Zircuit Testnet`
- New RPC URL: `https://zircuit1.p2pify.com/`
- Chain ID: `48899`
- Currency Symbol: `ETH`
- Block Explorer URL: `https://explorer.zircuit.com`
Deposit ETH from Sepolia to Zircuit (L1 -> L2)

After you’ve added Zircuit to your wallet, you can bridge your Sepolia ETH to Zircuit Testnet via the Zircuit Bridge. To do so, simply:

✅Connect your wallet on https://bridge.zircuit.com/
✅Make sure you're connected to Sepolia
✅Enter how much Sepolia ETH you would like to bridge to Zircuit Testnet
✅Click Bridge
✅Review the transaction and click Approve transaction in your wallet
Click Confirm in the MetaMask popup
After a few seconds, your transaction should be confirmed, and you should see the updated balance

Congrats 🎉🎉, you've successfully bridged to Zircuit Testnet!

Done

Deploy on Zircuit
A Tutorial for Deploying a Smart Contract on Zircuit
Overview
Deploying your first contract on Zircuit is easy! This tutorial will show you how.
If you already have an existing development environment for Ethereum, this will be fast and probably take only 10-15 minutes.
We have even provided you a boilerplate project to make this process even simpler!
Walkthrough

1. Set Up Hardhat
Create the folder for you new project and navigate within
mkdir my-zircuit-coin
cd my-zircuit-coin
Install Hardhat using npm (Node Package Manager):
npm install --save-dev hardhat
Install the hardhat toolbox for a later step
npm i @nomicfoundation/hardhat-toolbox
Initialize a new Hardhat project:
npx hardhat

2. Write Your Smart Contract
We created a file which will have everything you need for easy deployment, all you need to do is replace the following section of the Token.sol file.
Sample smart contract
string public name = "Name Goes Here";
string public symbol = "TICKER";

// The fixed amount of tokens, stored in an unsigned integer type variable.
uint256 public totalSupply = 21000000;
These values are just filler, so put in a fun name for your token, a ticker and adjust the supply as you see fit!

3. Compile Your Smart Contract
Use this Hardhat command to compile your contract:
npx hardhat compile

4. Set Up Your Network Configuration
Edit the hardhat.config.js file to define network configurations. In this case, all you need to do is enter your Zircuit private key. A sample is shown below.
require("@nomicfoundation/hardhat-toolbox");

const ZIRCUIT_PRIVATE_KEY = "YOUR ZIRCUIT PRIVATE KEY";

module.exports = {
solidity: "0.8.19",
networks: {
zircuit: {
url: `https://zircuit1.p2pify.com`,
accounts: [ZIRCUIT_PRIVATE_KEY]
}
}
};
5. Write A Deployment Script
In the scripts directory, create a deployment script, for instance deploy.js. This script will handle the deployment of your smart contract. A sample is below.
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
const TokenFactory = await ethers.getContractFactory("Token");
const Token = await TokenFactory.deploy();
console.log("Token deployed to:", Token.target);
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
6. Deploy Your Smart Contract
Run the deployment script with Hardhat.
npx hardhat run scripts/deploy.js --network zircuit

7. Verify and Interact with Your Contract
Once deployed, you can use Hardhat commands or the Hardhat console to interact with your contract.
Otherwise, you might want to verify your smart contract via our block explorer .

Conclusion
Congratulations 🎉🎉! You've successfully launched your first contract on Zircuit.

🔥Architecture🔥

Overview
Zircuit is based on a novel hybrid architecture that combines battle-tested rollup infrastructure with zero-knowledge proofs. Its architecture consists of:
✅Sequencers that process transactions in order to construct L2 blocks
Provers to generate validity proofs for these blocks

✅Smart contracts to interact with the system on L1
The result is a zkEVM rollup with fast finality that doesn't need a challenge period for withdrawal transactions.
Transaction Flow
An overview of the transaction flow is illustrated in the following image.
Transaction flow of Zircuit
Transactions on the rollup may originate from L1 or directly from the L2.

A transaction that originates on the L1 may be a deposit transaction, where ETH or other assets are bridged onto the L2, or a cross domain function call. An L2 transaction may be a transfer of assets between L2 accounts or a call to a contract deployed on the L2 from an account with funds on the L2. In either case, the transaction is processed by the rollup node, which consists of the sequencer, the execution engine, and the batcher.

The sequencer directs the execution engine as to which transactions should be in a block by adding deposit transactions generated from smart contract events on L1.

The batcher submits L2 transaction batches to the L1, so that users have full data availability. Users can use this data as this is a so-called soft commitment that their transaction is completed. A soft commitment is a commitment that the transaction will be included in the L2 chain, but it is not considered final yet as its execution has not yet been proved.

The execution engine processes the transactions in the batches and results in a new L2 state. The execution engine processes these transactions by putting them in L2 blocks.

These L2 blocks are then processed by Zircuit provers, each with a specific role. For example, one may prove that a transaction was executed correctly, while another might prove that a relevant Keccak operation was performed correctly; a third may then prove the aggregation of the operations performed by prior two proofs.

As a result, Zircuit leverages parallel proof generation for speedy proof generation, but also proof aggregation to produce a single proof that can be verified on chain. By decomposing circuits into specialized parts and aggregating proofs, Zircuit achieves greater efficiency with lower operating costs. The final validity proof generated is the aggregation of proofs for a batch of L2 blocks.

The proofs for batches of L2 blocks are verified on Ethereum via a smart contract. After verification succeeds, the L2 state root is updated on the relevant contracts, recording the changes contained in the L2 blocks included in the batch whose proof was just verified. At this time, those L2 blocks are considered final. Withdrawals from the L2 are now possible without an additional delay.

The verification of the validity proof concludes the transaction flow at a glance. The next two sections will dive into the processing of deposit, L2, and withdrawal transactions..
Deposits and L2 Transactions
This section covers the architecture related to deposits and L2 transactions in greater detail. A deposit transaction bridges assets like Ether or ERC-20 tokens from Ethereum to Zircuit. An L2 transaction is one that originates on Zircuit itself, like a transfer of Ether between accounts, or smart contract calls on Zircuit.
The following image highlights the specific components of Zircuit that are involved in a deposit or L2 transaction.
Deposits in Zircuit
Deposit transactions are initiated by calling a smart contract on L1. Two contracts can be used to deposit ETH onto Zircuit: the L1StandardBridge contract and the OptimismPortal smart contract. The L1StandardBridge contract can be used to deposit Ether by calling the appropriate function. The OptimismPortal contract bridges Ether by implementing the receive function, meaning any Ether sent to this contract without specifying a function to call will automatically be bridged.
Only the L1StandardBridge can be used to bridge ERC-20 tokens, and ERC-721 tokens can be bridged via the L1ERC721Bridge contract.
Transactions that originate on L2 naturally do not need to call these smart contracts. Instead, they are sent to the chain via an RPC call or a wallet and are processed directly by the rollup node.

Once the rollup node observes a deposit or receives an L2 transaction, it constructs blocks that contain those transactions via its sequencer functionality.

The rollup node will create deposit transactions for each deposit event observed on L1 and pass these transactions along with any L2 transactions to the execution engine.

The execution engine is a modified version of Geth, which supports the deposit transaction type and other minor changes necessary for rollup operation.

The rollup node also passes the transactions included in the blocks to the batcher service, which posts the transactions and their arguments as calldata on the L1, providing full data availability.

At this point, the transaction will be included on the L2 after the provers receive the relevant blocks that contain the transactions; no further interaction from the transaction’s sender is needed.

🔥Withdrawals🔥

Withdrawal transactions take assets like ETH off of Zircuit and return them to the L1. A withdrawal transaction is initiated by first sending an L2 transaction to the L2StandardBridge contract calling the appropriate function.

Once that transaction is included in the L2, the components in the following diagram are relevant to complete the withdrawal transaction.

🔥Withdrawals in Zircuit

The withdrawal can be completed when the state root containing the L2 withdrawal transaction is included on L1 with a corresponding proof. A proof is necessary to complete the withdrawal function, as it ensures that the account withdrawing the funds had the funds in the first place.

When the batches have been proven, the resulting state root is pushed to L1 via the L2OutputOracle smart contract alongside a validity proof for the state transition from the last state root. Once the verifier verifies the proof, the state root is recorded as final. Any withdrawals that depend on it can be processed immediately.

Get fast shipping, movies & more with Amazon Prime

Start free trial

Enjoy this blog? Subscribe to alyssaedejermelendez

0 Comments