Skip to Content
Scalus Club is now open! Join us to get an early access to new features 🎉
DocumentationOnboardingFor Cardano Developers

Scalus for Cardano Developers

Welcome! You know Cardano’s eUTxO model, Plutus, and blockchain fundamentals. Now learn how to build validators using Scala 3’s powerful type system and professional tooling.

Why This Path Works for You

You already understand:

  • ✓ UTxO model, datums, and redeemers
  • ✓ Validator logic and on-chain execution
  • ✓ Plutus Core and script evaluation

You’ll learn:

  • Scala 3 fundamentals - Just enough to write validators
  • Type-safe development - Catch errors at compile time
  • Professional debugging - Use IDE breakpoints, not trace logs
  • Familiar concepts - Datums, redeemers, and script context in Scala

Time Investment: ~4-6 hours to productivity, ~2-3 days to proficiency


Your Journey in 4 Steps

Step 1: Quick Start (30-45 minutes)

Goal: Get your first Scalus validator running and see it work in your IDE

Setup

  • Install Scalus - Set up Scala, SBT, and your development environment

First Contract

🎯 Quick Win: You’ll have a working validator and see it execute step-by-step in IntelliJ IDEA or VS Code. No more blind trace debugging!

What You Just Learned:

  • Scalus validators look familiar (datums, redeemers, script context)
  • But you can debug them like regular code with breakpoints
  • The @Compile annotation marks code for on-chain compilation

Step 2: Learn Scala Essentials (2-3 hours)

Goal: Understand enough Scala to write and read validators confidently

Scala 3 Crash Course for Cardano Devs

Don’t Skip This: You need Scala basics to be productive. These resources are curated for speed.

Option A: Quick Video Course (Recommended)

  • Scala 3 for Beginners  by Rock the JVM (2 hours)
    • Focus on: vals, defs, case classes, pattern matching, collections
    • Skip: implicits, type classes, advanced features (you won’t need them initially)

Option B: Interactive Tutorial

Option C: Quick Reference (If you’re in a hurry)

Scalus-Specific Scala Features

🎯 Quick Win: Write a simple token minting policy using pattern matching and Scala collections.


Step 3: Cardano-Specific Development (2-3 hours)

Goal: Build production-ready validators using Cardano-specific features

Core Validator Concepts

Testing & Quality

Build & Deploy

  • Compiling Validators - Generate UPLC, create blueprints, attach to transactions
  • Evaluating Scripts (In progress) - Run validators locally, check execution costs

Off-Chain Transaction Building

🎯 Quick Win: Build a tested, optimized validator and deploy it to testnet with a complete off-chain application that interacts with it.


Step 4: Production Ready (Ongoing)

Goal: Master advanced patterns and optimizations

Optimisations

Design Patterns & Security

🎯 Quick Win: Optimize a validator to reduce execution units by 20-30% using advanced techniques.


Common Questions from Cardano Devs

”Do I really need to learn Scala?”

Short answer: Yes, but not all of it.

You need ~10% of Scala to be productive:

  • Basic syntax (vals, defs, case classes)
  • Pattern matching (you already know this concept from Plutus)
  • Collections (List, Map)
  • Type annotations

That’s it. You can learn this in 2-3 hours and be writing validators.

”How different is Scalus from Aiken/Plutarch?”

Conceptually: Almost identical. Datums, redeemers, script context, validators - all the same.

Syntactically: Different, but familiar patterns:

ConceptAikenScalus
Type annotationvalue: Intvalue: BigInt
Pattern matchingwhenmatch
List operationslist.filter(fn)list.filter(fn)
Require checkexpect True = ...require(condition, "msg")

”What about debugging?”

This is where Scalus shines:

Aiken/Plutarch:

trace @"checkpoint 1" // Hope you see this in logs trace @"value" value // Print debugging

Scalus:

// Set breakpoint in IDE val owner = datum.to[PubKeyHash] // ← Breakpoint here // Step through, inspect variables, see call stack

You get real debugging with IntelliJ IDEA or VS Code.

”Is it production-ready?”

Yes. Scalus validators compile to standard Plutus Core and run on Cardano mainnet just like any other Plutus script.


Common Pitfalls & Solutions

Pitfall #1: Trying to use unsupported Scala features

Problem: Not all Scala features compile to UPLC (e.g., mutable vars, try-catch, complex type classes).

Solution: Always check Supported Features before using advanced Scala features.

Pitfall #2: Forgetting the @Compile annotation

Problem: Your validator runs in Scala but doesn’t compile to UPLC.

Solution: Always annotate validator objects with @Compile:

@Compile // ← Don't forget this! object MyValidator extends Validator

Pitfall #3: Using Scala standard library directly

Problem: Scala’s scala.collection.List doesn’t exist on-chain.

Solution: Use Scalus types: scalus.prelude.List, scalus.builtin.ByteString, etc.


Essential Scala Resources

Quick References

Video Courses

Interactive Learning

When You’re Stuck


Get Help

Need assistance? Connect with the Scalus community:

Happy building! 🚀

Last updated on