Project Close-Out Report

Project Catalyst Fund 5 Close-Out Report By Quinn Parkinson

Important Information

Name of Project

Step-by-Step Guide: Off-Chain Code

Project URL

https://github.com/logicalmechanism/deterministic-finite-blockchains

https://cardano.ideascale.com/c/idea/350599

Project Start

07 April 2021

Project End

15 March 2022

Challenge KPIs

I went well over my estimated production time but I did hit some major KPIs along the way. Over the course of the project, I had to change the goals of the project. I made the proposal before smart contracts existed and I really knew what I was getting into in terms of the outcomes of a project. Unfortunately, this resulted in dropping the reactJS and the DFB analysis requirements. During development, I decided to focus on test net and trace solutions instead of the Plutus Playground. I found the playground to be too cumbersome for any major development beyond simple prototyping.

One of the biggest hurdles was actually implementing the DFB. There are no other examples like this project and it took a while to really get this project to the current point. It was worth it and the project only cost the community 5000 USD. I feel it was worth the time and effort.

Deliverables / KPIs

  • Full off-chain implementation of a D.F.B. on Cardano. (See GitBook)

  • Modeling of smart contracts in Plutus with fully functional playground files.

  • Fully open-sourced ReactJS components and Plutus smart contracts.

  • Well-written guides for Plutus smart contract development.

  • Full analysis of DFBs and their application as a token redistribution machine.

The goal of the project was really captured in this quote from the project proposal page.

The key benefit will be the amazing examples of smart contracts for off-chain computations. These examples can be used as a template or a guide to creating new applications in the ecosystem. The examples will be a combination of text, video, and images conveniently located in a GitBook space.

I wrote some amazing smart contract examples that showed the complexity of off-chain computations alongside some text and images that will help a user build their applications. I feel like I did hit the goals of this project even though some of the potential deliverables had to be dropped.

Achievements

This has to be one of the first projects on Cardano right now that actually uses some IOHK research inside an on-chain validator. The advancement of a DFB is basically a turn-based communication channel where the time-lock puzzle is the simulation of the DFB. The puzzle-solution pair will be the DFB as the puzzle and a subset of block hashes from the DFB, a la proof of proof-of-work-style since a DFB is an interconnected blockchain. It may not be a direct application of those research papers but I felt that they were in the same realm.

In terms of smart contracts for gaming, this has to be one of the first contracts that show how a UTxO can be used to store player information for games with a finite number of players. This should be very useful in the future as this type of validation is not seen in the pioneer program or in any of the Plutus example use cases.

An important achievement for me is that this is a project that no one has ever seen before I finished it. This is not another token marketplace, this isn't another token swap Defi/Realfi project. This is a very unique and original idea that is a great example for new Plutus developers who want to see a contract that is just different than anything else available.

Key Learnings

This type of project really shines a light on the importance of increasing the protocol parameters to allow for complex smart contracts. This contract is almost completely unusable with the current parameters. The inability to store a Value datatype inside the datum restricts the ability to verify who owns an arbitrary grouping of tokens inside a UTxO. The current memory parameters max out the number of players any game can have at about 10 players. Subtle but important learning is that on-chain Integers max out at 2^64 and off-chain do not max out. This causes confusion if a developer uses the Repl to trace test on-chain validation functions. This causes major issues if the calculation results in a very large integer in a non-deterministic way. Then at any point, a computation will max out and a UTxO will be locked permanently without any prior knowledge of this potentially occurring.

A lot of what I learned from this project is actually the limitations of what Plutus can actually do on-chain. It is fairly limited. In my honest opinion, I bought into Cardano on the assumption that I would be using a Turing complete smart contract language, and what I got is a memory-bound DSL-like smart contract language that is unable to compute the integer value of a sha3_256 hash and can not keep track of a Value datatype because we only can use 64 characters at a time inside a Datum value. Just these two small examples actually prevent a lot of use cases.

What's Next?

The project laid the foundation for future projects. It can be used as a guide for future developers or can be referenced in a contract in the future. It is here for the community. The project is done and I am moving on to new projects.

Final Thoughts

I liked this project a lot. I came up with this idea many years ago and I waited very patiently to implement it with Plutus on the Cardano blockchain. It was a fun project that I probably spent too much time on for how little I asked in compensation.

Last updated