Skip to main content

Python implementation of untyped plutus language core

Project description

Untyped Plutus Language Core

Build Status PyPI version PyPI - Python Version PyPI - Status Coverage Status

This is a basic library to support creating and manipulating programs written in UPLC.

Installation

Install anything between python 3.8 and 3.10. Then run

pip install uplc

Secp256k1

If you want to use the builtin functions for verification of ECDSA and Schnorr signatures, follow the instructions to install libsecp256k1 with schnorr support enabled:

https://github.com/input-output-hk/cardano-node-wiki/blob/main/docs/getting-started/install.md#installing-secp256k1

This makes sure that the exact same version is used that is used in the cardano-node.

Usage

This tool may be used to parse, reformat (/dump), evaluate or build contract artifacts from UPLC code.

# Check validity of a source file
uplc parse examples/fibonacci.uplc

# Dump a source file in either the official plutus or legacy aiken dialect
uplc dump examples/fibonacci.uplc --dialect plutus --unique-varnames
uplc dump examples/fibonacci.uplc --dialect legacy-aiken

# Evaluate a UPLC program on UPLC input
uplc eval examples/fibonacci.uplc "(con integer 5)"

# Build smart contract artifacts from the UPLC program
uplc build examples/fibonacci.uplc

# This package can also be used to analyze built contracts (output from any Smart Contract Language)
uplc dump build/fibonacci/script.cbor --from-cbor

# Show all options
uplc --help

Scope and Contributions

This is a side product of the development of a pythonic smart contract language for the Cardano blockchain and hence much tailored to the needs of that development.

Most likely it can do what you would like to do but its not properly documented. Please do reach out via Discord or GitHub issue if you think this tool could be of use to you.

Contributions are very welcome.

Project details


Download files

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

Source Distribution

uplc-1.0.0.tar.gz (41.5 kB view details)

Uploaded Source

Built Distribution

uplc-1.0.0-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file uplc-1.0.0.tar.gz.

File metadata

  • Download URL: uplc-1.0.0.tar.gz
  • Upload date:
  • Size: 41.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/5.4.0-131-generic

File hashes

Hashes for uplc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a38e45dfc8ce3e125cad3f1b0bbe296d152132c002fa9b651dbb8e938392746f
MD5 b0ba632a94e81c57c94392270a0a12b9
BLAKE2b-256 1de31fdf2b7c11fd4d8f96582b7796d101db3f5999124ea7d21bcde52895fda3

See more details on using hashes here.

File details

Details for the file uplc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: uplc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/5.4.0-131-generic

File hashes

Hashes for uplc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41a3aeb130c9ae736d41551c52e47b11a06ee56e4d78f8361b10813a7ebadac2
MD5 d74e0337f69cb0f8ae8791a95b07ffd3
BLAKE2b-256 a42115bcee7e977018f4e861a7e2757c0d34aa5cd5c1f54329024bf038f79c3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page