Architecting Shelley: an interview with Duncan Coutts
A fireside chat with Duncan Coutts, Cardano's chief technical architect, about Haskell and delivering Shelley
7 April 2020 6 mins read
Duncan Coutts has been an important guide on the road to the Cardano Shelley mainnet. Long time supporters of IOHK are likely familiar with his signature long hair, beard, and penchant for drinking tea while discussing decentralization in front of a white board. He recently sat down for an interview to discuss the upcoming Byron reboot, the Haskell Shelley testnet, and the conclusion of the pre-Shelley development cycle. Coutts, who has been working with IOHK since 2016, brings a wealth of knowledge from working with the Haskell programming language for nearly 20 years and helping found the Well-Typed consultancy.
What’s your role at IOHK?
I’m the chief technical architect for the Cardano project and I’m primarily responsible for the design and implementation of the node. This means that I collaborate with the teams that work on consensus, ledger, networking, and other things. Ultimately, I work to bring everyone together around the same design after a discussion with the team leaders. The design of Cardano is the product of joint work by many individuals working together.
What does the Haskell programming language bring to Cardano?
Haskell is an enabler. It makes it easier for us to follow the approach that we believe is right, which is driven by computer science. We know how to do things properly; computer science tells us how. We just need to pick the appropriate techniques to do that. Haskell makes that easier.
It’s a good fit for Cardano because it suits the high-assurance, specification-driven software that is vital for a blockchain. Haskell helps us find systematic ways of avoiding mistakes. In essence, it’s a better mousetrap.
You’ve been working with Haskell for a long time. How have you seen the landscape of functional programming change?
People take it seriously now. When I started as an undergraduate in 1999, I thought that Haskell was amazing. Other students thought, ‘Wow that’s totally impractical. How will you ever get a job?’
At the time, functional programming was an academic curiosity. There wasn’t any prebuilt code and it wasn’t machine readable, which meant that Haskell wasn’t usable for a wide range of people. There wasn’t the tooling, range of libraries, or experience. That has changed over the years: the tooling got better, the libraries got better. IOHK has helped develop the infrastructure for building and distributing open-source Haskell code and the number of libraries exploded. That, combined with more teaching and a gradual change of attitude in the industry, means that people take it more seriously now. Haskell hasn’t changed as much as the industry around us has.
What’s the biggest change from an industry point of view?
There are two things. The first is that attitudes are changing, albeit slowly. People are changing their opinions about what they consider a sensible language choice. Previously, everything had to be in C or Java or maybe Python, but eventually good ideas make progress, even if it takes a long time. You can make a lot of progress by just recognizing that a good idea is a good idea. The mainstream does pick up on important developments, even if it does take 10 or 15 years. The industry has not embraced functional programming wholesale yet, but individual programmers have taken up various ideas. That makes Haskell look less radical.
If you look at a language like Rust, it has some of the clever type systems of Haskell, although it doesn’t have any functional programming ideas. Even Java and C++ have some functional programming ideas in them these days, so Haskell is not quite so far from the mainstream as it used to be.
The second major change has been performance, which is getting much better. We’ve recently become competitive with Java in terms of performance. It makes people say, ‘Wow, Haskell is so fast,’ but that’s because they’re comparing it to Python and PHP rather than C. So that’s another way of saying that Haskell has improved slightly, but the industry environment around it has changed as well.
You have been heavily involved in the Byron reboot which was kicked off last week. Why was this work important?
The Byron reboot is the culmination of over 18 months of hard work across multiple IOHK development teams, and constitutes a complete overhaul of the node infrastructure with 100% fresh code. The reboot introduces an extensible, modular design within the node itself, separating out the ledger, consensus, and networking components, as well as improvements and new functionality in the wallet backend and the Cardano explorer.
For Daedalus users, the Byron reboot will see us moving to a regular update cadence [see our recent piece on Daedalus Flight for more on that], after which they should find that Daedalus is faster, more reliable, and uses less memory. A lot of the issues users have experienced with Daedalus in the past were due to the underlying node, rather than Daedalus itself. The Byron reboot will go a long way to improving things, and users should see Daedalus syncing and restoring wallets within minutes, even when downloading the entire Cardano blockchain.
As the chief architect, your job is to lay the foundation for Cardano’s future. What have you focused on to achieve this?
The most important aspect in terms of flexibility for the future is keeping different functions separate. One of the big improvements of the Byron reboot is that the ledger rules will be totally independent of the consensus implementation; this modularity means that the ledger rules are perfectly clean mathematical functions, which is a core aspect of functional programming.
As a result, everything is easier to test, tweak, and change, both now and in the future. The consensus algorithm isn’t entangled with the details of the ledger rules, so we can alter the ledger rules without changing the consensus implementation. This makes integrating Plutus and smart contracts functionality much easier and will also help in the future when we are adding treasury and governance features.
The consensus implementation itself has also been parameterized so that we can transition from the Ouroboros Classic consensus protocol to BFT and then Praos, which also provides flexibility for future versions of the protocol that haven't been developed yet.
Shelley is a big step towards the future of Cardano, but what is the significance of compiling Haskell into JavaScript and WebAssembly?
We’re interested in compiling to JavaScript or WebAssembly because of Plutus. We want to have Plutus contracts or Plutus applications that can be distributed to users, which would include custom interfaces and custom logic with the user rather than in a server. Compiling to JavaScript allows us to do that; you can compile the Plutus code once and distribute it to users on different platforms.
Thanks to Duncan Coutts for his time. As chief technical architect, he’s a cornerstone of the Cardano project and has been fundamental to the ongoing success of the platform. For more interviews with the team, stay tuned to our social channels and the IOHK blog.
Plutus and Marlowe in the spotlight at WyoHackathon 2019
Plutus and Marlowe, IOHK's smart contract programming languages, will have their next generations released at the 2019 WyoHackathon
20 September 2019 4 mins read
The Cardano network was engineered to be the best possible foundation for the future of decentralized technology – but a foundation is only as good as what can be built upon it. Smart contracts are one of the most powerful ways a distributed network can generate value, allowing individuals and organizations to agree to conditions and automatically execute exchanges of information and wealth, all in a trustless way without relying on third parties. But smart contracts are still code, which means that the languages and tools they’re written with make a difference to their final level of security, efficiency, and reliability.
That said, understanding the potential of smart contracts is different from realizing their integration and adoption. Existing smart contract languages provide the basis for a solution, but are not the final answer. Current smart contracts are complex and difficult to program, partly because they’re built with languages created at the emergence of distributed technologies, and are vulnerable to malicious actors. Blockchain technology has changed drastically since it first emerged, and the conditions that underpinned the first languages are no longer true. The first answer to a problem is rarely the best, and any enterprise-focused solution cannot be gated by complexity or threaten network security.
Bringing functional programming to smart contracts with Plutus
We’re big fans of functional programming here at IOHK and are proud to be able to say that the code underpinning the Cardano network is written in Haskell, the world’s foremost functional programming language. Plutus is no different. Compared to their object-oriented counterparts, functional programming languages are less prone to ambiguity and human error – always a good thing – as well as being easier to verify and test. By using Plutus to write smart contracts on the Cardano network, developers benefit from all of the above, as well as the ability to use the same language for both on and off-chain code.
While developers will have to wait for the Goguen era to launch smart contracts on the Cardano network, they can begin testing their smart contract skills in the Plutus Playground. IOHK has also created a Plutus ebook and Udemy course to help developers hit the ground running once Plutus is available on the Cardano mainnet.
And bringing Plutus to everyone with Marlowe
The problem with smart contracts, however, is that sometimes the people who know how to write the code don’t have the industry expertise to know how to structure the contracts themselves. Enter Marlowe, IOHK’s domain-specific language (DSL). Marlowe is designed for use by anyone that wants to write a financial smart contract without the programming skills to implement it. Users can try out Marlowe via the Marlowe Playground, a web utility with a user-friendly GUI and drag and drop components, where they can create financial smart contracts which, when complete, will generate fully-functional, implementation-ready Plutus code.
Marlowe gives anyone the ability to gain familiarity with smart contracts while protecting them from unexpected outcomes. It also protects the developer and the system by ensuring that ill-formed smart contracts cannot be run. Finally, Marlowe focuses on commitment-of-funds and time-outs. These make certain that both parties have dedicated funds in the agreement while ensuring that money will not be left in the system after a contract has concluded.
Laying solid foundations
Plutus, Marlowe, and the Cardano ecosystem continue to evolve to provide the safest and most efficient conditions to build decentralized applications. The next generations of Plutus and Marlowe will be announced at the WyoHackathon at the University of Wyoming on September 20, ahead of their release on mainnet at the start of the Goguen era. Marlowe advances include a high-fidelity development system that aids the writing of executable contracts and the new iteration of Plutus will allow users to access their contracts from web or mobile applications. To get the latest news from the event, you can follow the WyoHackathon’s Twitter feed.
At IOHK, we're focused on creating the safest, most efficient platform for the building of decentralized applications. Plutus and Marlowe will be the first building blocks to be placed on the foundation which is the Cardano network – and they won't be the last. With this new suite of accessible, inclusive tools, Cardano becomes more capable of serving the diverse audiences that stand to benefit from a secure, decentralized network platform.
Artwork,IOHK brings Plutus to Wyoming's hackathon
Cardano engineers introduce next phase of the smart contract platform to the Cowboy State
12 September 2019 3 mins read
The state of Wyoming is famous for being part of the American frontier, but it has also established a new reputation, with blockchain pioneers blazing trails in the Cowboy State. But why Wyoming?
The blockchain revolution in Wyoming is the result of a series of laws and regulations passed within its borders. These key pieces of legislation include exemptions from money transmitting laws for virtual assets, as well as a blockchain ‘sandbox’ bill that would allow decentralized businesses to operate free from the red tape encountered elsewhere in the US. The state is also home to the Wyoming Blockchain Coalition, headed by former Wall Street corporate financier Caitlin Long, which has worked to make Wyoming the standard-bearer of blockchain in the country.
In 2018, IOHK relocated its headquarters to Wyoming to take advantage of the state’s legislative embracing of distributed ledger technology, making it the biggest decentralized company in the state. As a result, IOHK has become a nexus for developers, crypto enthusiasts, businesses, and government officials in the area. Events like the 2019 WyoHackathon bring these groups together to advance the cutting edge of blockchain innovation.
‘We’re thrilled to welcome the Cardano community to this special event in IOHK’s home state,’ says Caitlin Long. The event has also inspired a group of high school students from a remote part of Wyoming to make the journey to participate in the hackathon and meet IOHK CEO, Charles Hoskinson. ‘There is something special building between the University of Wyoming computer science department and Cardano!’ she adds.
The hackathon will see hundreds of developers participating in workshops, presenting papers, and acquainting themselves with new technology. Charles Hoskinson and Cardano’s senior product manager David Esser will be among the speakers at the event, alongside prominent leaders in the blockchain industry such as Jesse Powell of Kraken and Anthony Pompliano of Morgan Creek Digital. September marks the second anniversary of the Cardano project and is a milestone for IOHK, with several major advances to Cardano being delivered. Plutus engineers Jann Müller and Michael Peyton Jones will be at the event to explain how work on Cardano is progressing to create the ideal environment for smart contract development and execution.
Last but certainly not least, the next iteration of the Plutus framework will be released during the hackathon. Plutus is a functional programming language and smart contract platform that allows developers of all kinds to launch smart contracts on the Cardano network. While Ethereum paved the way for programmable blockchains, it also has some significant barriers to entry. IOHK aims to bring greater scalability, sustainability, and interoperability to the crypto sphere by allowing anyone to build on a distributed ledger. Ultimately, it is developers that will build the businesses which will solve local and international problems. Plutus was created to enable those developers, and is supported by an IOHK-created [programming book](https://www.amazon.com/Plutus-Writing-reliable-smart-contracts-ebook/dp/B07V46LWTW "Plutus ebook on Amazon, amazon.com").
Both Wyoming and IOHK have aligned their interests in supporting the next generation of thinkers in distributed ledger technology. Events like the hackathon help to inspire and elevate those who will build the decentralized infrastructure of the future. We hope that the 2019 WyoHackathon will be another pioneering step on the road towards better, more comprehensive adoption and use of both blockchain and crypto technology.
To find out more, check out the [WyoHackathon 2019 website](https://wyohackathon.io/ "WyoHackathon 2019 website, wyohackathon.io").
Search blog
Recent posts
Oasis Pro deal will give developing world better access to financial markets by Anthony Quinn
26 September 2021
Cardano fund injecting $6m to support Africa’s pioneers by Anthony Quinn
25 September 2021
Cardano to integrate Chainlink oracles for real-time market data by Tim Harrison
25 September 2021