GithubHelp home page GithubHelp logo

isabella232 / starkex-for-spot-trading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from starkware-libs/starkex-for-spot-trading

0.0 0.0 0.0 170 KB

License: Apache License 2.0

Shell 0.05% Python 43.88% CMake 11.79% Dockerfile 0.18% Cairo 44.11%

starkex-for-spot-trading's Introduction

StarkEx Cairo Code Repository

Overview

​ This repository contains the Cairo code (and some of the cryptographic primitives) used by StarkEx, StarkWare's scalability solution for spot ERC-20 and ERC-721 trading. If you are not familiar with StarkEx, you can read more about it here. ​

Note: The Cairo code that proves perpetual trading, can be found in another repo. ​

If you are not familiar with the Cairo language, you can find more details about it here.

​ The Cairo code is published to allow a permissionless audit of StarkEx business logic, as enforced by the StarkEx smart-contract

Repository Contents

src/starkware/cairo/dex, src/services/exchange/cairo The full Cairo program that StarkEx, StarkWare's scaling solution, executes. It includes a Python file, generate_program_hash_test.py, that calculates the hash of the Cairo code and compares it to the pre-calculated value found at program_hash.json

src/starkware/crypto/starkware/crypto/signature: The Python implementation of the cryptographic primitives used by StarkEx, namely the Pedersen hash functions and the ECDSA signature. These implementations, or equivalent implementations in other languages such as JS, are used by StarEx user's wallets in order to generate and sign on orders.

src/starkware/python: additional utility scripts the scripts at src/starkware/cairo/dex need.

How to Use the Repo

Prerequisites:

Docker (Ubuntu install via: apt install -y docker.io) ​

Usage:

  1. Run the test to verify that the Cairo program hash is indeed the one saved in the file src/starkware/cairo/dex/program_hash.json by running the command:
    docker build .

  2. Verify that the same hash is used by StarkEx on Mainnet by running the script src/services/extract_cairo_hash.py in the following way:
    ./src/services/exchange/extract_cairo_hash.py --main_address <checksummed_main_address> --node_endpoint <your_node_endpoint>

You can find the relevant addresses and current versions for the different StarkEx deployments here.

When comparing the hash, please make sure you checkout the tag that corresponds to the deployed version from this repo.

starkex-for-spot-trading's People

Contributors

gkaempfer 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.