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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: uplc-1.0.9.tar.gz
  • Upload date:
  • Size: 32.8 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.9.tar.gz
Algorithm Hash digest
SHA256 8c7a632821adb16331c1960a16ef67be728889fa4c0dd486efb510b734f00983
MD5 75cad18efd8b5384a41589dc92a8f54b
BLAKE2b-256 a7c477fdd0db16ce1c0adc417fd0ece9a65afbe93bbaea2a69fee157c3971236

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uplc-1.0.9-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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1e35f08f05f24863420f16a9e5d6c74cd2f54d639f20f1066460ad3879895e6e
MD5 a7aa36f1135df1ae52527b9f81ebf5c5
BLAKE2b-256 2d5fb7fa8227bbbac16c56d4000b5bf6f85f6d64ca0b5bb60f25e52b683e0fb4

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