status

It Is Smart To Use Plutus V2 Applications

Published 5.1.2024

Cardano blocks are often full for a longer period. It may happen that the mem-pool will be full. In this case, users may not be able to submit the transaction on the first try. First-generation apps built on Plutus V1 are inefficient. By choosing to use the Plutus V2 application instead of the Plutus V1 one, users can influence how many transactions fit into a block. In this way, they can significantly contribute to higher network throughput.

Vasil Hard Fork

Plutus V1 was the initial version of Plutus, introduced in the Alonzo hard fork in September 2021. With this version, developers could start building the first applications for Cardano.

All popular DEXes like MinSwap, SundaeSwap, and WingRiders were built on Plutus V1.

Plutus V2 was introduced in the Vasil hard fork in September 2022. Vasil included the implementation of several important CIPs. In particular, CIP-31, CIP-32, and CIP-33. These had a significant impact on increasing the efficiency of smart contracts.

Applications created using Plutus V2 are more efficient, especially from a storage perspective, which has a positive effect on network throughput. Users should prefer to use applications built on Plutus V2, as network resources are used more efficiently.

How Plutus V1 differs from Plutus V2

Let's briefly explain what Plutus V2 brought.

In Plutus V1, Datums were carried in transaction outputs. They stored and provided access to information on the blockchain. To access information in the Datum, it was necessary to spend the output that the Datum was attached to. This required the re-creation of a spent output. This is a very inefficient approach.

The addition of reference inputs in Plutus V2 (CIP-31) allows developers to look at the Datum without extra steps. This facilitates access to information stored on the blockchain without the need for spending and re-creating UTxOs.

Thanks to reference inputs, applications can effectively inspect the current state (locked value). On-chain data providers can store data in outputs and this data can be referenced by other scripts (data consumers). The provider pays for data storage only once, and the data can be used by other scripts several times in a row.

In Plutus V1, transaction Datums were attached to outputs as hashes.

With the implementation of inline Datums (CIP-32), developers can now create scripts and attach Datums directly to outputs instead of using their hashes. This simplifies how dates are used. A user can see the actual Datum rather than supply it to match the given hash. This simplifies the communication of Datum values between users.

So, transaction outputs can contain either a hash or a Datum. When an output with an inline Datum is spent, the spending transaction does not need to provide the Datum itself.

In Plutus V1, when spending an output locked within a Plutus script, the script had to be included in the spending transaction. This increased the size of the transaction and also caused certain delays in its processing.

The reference scripts upgrade (CIP-33) allows developers to reference a script without including it in each transaction. This significantly reduces transaction size, improves throughput, and reduces script execution costs. You only need to pay once to store the script in the blockchain, and the script can be used (be referenced) multiple times.

Why Prefer Plutus V2 Applications

Transactions from Plutus V1 applications take up significantly more block space compared to transactions from Plutus V2 applications.

Using Plutus V1 applications reduces network throughput, as fewer transactions (fewer user operations) fit into a block.

Currently, about half of SC transactions use Plutus V1, and the other half use Plutus V2. However, transactions from Plutus V1 applications take up to 90% of block space.

The use of Plutus V2 transactions has been increasing over time but has recently started to decline slightly.

Younger applications are mostly built on Plutus V2. Many teams are migrating their applications from Plutus V1 to Plutus V2. It can be expected that the most popular applications will soon be on Plutus V2. The amount of transactions from Plutus V2 applications is very likely to grow.

Users can contribute to the higher throughput of the Cardano network by preferring Plutus V2 applications. They can also let teams know that they require applications to be migrated to a newer version.

If you want to know which version of the Plutus script is used by the application you are using, you can find out via Cexplorer in the dApps section.

Find the application you are interested in and then click on script hash. A new window will open in which you will find the Plutus version.

The Indigo Protocol uses Plutus V2 (stability pool script).

It is good to know that the effective use of network resources affects not only the Plutus version but also the specific implementation of the script. For example, transaction sizes from a few DEXs using the same Plutus version can vary significantly.

However, the Plutus version has a significant impact on the size of transactions.

The average transaction size from DEXs using Plutus V2 can be up to 5 times smaller than from DEXs using Plutus V1. In extreme cases, up to 10 times smaller. If all users started using only Plutus V2 applications, the throughput of the Cardano network could increase significantly. Maybe several times.

Conclusion

Teams whose applications run on Plutus V1 should migrate to Plutus V2 as quickly as possible. This costs effort, time, and money. It will be necessary to do a security audit of new scripts. Many teams have already announced that they are working on the migration.

Users can use the applications they want. However, they should know the consequences if they decide to use an ineffective application. Especially if the network becomes congested, users can significantly help improve Cardano's throughput by making the right choice. Remember that higher efficiency should lead to lower fees.

Featured:

Related articles

Did you enjoy this article? Other great articles by the same author