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
ProtocolVersiontype (major/minor) fromPlutus.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 :: IntandpvMinor :: Intdescribing 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.ApiCommonto retrieve allowed builtin functions for a given ledger and protocol version.
Last updated