Git Product home page Git Product logo

python-cardano's Introduction

Python-Cardano

Python implementation of Cardano project, including network protocol, crypto primitives, wallet logic, and more.

Why This Project

  • We want to explore alternate design decisions to support lightweight wallet, and start developing the mobile wallet for Cardano. Current official wallet node is not enough yet.
  • Explore the design space of clustered wallet node.
  • Provide alternative implementation of Cardano protocols and specifications in another programming language.
  • In the future, it could be an alternative foundation for projects in Cardano ecosystem: wallets, side-chains, MPCs.

Why Python

Python is still one of the most cleanly designed, developer friendly programming language out there, has a reputation of executable pseudocode. And lightweight thread provided by gevent makes it suitable to write networking software, and easy interoperability with C thanks to Cython enables us to improve performance incrementally.

With python, we can develop clean prototype very fast, with good performance. And in the future we can always move the CPU intensive code to C after we indentified the hotspot.

Build & Test

$ virtualenv -p python3 .env
$ source .env/bin/activate
$ pip install -r requirements.txt
$ python setup.py build_ext --inplace

$ mkdir ./test_db
$ python scripts/pycardano.py run
sync block data from mainnet and subscribing for new blocks automatically.
$ python scripts/pycardano.py wallet create default
generate wallet

Features

  • Store block data of different epochs in seperate rocksdb database, provides better disk usage(fully synchronized mainchain takes 1.3G disk space), and allows faster synchronization in the future.
  • pycardano.py sign sign a message with wallet, prove an wallet address belongs to you.
  • pycardano.py verify verify a signed message.
  • pycardano.py utxo stat Some statistics of global UTxOs.

Modules

  • cardano.address

    Implement Cardano HD address derivation and encoding, and wallet recovering for lagacy address format.

  • cardano.transport

    Implement Haskell's network-transport-tcp, multiplex multiple lightweight unidirectional connections on a single tcp connection.

  • cardano.node

    Implement cardano-sl's Node, allow bidirectional conversation between endpoints.

  • cardano.storage

    Storage api of block and wallet's data.

  • cardano.block

    Block data structures.

  • cardano.logic

    Workers and listeners of default node.

  • cardano.retrieve

    Retrieve block data with cardano-sl mainnet.

  • cardano.wallet

    Implement wallet logic according to formal specification.

TODOs

  • wallet state storage, a simple solution first, hopefully something like Haskell's acid-state in the end.
  • block verification.
  • relay block data with stream api.
  • wallet cli app.
  • wallet V1 api and api for SPV light client.
  • clustered wallet storage.

python-cardano's People

Contributors

yihuang avatar

Watchers

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