Plutus Smart Contract Testing
In 2021, we investigated the behavior of Plutus smart contracts in actual projects. Our developers collaborated closely with the internal IOG team to identify bugs and take part in improvement discussions.
Before it was introduced on the mainnet, we tested the Alonzo Purple hard fork in particular. We were able to see how eUTXOs are stored, used in a transaction, and validated through testing.
IOG did not have a testnet that supports smart contracts at the time of our participation, nor did it have the necessary documentation. We've been running simulations. When the testnet appeared, it turned out that it did not support many features, such as PAB with wallets, state machines, etc. Additionally, the code that we successfully ran in the simulation did not always work in the real network. We were continually chatting with the Plutus developers and other participants in the contract test program in a dedicated Discord community about how to correct the mistakes that happened. The core IOG team has been very supportive; in particular, Director of Education Lars Brunies has been really receptive and helpful (hi, Lars!).
Sometimes no one had ready suggestions or advice, and we had to look into the Plutus source code and figure it out ourselves. Fundamental preparation helped us out here. It is an effective strategy for any industry, but it is especially beneficial for the blockchain because it is nearly impossible to create smart contracts without understanding what they are. And in some instances, the analysis of Ethereum's pre-existing solutions was helpful.
Creating an NFT marketplace
The first NFT marketplace featuring an auction on the Cardano blockchain was created as a result of participation in the Plutus platform testing program and IPFS protocol validation.
An NFT is produced in two steps: the first requires uploading the associated metadata (which might be any file, including an image), and the second involves minting the token and sending it to the creator's blockchain wallet. The IPFS protocol, which gives each file a distinct identification (it is a cryptographic hash), provides content addressability, which is needed for the first stage. The main purpose of the marketplace smart contract is to provide a direct link between the token in the user's wallet and this content ID. We were successful in achieving this, and in our marketplace you can now:
- Create your own non-fungible tokens;
- Form collections (packs) out of cards (tokens);
- Run an auction;
- Set the auction's starting price and duration;
- Upload audio, video, and image files.
The platform becomes profitable through commissions from NFT sales and auctions.
When the marketplace was launched on the test network in 2021, it was discovered that wallets do not integrate with PAB and it is impossible to sign transactions. The project was never launched on the testnet as a result.
Developing decentralized cloud storage
Iagon to develop a secure way for people to own and store their health data. The best environment for the idea's execution is blockchain technology, which offers transparency, openness, and immutability. We are assisting Iagon in developing a decentralized cloud system on the Cardano blockchain to exploit the underused computing and storage capacity of data centers, PCs, and smart devices. According to the idea of the creators, everyone will be able to offer free capacities on the market and earn passive income. The centralized large cloud providers (such as Google Cloud or Microsoft) will face competition from this decentralized cloud infrastructure.
Cardano was selected as the platform for deploying the protocol as the most successful combination of scalability, interoperability, environmental friendliness, low transaction costs, and science-based security. In Cardano's first decentralized cloud storage, a smart contract's primary function is to enable direct contact — i.e., communication between buyers of free storage capabilities and storage or compute providers.
As of this writing, we are having trouble integrating the contract with IOG frameworks like PAF (Plutus Application Framework). We are currently developing a solution. Simple contracts can be deployed without PAF, but complex and scalable solutions are left without a clear alternative to release the contract into the public domain. This is the other side of the Cardano development coin, which mainly focuses on node support and key elements.
Building an ADADAO stablecoin
Adadao is a decentralized landing page on the Cardano blockchain for lending AUSD stablecoins secured by ADA. AUSD can be used as a regular cryptocurrency for transmitting to other users or paying for goods and services.
Loans may be obtained with the provision of over-collateralisation (for example, 1 AUSD for 1.5 ADA collateral). An over-collateral is needed so that in the event of a fall in the value of ADA, AUSD remains secured. If a loan is found to be undercollateralized, the system cancels the borrower's debt and converts their collateral into AUSD through the stability pool, auction sale, or debt reallocation. When the loan is paid back, the user takes the collateral, and the received AUSD is burned.
At the time of this writing (August 2022), the majority of the protocol has already been developed. This includes smart contracts for lenders and donors to the Stability pool, contracts for liquidations, auctions, and a protocol management and monitoring module for ADA to AUSD to track and trigger liquidations. A contract for the distribution of liquidated debt, a contract for the control of the AUSD exchange rate, and a contract for ADAO token holders and voting are all in the research and development stage.
We ran into an issue with chain-index, the PAB component, while deploying the protocol on the testnet. Additionally, the majority of the simulation-specific code is incompatible with the testnet. Since there are no oracles on the mainnet, it is impossible to obtain the data required for the protocol to function. So, for the time being, we use a mock oracle (a fake oracle that we wrote ourselves; we change its data manually when we test something). It would be beneficial to have additional stablecoins on the mainnet, either for use in auctions or as a substitute currency for collateral.