Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

implement Cardano blockchain project in python

Project description

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 build_ext --inplace

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


  • 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.
  • sign sign a message with wallet, prove an wallet address belongs to you.
  • verify verify a signed message.
  • utxo stat Some statistics of global UTxOs.


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


    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.


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

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-cardano, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size python-cardano-1.0.1.tar.gz (1.3 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page