Last updated a month ago
Many smart contract design patterns in Cardano are poorly documented, unintuitive, or unknown to most developers. This hurts adoption, and performance, and increases audit costs across the ecosystem.
We will document production dApp smart contract design patterns and update our open-source Plutarch / Aiken libraries to encompass these patterns.
This is the total amount allocated to Anastasia Labs - Smart Contract Design Patterns Conway+.
1/4
Core Infrastructure Patterns & Repository Restructure
Cost: $ADA 30,000
Delivery: Month 1 - Dec 2025
2/4
Expansion of Smart Contract Design Patterns: Footguns, Merkle Forestry & Metaprogramming
Cost: $ADA 30,000
Delivery: Month 3 - Feb 2026
3/4
Dynamic Parameterization & Event Map Design Patterns
Cost: $ADA 25,000
Delivery: Month 6 - May 2026
4/4
Final Documentation, Outreach, and Closeout Report
Cost: $ADA 15,000
Delivery: Month 7 - Jun 2026
NB: Monthly reporting was deprecated from January 2024 and replaced fully by the Milestones Program framework. Learn more here
Please provide your proposal title
Anastasia Labs - Smart Contract Design Patterns Conway+
Enter the amount of funding you are requesting in ADA
100000
Please specify how many months you expect your project to last
8
Please indicate if your proposal has been auto-translated
No
Original Language
en
What is the problem you want to solve?
Many smart contract design patterns in Cardano are poorly documented, unintuitive, or unknown to most developers. This hurts adoption, and performance, and increases audit costs across the ecosystem.
Supporting links
Does your project have any dependencies on other organizations, technical or otherwise?
No
Describe any dependencies or write 'No dependencies'
No dependencies
Will your project's outputs be fully open source?
Yes
License and Additional Information
MIT
Please choose the most relevant theme and tag related to the outcomes of your proposal
Smart Contracts
Mention your open source license and describe your open source license rationale.
This project is already open source and publicly available at https://github.com/Anastasia-Labs/design-patterns under the permissive MIT License. The MIT License is widely adopted across the open source ecosystem due to its simplicity and flexibility. It allows anyone to use, modify, distribute, and build upon the code freely, including in commercial settings, while ensuring attribution to the original authors.
How do you make sure your source code is accessible to the public from project start, and people are informed?
The source code is already available in a repository that has wide recognition and socialization throughout the ecosystem. This proposal expands upon the work within the Anastasia-Labs/design-patterns repo, and these updates will be socialized to the developer community.
How will you provide high quality documentation?
We already maintain this repository with a clear commitment to accessible, high-quality documentation. It is actively referenced by teams across the ecosystem often used to explain design patterns during technical discussions, onboarding, or internal audits. Our documentation includes concise, well-organized code comments, examples, and rationales, helping teams understand both the “how” and “why” of each pattern. The ongoing traction evident in ecosystem usage and GitHub engagement demonstrates its role as a foundational resource for Cardano smart contract developers.
Please describe your proposed solution and how it addresses the problem
We will extend the existing Anastasia Labs Design Patterns repository with new, production-ready design patterns and smart contract techniques. These include:
Proxy / dynamic parameter architecture for upgradable contracts.
Parameter validation and reward account registration to enable global event tracking.
A curated list of common smart contract footguns and how to avoid them.
Merkle Patricia Forestry as a foundational design for efficient data inclusion proofs.
Advanced metaprogramming techniques for low-boilerplate, composable scripts.
Each new addition will include real-world use cases, Plutarch and Aiken reference implementations. These contributions will continue to set the technical standard for on-chain development within Cardano.
Please define the positive impact your project will have on the wider Cardano community
This project will enhance the quality, security, and composability of Cardano smart contracts by expanding a well-established open-source design patterns repository already used by many developers across the ecosystem. By formalizing advanced topics—such as proxy architectures for upgradability, global parameter validation and reward account registration, common footguns and workarounds, Merkle Patricia Forestry, and metaprogramming—we aim to reduce time-to-production and mitigate high-risk design mistakes across DeFi, L2s, and identity systems.
These contributions will accelerate developer onboarding and project scalability by turning obscure or tribal knowledge into shared, canonical resources. The existing repo is already used by dApp teams to educate new hires and inform technical decisions—this proposal will broaden its utility, strengthen its structure, and cement it as a go-to knowledge base. Ultimately, it empowers teams to move faster with fewer errors, while driving adoption of best practices for high-assurance on-chain applications.
What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?
We have already demonstrated the capability to deliver this work at a high standard through the creation and ongoing maintenance of the Anastasia Labs Design Patterns repository, which has been organically adopted across the Cardano ecosystem and referenced by many dApp teams. Our team has deep experience with Plutus internals, parameterized scripts, and novel techniques like metaprogramming and proxy design patterns.
This grant will enable us to expand the repository to cover newer, more advanced and widely needed topics. These topics have already been implemented by our team in production protocols and discussed with other contributors across the ecosystem, giving us confidence in both their relevance and feasibility.
We will validate our approach through ongoing usage by developers, GitHub activity, and community adoption. As with the current repository, we expect the work to be cited in technical discussions, used in new smart contracts, and broken down in onboarding sessions by various teams.
Milestone Title
Core Infrastructure Patterns & Repository Restructure
Milestone Outputs
Add “Proxy / Dynamic Parameters” design pattern, covering flexible upgradeability and governance-based parameter control.
Add “Parameter Validation & Reward Account Registration” pattern, modeling a global event registry to coordinate protocol state.
Audit and reorganize the design-patterns repository to support modular navigation (per pattern, per concern).
Add README structure update with version tagging support and category-based navigation for future growth.
Acceptance Criteria
Two new pattern directories (Proxy/Dynamic Parameters and Parameter Validation) committed to main branch of GitHub repo.
Repository structure updated with a categorized directory layout and improved README.
PR includes usage examples and Aiken/Plutarch scripts for both new patterns.
Evidence of Completion
GitHub Commits:
Public commits on the Anastasia Labs Design Patterns Repository showing:
A new directory for Proxy / Dynamic Parameters
A new directory for Parameter Validation & Reward Account Registration
An updated README.md reflecting the new structure and usage instructions
Tagged version release (e.g., v0.2.0) containing these additions
Delivery Month
3
Cost
30000
Progress
30 %
Milestone Title
Expansion of Smart Contract Design Patterns: Footguns, Merkle Forestry & Metaprogramming
Milestone Outputs
This milestone focuses on expanding the design patterns repository with three critical contributions:
Common Smart Contract Footguns & Defensive Patterns
A section outlining common mistakes in Cardano smart contract development (e.g. state token smuggling / inauthenticated contract state).
Defensive coding patterns and validation techniques to mitigate each.
Merkle Patricia Forestry (MPF)
Inclusion of a simplified MPF module demonstrating how to commit to and verify nested state trees off-chain and on-chain.
Metaprogramming Utilities for Reusability
A collection of reusable Haskell and Aiken utilities showcasing higher-level abstractions and metaprogramming macros for safer and DRY (Don't Repeat Yourself) contract logic.
All additions will follow the established format and organizational structure of the current Anastasia Labs Design Patterns repository.
Acceptance Criteria
The repo includes a new top-level directory titled footguns/ with 3–5 documented cases and solutions.
A new folder merkle_forestry/ with detailed design pattern instructions for merkle structures
A new folder metaprogramming/ with helper utilities, Aiken/Haskell macros, and a sample contract demonstrating application.
All additions are documented with inline comments and explanatory markdown files.
The repository is tagged with a versioned release that includes these updates.
Evidence of Completion
GitHub Evidence
Public commits under footguns/, merkle_forestry/, and metaprogramming/ with well-structured folders, Aiken code, and documentation.
Release tag on GitHub marking the inclusion of these three modules.
Delivery Month
4
Cost
30000
Progress
60 %
Milestone Title
Dynamic Parameterization & Event Map Design Patterns
Milestone Outputs
This milestone focuses on adding robust design patterns around protocol parameterization and event-driven architecture for smart contracts on Cardano. Key outputs include:
Proxy Pattern for Dynamic Parameters
Demonstration of the proxy contract design pattern that enables upgradability by referencing parameter UTxOs.
Reference implementations showcasing how on-chain scripts can dynamically respond to off-chain parameter updates.
Parameter Validation Architecture
A secure, reusable pattern to validate reference parameters and enforce protocol constraints during execution (e.g., price bounds, fee policies).
Modular approach using inline datum structure and redeemer-based verification.
Reward Account Registration as Global Event Map
A pattern leveraging stake key registration to build decentralized global registries for one-time or recurring events.
Applications may include claim maps, airdrop whitelists, or participation registries.
These design patterns will be published in the repo under a new directory param-validation/ with supporting code and documentation.
Acceptance Criteria
Repository contains a proxy_pattern/ directory with example contracts and usage notes.
param_validation/ includes both fixed and dynamic parameter checking logic, with explanatory documentation.
reward_event_map/ folder demonstrates how to implement and verify event registration via stake key registration certificates.
Each pattern includes Aiken code, markdown guides, and example use cases.
A GitHub release finalizing this milestone is created.
Evidence of Completion
Public GitHub Contributions
Visible commits in the proxy_pattern/, param_validation/, and global_event_map/ folders.
Inline comments and documentation for each technique.
Delivery Month
5
Cost
30000
Progress
90 %
Milestone Title
Final Documentation, Outreach, and Closeout Report
Milestone Outputs
Milestone Outputs
Closeout Video
A concise yet informative video summarizing the project scope, outcomes, and impact on the Cardano developer ecosystem.
Will cover: what was built, how it helps developers, community feedback, and real-world usage examples.
Uploaded to YouTube and embedded in the design patterns GitHub README.
Final Documentation & Cleanup
Final sweep through all existing design pattern entries to update outdated examples, standardize format, and improve clarity.
Removal or refactoring of deprecated techniques based on Conway-era best practices.
Outreach & Integration
Submission of PRs to external documentation sites (Plutonomicon, Developer Portal, Aiken docs) to link back to this repo and integrate select patterns.
Coordinated efforts with ecosystem partners to improve discoverability (e.g., posts on developer forums, Discords, and Reddit).
Acceptance Criteria
2–5 minute video summary posted and publicly linked from the GitHub repo.
Final round of edits and consistency checks completed across all markdown documentation.
PRs submitted to relevant documentation hubs (e.g., Plutonomicon, Aiken, Plutarch, CF Developer Portal).
Outreach evidenced by links to forum threads, Discord messages, or community posts referencing the repo.
Evidence of Completion
YouTube video demonstrating the outcomes, impact, and future of the repo.
Included in both the proposal platform and the top-level README of the repo.
Delivery Month
8
Cost
10000
Progress
100 %
Please provide a cost breakdown of the proposed work and resources
We are requesting 100,000 ADA to fund this project. This amount reflects the depth, complexity, and long-term value of the work, which includes advanced smart contract architecture, safety patterns, developer tooling, and educational documentation.
Cost Breakdown:
Core Development
2 senior smart contract engineers (Philip DiSarro & Keyanm) will spend approximately 6–8 weeks total (3–4 weeks each) building, testing, and reviewing the implementations. This includes research, design, and iterative refinement of complex patterns such as proxy-based upgradability, global parameter validation, and Merkle Patricia Forestry.
Documentation & Educational Resources
High-quality documentation and usage examples will be created for each pattern. We will also publish developer guides, walkthroughs, and educational content to support adoption.
Project Management & Quality Assurance
This covers planning, review, issue tracking, releases, and QA across multiple repositories. It ensures consistency and rigor across design patterns, implementation, and testing.
Outreach, Close-out Report, and Explainer Video
Includes the production of a public video that explains the patterns, their usage, and showcases the contribution to the ecosystem. This helps drive adoption and understanding across the developer community.
How does the cost of the project represent value for the Cardano ecosystem?
The existing Design Patterns repository, created by Philip DiSarro, is already one of the most referenced developer resources in the Cardano ecosystem. With over 47+ GitHub stars and widespread adoption among Cardano smart contract developers, it has become a trusted knowledge base for teams building secure, maintainable Plutus applications.
🔹 Proven Track Record of Ecosystem Impact
The repo is already relied on by:
Professional development teams integrating parameterized scripts and advanced validation models
Auditors seeking known patterns to benchmark against secure best practices
New Plutus and Aiken developers learning how to structure safe and efficient contracts
It has served as a foundation for real-world projects, many of which have drawn on its guidance for structuring validators, handling script parameters, and avoiding common pitfalls.
Expanding an Ecosystem Pillar
This proposal continues that momentum by expanding the repository with high-value, high-complexity patterns that have emerged through continued R&D by the Anastasia Labs team. These additions are not theoretical — they’re informed by months of hands-on experience building production-grade protocols and working with protocol teams directly.
Terms and Conditions:
Yes
Philip DiSarro – Founder, Anastasia Labs
Philip is the original creator of the Design Patterns repository, which documents best practices and reusable architectures for Cardano smart contracts. He authored numerous CIPs and has led multiple open-source projects to improve developer experience and contract safety in the ecosystem.
Keyanm – Senior Smart Contract Engineer, Anastasia Labs
Keyanm is the lead developer of the Aiken Design Patterns library, which provides executable abstractions and composable tooling based on the patterns documented in the main repo. His work focuses on correctness, composability, and efficient on-chain validation using Aiken.