All Projects → OpenST → Mosaic Contracts

OpenST / Mosaic Contracts

Licence: mit
Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mosaic Contracts

Pyquarkchain
Python implementation of QuarkChain
Stars: ✭ 194 (+63.03%)
Mutual labels:  blockchain, ethereum, sharding
Smart Contract Sanctuary
🐦🌴🌴🌴🦕 A home for ethereum smart contracts. 🏠
Stars: ✭ 99 (-16.81%)
Mutual labels:  blockchain, ethereum
Cryptocurrencyawesome
Cryptocurrency study materials resources
Stars: ✭ 118 (-0.84%)
Mutual labels:  blockchain, ethereum
Ergo
The Language for Smart Legal Contracts
Stars: ✭ 108 (-9.24%)
Mutual labels:  blockchain, ethereum
Awesome Cryptocurrency Security
😎 Curated list about cryptocurrency security (reverse / exploit / fuzz..)
Stars: ✭ 102 (-14.29%)
Mutual labels:  blockchain, ethereum
Indy Leaderboard
Example game leaderboard dApp utilizing EbakusDB on Ebakus blockchain
Stars: ✭ 103 (-13.45%)
Mutual labels:  blockchain, ethereum
Truffle
A tool for developing smart contracts. Crafted with the finest cacaos.
Stars: ✭ 11,909 (+9907.56%)
Mutual labels:  blockchain, ethereum
Eth Indexer
An Ethereum project to crawl blockchain states into database
Stars: ✭ 98 (-17.65%)
Mutual labels:  blockchain, ethereum
Vscode Azure Blockchain Ethereum
Blockchain extension for VS Code
Stars: ✭ 111 (-6.72%)
Mutual labels:  blockchain, ethereum
Cyb Archeology
🌎 Personal immortal robot for the The Great Web
Stars: ✭ 117 (-1.68%)
Mutual labels:  blockchain, ethereum
Blockapi
A general framework for blockchain analytics
Stars: ✭ 111 (-6.72%)
Mutual labels:  blockchain, ethereum
Masterblockchain
Stars: ✭ 100 (-15.97%)
Mutual labels:  blockchain, ethereum
Superblocks Lab
Superblocks Lab for DApp development
Stars: ✭ 100 (-15.97%)
Mutual labels:  blockchain, ethereum
Diadata
DIAdata.org platform
Stars: ✭ 103 (-13.45%)
Mutual labels:  blockchain, ethereum
Solidity
Solidity, the Smart Contract Programming Language
Stars: ✭ 13,691 (+11405.04%)
Mutual labels:  blockchain, ethereum
Learn Solidity With Examples
A repo full of smart contracts written in Solidity
Stars: ✭ 106 (-10.92%)
Mutual labels:  blockchain, ethereum
Eth Cli
CLI swiss army knife for Ethereum developers
Stars: ✭ 109 (-8.4%)
Mutual labels:  blockchain, ethereum
Etherwalletkit
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Stars: ✭ 96 (-19.33%)
Mutual labels:  blockchain, ethereum
Uniswap Interface
🦄 An open source interface for the Uniswap protocol
Stars: ✭ 1,337 (+1023.53%)
Mutual labels:  blockchain, ethereum
Backend Ico Dashboard
Free & open-source dashboard for your next ICO, crowdsale or tokensale
Stars: ✭ 110 (-7.56%)
Mutual labels:  blockchain, ethereum

💠 Mosaic Contracts

Build master Build develop npm version Discuss on Discourse Chat on Gitter

Mosaic is a parallelization schema for decentralized applications. It composes heterogeneous blockchain systems into one another. Decentralized applications can use Mosaic to compute over a composed network of multiple blockchain systems in parallel.

Mosaic enables building scalable blockchain token economies through the bidirectional transposition of ERC20 tokens on one blockchain, the origin chain, and a utility token representation on another blockchain, the auxiliary chain.

The protocol defines a set of actions that together perform atomic token transfers across two blockchains using gateway contracts. A gateway for a given EIP20 token is comprised of a EIP20Gateway contract on origin, a corresponding EIP20CoGateway contract on auxiliary, and and an ERC20 utility token contract on auxiliary that mints and burns utility tokens to atomically mirror tokens staked and unstaked on the origin chain.

Atomicity is achieved using a 2-phase message passing architecture between the chains. Messages are declared on the source chain, and confirmed on the target chain with Patricia Merkle proofs once the source chain is finalized. Once messages are confirmed on the target chain, they can efficiently progressed with a hashlock. Messages can also be reverted if they are not yet completed on the target chain.

You can read the draft of the mosaic whitepaper or the original OpenST whitepaper.

Instructions

For JS Consumers

Installation

npm install @openst/mosaic-contracts

Usage

// Load the contracts' meta-data from the package:
import { contracts } from "@openst/mosaic-contracts";

// Access the ABIs and BINs directly on the contracts. For example:
const anchorAbi = contracts.Anchor.abi;
const anchorBinary = contracts.Anchor.bin;

@openst/mosaic-contracts also includes the contract interacts.

Example of using the contract interacts.

import { Interacts} from "@openst/mosaic-contracts";

const anchor:Anchor = Interacts.getAnchor(web3, '0xAnchorContractAddress');
const gateway:EIP20Gateway = Interacts.getEIP20Gateway(web3, '0xEIP20GatewayContactAddress');

Example with Web3 contracts.

import { contracts } from "@openst/mosaic-contracts";

const jsonInterface = contracts.Anchor.abi;
const contract = new web3.eth.Contract(jsonInterface, address, options);

const anchor:Anchor = contract as Anchor;

For Direct Users

This section is only required if you want to set up a new mosaic chain.

Installation

git clone https://github.com/OpenST/mosaic-contracts.git
cd mosaic-contracts
npm run update # Runs `git submodule update --init --recursive && npm ci`
npm run compile:all

Usage

There is a deployment tool available for deployment and set-up:

node ./tools/blue_deployment/index.js

⚠️ Note that this feature is still very experimental ⚠️

Related Work

mosaic.js uses this package to provide a JavaScript abstraction layer of the mosaic contracts. You can use mosaic.js directly to deploy the contracts and interact with them.

Contributing

Set-up

git clone https://github.com/OpenST/mosaic-contracts.git
cd mosaic-contracts
npm run update # Runs `git submodule update --init --recursive && npm ci`
npm run compile:all
npm run ganache
npm run test

Guidelines

There are multiple ways to contribute to this project. However, before contributing, please first review the Code of Conduct.

We track our issues on GitHub.

To contribute code, please ensure that your submissions adhere to the Style Guide; please also be aware that this project is under active development and we have not yet established firm contribution guidelines or acceptance criteria.

Community

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].