GithubHelp home page GithubHelp logo

mosaicdao / mosaic-proof Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 3.0 482 KB

Mosaic proof is a tool for generating merkle patricia proof of message that is used by the protocol for message transfers.

Home Page: https://discuss.openst.org/c/mosaic

License: Apache License 2.0

TypeScript 100.00%

mosaic-proof's Introduction

Mosaic proof

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. More details on Mosaic here

The protocol defines a set of actions that together perform atomic token transfers across two blockchains using gateway contracts. This is done using a 2-phase message passing architecture between the chains. This is done with proving Merkle Patricia proofs of messages generated from one chain to another chain.

Mosaic proof is a tool for generating Merkle Patricia proof of a message that is used by the protocol for message transfers.

###Usage install @openst/mosaic-proof package.

npm install @openst/mosaic-proof

Using proof generator.

import { ProofGenerator } from '@openst/mosaic-proof';

Create proof generator object.

const web3 = new Web3('http://localhost:8546');
const proofGenerator = new ProofGenerator(web3);

Generate message box outbox proof for a given message

const eip20GatewayAddress = '0xEIP20GatewayAddress000000000000000000000';
const messageHash = '0xMessageHash000000000000000000000000000000000000000000000000000';
const blockNumber = 'latest';

// Get MessageBox outbox proof.
const outboxProof:ProofData = await proofGenerator.getOutboxProof(
    eip20GatewayAddress,
    [messageHash], 
    blockNumber,
  );

Generate message box inbox proof for a given message

// Get MessageBox outbox proof.
const inboxProof: ProofData = await proofGenerator.getInboxProof(
    eip20GatewayAddress,
    [messageHash], 
    blockNumber,
  );

mosaic-proof's People

Contributors

0xsarvesh avatar abhayks1 avatar

Stargazers

Deepesh Kumar Nath avatar

Watchers

James Cloos avatar Benjamin Bollen avatar Puneet Khushwani avatar  avatar Deepesh Kumar Nath avatar  avatar

mosaic-proof's Issues

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.