Skip to main content

Python implementation of untyped plutus language core

Project description

Untyped Plutus Language Core

CI/CD 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.11. 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

# You can also apply additional parameters to a script using the build command
uplc build script.cbor --from-cbor "(con integer 5)"

# Show all options
uplc --help

Running tests

To run the testsuite of UPLC, use pytest.

pytest

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.8.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

uplc-1.0.8-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: uplc-1.0.8.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.13 Linux/6.11.0-1012-azure

File hashes

Hashes for uplc-1.0.8.tar.gz
Algorithm Hash digest
SHA256 0a55caa98e49e794fe5888a2bd71ce41c168785cc260c6f33503baf1b61183b5
MD5 407896614c7c35f7bc92118ab669a00d
BLAKE2b-256 25f9cdb3c8529801a05fddcdbfa5e7c32c43fb17aa146ad3f9639f7fcfcdc9e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uplc-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.13 Linux/6.11.0-1012-azure

File hashes

Hashes for uplc-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 addd0d2aee1a88036a012dad4da16281d18f457565c0282987726ade9aa47a28
MD5 d2791b4c59a7bea06de46e59fd6aa58d
BLAKE2b-256 9945b19ef5d6a15a9a84f52c457b6fa32b48c733053d205da0a9cf11fb0ff10d

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