Last updated 9 months ago
Reference inputs (CIP-31) will address Cardano's "concurrency problem" but there are no guidelines on how best to implement this feature.
An open source Javascript SDK that demonstrates how best to publish and consume on-chain data using Cardano's CIP-31 reference inputs.
This is the total amount allocated to Reference Inputs SDK ▶ MLabs+Orcfax.
Reference inputs are a solution to Cardano's on-chain data publishing problem. Currently, the only way that Cardano smart contracts can receive input datum is from transaction outputs. In Cardano's EUTXO model these are single use. This creates a concurrency problem. Only one script can spend and read the output and then it does not have any obligation to re-post that datum as a new transaction output.
The only way to resolve this issue currently is via off-chain coordination. That goes against decentralization principles.
Fortunately, CIP-31 reference inputs provide the ability to reference the output of a Cardano transaction without having to spend it. This will allow for a data publication model where datum can be read many times by multiple smart contracts without the requirement to consume the publishing transaction. This will greatly simplify the ability for oracles to publish data on-chain for use by Cardano smart contracts.
CIP-31 functionality will be introduced by IOG in the June Vasil hard fork. The Cardano community will be well-served by an exemplar implementation. MLabs and Orcfax are uniquely positioned to design a CIP-31 reference implementation. Both teams have use for this new reference inputs functionality in their projects. They want to share their design choices and tooling with the Cardano open source development community as a Software Development Toolkit (SDK) written in Javascript.
The SDK will be released under MIT license. Documentation will be released under Creative Commons license. The SDK will contain a sample Plutus smart contract for a stop-loss order that is triggered using an oracle data feed.
The ability to consume smart contract data as reference inputs, without having to spend transaction data, will be a major design upgrade for the Cardano smart contract ecosystem.
MLabs will use its well-respected Cardano infrastructure engineering expertise to develop a best-practice reference implementation with a Javascript SDK. It will be used to create a Cardano oracle that publishes off-chain data as CIP-31 reference inputs to an exemplar smart contract that consumes this data on-chain.
The Orcfax project will use this design pattern and SDK for its Cardano oracle implementation. The tooling and documentation will be a valuable resource in the Cardano open-source ecosystem for all developers tackling the input of off-chain data to Cardano smart contracts.
RISK 1: The introduction of CIP-31 (and supporting CIP-32, CIP-33) is delayed by IOG.
STRATEGY: This feature is a top priority for IOG to make Cardano a competitive L1 so delays are very unlikely. Reference inputs have been publicly announced by the IOG delivery manager for June release and CIP-31 related issues and PRs on Github are active and advanced. Even if it is delayed, this Reference Inputs SDK project can progress on Testnet.
RISK 2: The project introduces insecure code onto Cardano Mainnet.
STRATEGY: This project will not be creating a production Mainnet implementation. It will create as-is development tools that will be tested on Cardano Testnet and released, without liability, under open-source MIT license. When Orcfax pushes its infrastructure to Cardano Mainnet it will engage a third-party security audit. It is recommended that all risk-averse Cardano projects do the same.
RISK 3: The complexity and scope of smart contract use cases makes it difficult to chose a generic example.
STRATEGY: The most well-known implementation of oracles in the blockchain space is crypto-currency exchange rate feeds. We'll create an exemplar Plutus smart contract that sets a stop-loss order at a specific BTC/ADA price. We'll trigger that script when the oracle publishes the matching data. The design pattern adopted to implement this use case can form the basis of many other types of interactive oracle-based smart contracts that Cardano developers will need to implement.
This project will launch during summer vacation in North America/Europe so the schedule has been extended to six months to account for a soft launch start.
After 2 months:
After 3 months:
After 4 months:
After 5 months:
After 6 months:
MLabs: 2 developers + 1 project manager
6 months - 560 hours x $145USD/hr ($81,200)
Tasks:
Orcfax: 1 developer + 1 project manager
6 months - 310 hours x $100USD/hr ($31,000)
Tasks:
TOTAL: $112,200
* Both MLabs and Orcfax command high hourly rates due their Cardano domain expertise. However, they charge less than many expert software consultants do in similar North American/European markets.
MLabs (6 months / 560 hours): 2 software developers + 1 project manager
Orcfax (6 months / 310 hours): 1 software developer 1 project manager
----------------------------------------------------
MLabs lead: George Flerovsky - Delivery Manager
George manages a portfolio of projects at MLabs including decentralized exchanges, governance, auctions, yield optimization, and on-chain analytics. He has been a Haskell developer since 2015 and has a deep knowledge of the Cardano consensus protocol, smart contract framework, and network stack.
George participated in the first cohort of the Plutus Pioneers Program in summer 2021 and has actively contributed to the Alonzo Blue, White, and Purple testnets. George has also worked on innovative solutions such as a streaming merge algorithm for concurrency in the Cardax decentralized exchange. We'll be relying on his Cardano architecture expertise to guide the design of the oracle smart contract use case.
LinkedIn: https://www.linkedin.com/in/george-flerovsky-01943836/
GitHub: https://github.com/GeorgeFlerovsky
Orcfax lead: Peter Van Garderen - Project Manager
Peter is founder of the Orcfax Cardano oracle project. Peter is a professional archivist and renowned digital records expert. For the past fifteen years he has managed the delivery of open source software projects used by archival repositories around the world.
In the first phase of the Orcfax project he has been applying archives and record-keeping standards to the oracle information pipeline to improve the trustworthiness of on-chain data. As co-founder of the Landano project, Peter is also working on bringing reliable geo-spatial data into Cardano smart contracts for use in land administration systems.
Peter will manage software QA, implementation of Reference Inputs into the Orcfax oracle reporting solution, as well as documentation of the SDK for use by the Cardano open source development ecosystem.
LinkedIn: https://www.linkedin.com/in/petervangarderen/
Github: https://github.com/peterVG
This project will be successful and done when the Cardano open source development ecosystem has:
This project is a continuation of the Catalyst Fund 6 Orcfax project. See https://cardano.ideascale.com/c/idea/367650
Orcfax developed a Plutus proof-of-concept for oracle publication when it encountered the concurrency problem inherent in the current EUTXO design. It is eagerly awaiting the implementation of CIP-31 to push its oracle project into production on Cardano Mainnet. See this post for more background.
For Orcfax updates follow us on Twitter:
Sign up for our blog newsletter:
MLabs developers maintain a repository of Plutus best practices for Cardano developers. The design pattern chosen for this reference inputs project can contribute to this knowledge base: https://github.com/Plutonomicon/plutonomicon
NB: Monthly reporting was deprecated from January 2024 and replaced fully by the Milestones Program framework. Learn more here
The MLabs development team are expert Plutus consultants that have architected solutions for top Cardano projects. The Orcfax project has prototyped data validation and archiving for oracles and will add CIP-31 on-chain publication to its Cardano solution.