- L2 frameworks developer Paima Studios has announced a new way of accessing transaction metadata directly from Cardano’s smart contracts language Plutus.
- The new Aiken smart contract accesses the transaction hash, which contains the metadata, opening up new opportunities in NFT AMMs, on-chain gaming, interoperability, and more.
As Cardano grows to incorporate a thriving decentralized ecosystem, one challenge that has plagued the network is the inability of the native smart contracts language, Plutus, to access transaction metadata, holding back NFTs, on-chain games, and more. Paima Studios, a Web3 application engine firm, has now solved this challenge.
Paima co-founder Sebastien Guillemot announced the new update over the weekend.
We managed to get a Cardano Plutus script to validate CIP25 metadata 🔥
Big implications, and enables many new use-cases:
・NFT AMMs (not easily doable in EVM!)
・New interop standards
・Onchain gamesand we just open-sourced it🫡
How did we achieve this? ↓🧵 pic.twitter.com/KUikGQtWzX— Sebastien Guillemot (@SebastienGllmt) July 6, 2024
Cardano NFTs—which have become increasingly popular—are issued under token standard CIP25. This standard, similar to Ethereum’s ERC-721, defines how NFT issuers define an NFT’s attributes, such as its image, name, URL, and more on its transaction metadata.
So far, the challenge for Cardano developers has been that the network’s smart contract language Plutus is unable to access this metadata. This has hindered dApps built on Cardano from accessing this data and limited the extent to which NFTs on the network could be utilized.
First, it’s worth noting that this is not just a Cardano problem. Ethereum, despite being much more advanced, also suffers similar failures. Ethereum developers overcome this challenge using oracles that link to off-chain data or by adding some complex mechanism.
Cardano developers have attempted to solve this challenge as well. The most common solution is a new improvement proposal—CIP68. This standard forsakes the transaction metadata altogether, turning to a whole new on-chain data system known as datums.
CIP68 solved the issue but created new challenges. For instance, many tools built on Cardano still support the previous standard—that’s CIP25. It’s also costlier as it relies on datums, which require twice as many UTXOs, thus costing double the previous standard.
Solving Cardano’s NFT Transaction Metadata Challenge
Guillemot and his team at Paima propose a new approach that seeks to access metadata directly through Plutus, regardless of the token standard. To do this, the team uses Plutus to access the transaction hash, which contains the metadata.
But what if we could access tx metadata (CIP25 & more) directly from Plutus? 🤔
It turns out you can using a clever trick!
Plutus cannot access metadata directly, but can access the tx hash (which contains the metadata!) pic.twitter.com/pmDxqc8ohK
— Sebastien Guillemot (@SebastienGllmt) July 6, 2024
Under this proposal, a Plutus smart contract is armed with the final transaction hash and goes on to provide all the other fields and checks that the hash matches.
Guillemot explained the mechanics, stating:
We built an Aiken smart contract that does exactly this: it reconstructs the transaction binary data in Aiken and checks if it matches the hash! This answers one of two questions: Is it feasible? Is it efficient/cheap enough?
Guillemot’s team found that this new approach costs half as much as the prevailing CIP68 standard as it cuts down the number of UTXOs.
Meanwhile, ADA trades at $0.3744, gaining 2.36% in the past day where it dipped to a 24-hour low of $0.3335 before staging a comeback.