Plutus.V1.Ledger.ProtocolVersions

  • 1. πŸ“œ Overview

  • 2. πŸ”§ Imports

  • 3. 🏷️ Protocol Version Constants

    • 3.1 🐚 shelleyPV

    • 3.2 πŸ§ͺ allegraPV

    • 3.3 πŸ“¦ maryPV

    • 3.4 πŸš€ alonzoPV

    • 3.5 🌊 vasilPV

  • 4. πŸ’‘ Example Usage

  • 5. πŸ“š Glossary


1 πŸ“œ Overview

The Plutus.V1.Ledger.ProtocolVersions module defines named ProtocolVersion values corresponding to the major Cardano ledger eras. These constants simplify referencing the protocol versions at which features or builtins were introduced.

Based on the IOHK Cardano Ledger Wiki.


2 πŸ”§ Imports

import Plutus.ApiCommon (ProtocolVersion(..))
  • Brings in the ProtocolVersion type (major/minor) from Plutus.ApiCommon.


3 🏷️ Protocol Version Constants

Each constant is a ProtocolVersion with pvMajor and pvMinor indicating the major and minor components.

3.1 🐚 shelleyPV

  • Era: Shelley (introduced in Cardano era Shelley)

  • Fields: pvMajor = 2, pvMinor = 0

3.2 πŸ§ͺ allegraPV

  • Era: Allegra

  • Fields: pvMajor = 3, pvMinor = 0

3.3 πŸ“¦ maryPV

  • Era: Mary

  • Fields: pvMajor = 4, pvMinor = 0

3.4 πŸš€ alonzoPV

  • Era: Alonzo

  • Fields: pvMajor = 5, pvMinor = 0

3.5 🌊 vasilPV

  • Era: Vasil

  • Fields: pvMajor = 7, pvMinor = 0


4 πŸ’‘ Example Usage

Use these constants when decoding or validating scripts based on the era’s protocol version. For example:


5 πŸ“š Glossary

  • ProtocolVersion: record with pvMajor :: Int and pvMinor :: Int describing the ledger’s software and hard fork version.

  • Shelley / Allegra / Mary / Alonzo / Vasil: successive Cardano eras, each introducing new features and builtin functions.

  • PlutusV2: ledger’s reference to the Plutus language version (used when calling builtinsAvailableIn).

  • builtinsAvailableIn: function from Plutus.ApiCommon to retrieve allowed builtin functions for a given ledger and protocol version.

Last updated