Python-Cardano / pycardano

A lightweight Cardano library in Python
https://pycardano.readthedocs.io
MIT License
215 stars 70 forks source link

Plutus Blueprints #244

Open nielstron opened 1 year ago

nielstron commented 1 year ago

Is your feature request related to a problem? Please describe. Plutus Blueprints are increasingly used for Cardano Smart Contracts [citation needed]. A part of these blueprints is a schematic description of PlutusData classes in json.

Describe the solution you'd like Add a function to pycardano that converts plutusdata classes to plutus blueprints.

Describe alternatives you've considered None

Additional context https://cips.cardano.org/cips/cip57/#corevocabulary

nielstron commented 1 year ago

See #276

nielstron commented 1 year ago

It is not entirely clear to me how other libraries "read" Plutus Blueprint Descriptions of PlutusData objects - this could in principle be done but I don't see the added value. This would effectively generate types at runtime and hence not give any improvements regarding type safety. One maybe interesting topic could be "validating" a PlutusData schema against the schema of a certain contract.

nielstron commented 1 year ago

Note that we can re-use a lot of the definitions here: https://github.com/OpShin/opshin/pull/279 It also introduces "reading" and dynamically generating PlutusData objects, however still lacks type checks when using "apply_parameter".