Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Midnight rollup Bridge contract

This repository contains the on-chain bridge contract and supporting tooling for the Midnight L2 rollup. The bridge contract, written in Compact, is deployed on the Midnight L1 and enables bidirectional asset transfers between L1 and the Sovereign SDK rollup (L2). Key capabilities include unshielded NIGHT deposits (L1→L2), proof-based withdrawal claims (L2→L1), batch commitment and finalization with threshold signatures, and verifier set / sequencer / finalizer management. The project ships as a Turbo monorepo with two packages: the Compact smart contract (bridge-contract) and a TypeScript CLI and executor service (bridge-cli) used by the rollup node to submit L1 transactions.

📦 Prerequisites

🛠️ Setup

1️⃣ Install Git LFS

# Install and initialize Git LFS
sudo dnf install git-lfs  # For Fedora/RHEL
git lfs install

2️⃣ Install Compact Tools

# Install the latest Compact tools
curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh
# Install the latest compiler
compact update +0.30.0

3️⃣ Install Node.js and docker

4️⃣ Verify Installation

# Check versions
node -v  
npm -v   
docker -v
git lfs version
compact check  # Should show latest version

📁 Project Structure

├── bridge-cli/         # CLI tools
└── bridge-contract/    # Smart contracts

🔗 Setup Instructions

Initialize or clone the codebase with submodules

This project uses a git submodule for the Compact compiler (as docs for AI). Clone with:

git clone --recurse-submodules <repo-url>

If you already cloned without submodules:

git submodule update --init

### Install Project Dependencies and compile contracts
  ```bash
   # In one terminal (from project root)
   npm install
   npm run build

Setup Env variables

  1. Create .env file from template under bridge-cli folder

Start Development In Undeployed Network

# From project root
npm run setup-standalone

Bridge contract deployment

The Bridge contract is deployed with bridge-cli (standalone CLI or via the executor's POST /deploy endpoint). Quick start: from project root run npm run setup-standalone, then e.g. cd bridge-cli && npm run deploy-undeployed, or npm run cli -- deploy -n undeployed with env set (see bridge-cli/.env_template). All constructor arguments (owner, layer2ChainId, rollupId, genesis roots, verifier set, signatureThreshold, initialSequencer, initialFinalizer) are optional and can be overridden. See bridge-cli/README.md for deploy options, constructor override flags, and executor usage.


Built with ❤️ by Mesh × Edda Labs

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages