Untyped Plutus Language Core
This is a basic library to support creating and manipulating programs written in UPLC.
Installation
Install Python 3.9 or higher and make sure you have pip installed.
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. We provide a script to do this for you on Linux and MacOS.
curl -sSL https://raw.githubusercontent.com/OpShin/uplc/refs/heads/master/install_secp256k1.sh | bash
This makes sure that the exact same version is used that is used in the cardano-node.
Then, install the python bindings for secp256k1 with
pip install python-secp256k1-cardano
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.
Metadata
Release files for uplc 1.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uplc-1.3.3.tar.gz | 45.9 kB | Without provenance | Details for uplc-1.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uplc-1.3.3-py3-none-any.whl | Python 3 | none | any | Details for uplc-1.3.3-py3-none-any.whl |
Total release size: 100.7 kB
Release files / uplc-1.3.3.tar.gz
| Download URL | uplc-1.3.3.tar.gz |
|---|---|
| Size | 45.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
885c9fd5106780f4b3e1a1b11452bebff9b76c45141ded50e88f6825c72a17c0
|
|
BLAKE2b-256 checksum How to use checksums |
1d7f37edf2d3fcb5b04f005fb3992e2d4d341e60b431bd1c055be730d1e89607
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / uplc-1.3.3-py3-none-any.whl
| Download URL | uplc-1.3.3-py3-none-any.whl |
|---|---|
| Size | 54.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
729e981635256995336f5ee4873d71420a54febdab2b13c5e6c25b9313a3f91d
|
|
BLAKE2b-256 checksum How to use checksums |
318a5564bdc40b6f7902fec4263cb5f3d2c552bdfeb8ab4d148db9f0ca90b772
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for uplc 1.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.