Coder Social home page Coder Social logo

cryptomaestro2888 / clementine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chainwayxyz/clementine

0.0 0.0 0.0 3.17 MB

Citrea's BitVM Based Trust-Minimized Two-Way Peg Program

Home Page: https://www.blog.citrea.xyz/unveiling-clementine

Shell 0.23% Rust 89.37% Solidity 10.40%

clementine's Introduction

Clementine ๐ŸŠ

Clementine is Citrea's BitVM based trust-minimized two-way peg program. The repository includes:

  • Smart contracts for deposit and withdrawal
  • A library for bridge operator and verifiers
  • Circuits that will be optimistically verified with BitVM

The flow is as follows:

  • Creating the operator and verifiers
  • Initial setup that includes calculating period block heights, connector tree hashes, and funding connector source UTXOs.
  • User deposit flow that includes creating a deposit transaction, signing it, and submitting it to the operator.
  • Operator processing the deposit, getting signatures from verifiers, and submitting the deposit to the Bitcoin network.
  • Verifiers verifying the deposit and signing the deposit transaction and claim signatures.
  • Operator withdrawal flow for front covering withdrawal requests.
  • Verifier to start a challenge with Bitcoin Proof of Work
  • Operator to respond to the challenge with a bridge proof.

Warning

Clementine is still work-in-progress. It has not been audited and should not be used in production under any circumstances. It also requires a full BitVM implementation to be run fully on-chain.

Instructions

To clone this repo with submodules:

git clone --recurse-submodules https://github.com/chainwayxyz/clementine.git
cd clementine

Run Bitcoin Regtest

To run the whole process of simulating deposits, withdrawals, proof generation on the Bitcoin Regtest network, you need Bitcoin Core to be installed.

You can use the following commands to run the server.

Start the regtest server with the following command:

bitcoind -regtest -rpcuser=admin -rpcpassword=admin -rpcport=18443 -fallbackfee=0.00001 -wallet=admin -txindex=1

Create a wallet for the operator:

bitcoin-cli -regtest -rpcuser=admin -rpcpassword=admin -rpcport=18443 createwallet "admin"

Mine some blocks to the wallet:

bitcoin-cli -regtest -rpcuser=admin -rpcpassword=admin -rpcport=18443 generatetoaddress 101 $(bitcoin-cli -regtest -rpcuser=admin -rpcpassword=admin -rpcport=18443 getnewaddress)

Run the Clementine simulation

cargo run

Test

cargo test

License

Copyright

(c) 2024 Chainway Limited clementine was developed by Chainway Limited. While we plan to adopt an open source license, we have not yet selected one. As such, all rights are reserved for the time being. Please reach out to us if you have thoughts on licensing.

clementine's People

Contributors

ekrembal avatar ozankaymak avatar hakkush-07 avatar okkothejawa avatar eyusufatik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.