Overview
Elm Cardano is an open-source code library that lets web developers build Cardano apps in Elm, a programming language for web pages. It handles the part of an app that runs in the user's browser: assembling transactions, working out what they need, and handing them to a wallet for signing1,2. The project aims to make this browser-side code easy and productive to write, and pairs it with Aiken, a language for writing smart contracts, the programs that run on the blockchain itself3.
Elm compiles to JavaScript, and the Elm Cardano README puts Elm's lack of runtime crashes first in its case for building this way3. The Cardano Developer Portal lists Elm Cardano among its SDKs and libraries, meaning ready-made toolkits for developers4. Its maintainer, Matthieu Pizenberg, walked through the project's architecture and its road to a 1.0 release in a Cardano Developer Office Hours session, where he was introduced as a senior software engineer at the Cardano Foundation5.
Key Features
- Say what a transaction should do, and let the library fill in the rest. Developers list intents, such as sending tokens, minting tokens, spending from a smart contract, delegating stake, or voting, and Elm Cardano adds the fee and collateral (a deposit that contract transactions require) and lists which keys must sign2.
- Smart contract checks inside the browser. Elm Cardano runs Aiken's contract engine, compiled to WebAssembly (a format that runs fast code inside a web page), so an app can see whether a contract accepts a transaction and how much computing it uses6.
- Built-in wallet connection. The Elm Cardano command-line tool adds the code apps need to reach browser wallets through CIP-30, the standard Cardano wallets use to connect to websites6.
- Governance actions from the app. Support for CIP-95 lets Elm Cardano apps use a wallet's DRep-related features7, and the library can build transactions that register a DRep (a delegated representative who votes for ADA holders) or cast governance votes2.
- Working examples to copy from. The Elm Cardano repository ships example apps for locking funds with an Aiken contract, a gift card, a third party paying someone else's fees, DRep voting, governance proposals, and testing each CIP-30 wallet function8.
What to Expect
Developers who already write Elm add Elm Cardano as one more toolkit. The one difference is that apps compile through the Elm Cardano command-line tool instead of the standard Elm compiler, because Elm does not let code call JavaScript or WebAssembly directly9. The tool comes as downloads for Linux, macOS, and Windows, and through npm, the JavaScript package manager9. A starter command sets up a template project with a web page and a main Elm file3.
The library does not fetch blockchain data by itself. An app collects the funds a wallet can spend, from the wallet and from any data service the developer picks, such as Blockfrost, Koios, or Ogmios, then passes them in6. Because of that design, the same transaction-building code also runs in automated tests on a developer's machine6.
Questions go to the elm channel on the TxPipe Discord server6. Readers comparing options for other programming languages can browse the transaction builders category.
Visitors without coding experience will find source code, reference docs, and example projects rather than an app to use. Elm Cardano sits behind wallet-connected web apps; it has no screens of its own.
