{"id":47301324,"url":"https://github.com/Olanetsoft/learn-compact","last_synced_at":"2026-03-31T07:00:45.007Z","repository":{"id":333718898,"uuid":"1135139895","full_name":"Olanetsoft/learn-compact","owner":"Olanetsoft","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-04T14:06:49.000Z","size":256,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-04T21:33:19.015Z","etag":null,"topics":["compact","midnightntwrk"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Olanetsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-15T17:36:49.000Z","updated_at":"2026-03-04T14:10:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Olanetsoft/learn-compact","commit_stats":null,"previous_names":["olanetsoft/learn-compact"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Olanetsoft/learn-compact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Flearn-compact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Flearn-compact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Flearn-compact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Flearn-compact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Olanetsoft","download_url":"https://codeload.github.com/Olanetsoft/learn-compact/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Flearn-compact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31224248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T04:08:55.938Z","status":"ssl_error","status_checked_at":"2026-03-31T04:08:47.883Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compact","midnightntwrk"],"created_at":"2026-03-17T03:00:22.711Z","updated_at":"2026-03-31T07:00:45.001Z","avatar_url":"https://github.com/Olanetsoft.png","language":"CSS","funding_links":[],"categories":["Dormant Projects"],"sub_categories":["Community Created Tutorials"],"readme":"# Learn Compact 🌙\n\n\u003e The definitive guide to learning Compact, Midnight's zero-knowledge smart contract language\n\n[![CI](https://github.com/Olanetsoft/learn-compact/actions/workflows/ci.yml/badge.svg)](https://github.com/Olanetsoft/learn-compact/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nThis project extends the Midnight Network with additional developer tooling.\n\n## 📖 What is This?\n\nLearn Compact is an interactive book and exercise collection for learning the Compact programming language. Compact is the smart contract language for [Midnight](https://midnight.network), a blockchain with native support for zero-knowledge proofs.\n\n**This project is inspired by:**\n\n- [The Rust Programming Language](https://doc.rust-lang.org/book/)\n- [Rustlings](https://github.com/rust-lang/rustlings)\n\n## 🎯 Who is This For?\n\nDevelopers with programming experience who want to:\n\n- Build privacy-preserving smart contracts\n- Learn zero-knowledge proof concepts\n- Develop on the Midnight blockchain\n\n**Prerequisites:**\n\n- Programming experience in any language\n- TypeScript/JavaScript knowledge (helpful but not required)\n- Basic blockchain concepts (we'll cover what you need)\n\n## 🚀 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Olanetsoft/learn-compact.git\ncd learn-compact\n```\n\n### 2. Run Setup Script\n\n```bash\nchmod +x scripts/setup.sh\n./scripts/setup.sh\n```\n\n### 3. Read the Book\n\n```bash\n# Install mdBook if you haven't\ncargo install mdbook\n\n# Serve the book locally\ncd book\nmdbook serve\n```\n\nOpen http://localhost:3000 in your browser.\n\n### 4. Do the Exercises\n\n```bash\ncd exercises/01_basics/01_hello_compact\n# Read README.md\n# Edit exercise.compact\n# Compile to check your solution\ncompact compile exercise.compact\n```\n\n## 📚 Structure\n\n```\nlearn-compact/\n├── book/               # mdBook source (the textbook)\n│   └── src/\n│       ├── ch00-introduction.md\n│       ├── ch01-getting-started/\n│       ├── ch02-basic-concepts/\n│       └── ...\n├── exercises/          # Hands-on exercises (rustlings-style)\n│   ├── 01_basics/\n│   ├── 02_types/\n│   ├── 03_circuits/\n│   └── solutions/\n├── examples/           # Complete working contracts\n│   ├── counter/\n│   ├── bulletin-board/\n│   └── voting/\n└── scripts/            # Helper scripts\n```\n\n## 📝 Exercise Workflow\n\n1. **Read** the corresponding chapter in the book\n2. **Open** the exercise folder\n3. **Read** the exercise README.md\n4. **Edit** exercise.compact to complete the TODOs\n5. **Compile** with `compact compile exercise.compact`\n6. **Fix** any errors\n7. **Move** to the next exercise\n\nCheck your progress:\n\n```bash\n./scripts/verify.sh\n```\n\n## 🎓 Learning Path\n\n| Part                | Topics                              | Exercises                 |\n| ------------------- | ----------------------------------- | ------------------------- |\n| 1. Foundations      | Intro, Setup, Basics                | 01_basics                 |\n| 2. Type System      | Primitives, Compounds, User-defined | 02_types                  |\n| 3. Core Features    | Circuits, Witnesses, Control Flow   | 03_circuits, 04_witnesses |\n| 4. State Management | Ledger, Counter, Map, Set           | 05_ledger                 |\n| 5. Advanced         | Stdlib, Modules, TypeScript         | 06_patterns               |\n| 6. Projects         | Counter, Bulletin Board, Voting     | examples/                 |\n\n## ⚠️ Common Mistakes\n\n| Wrong                    | Correct                      |\n| ------------------------ | ---------------------------- |\n| `ledger { field: Type }` | `export ledger field: Type;` |\n| `circuit fn(): Void`     | `circuit fn(): []`           |\n| `Choice::rock`           | `Choice.rock`                |\n| `witness fn(): T { }`    | `witness fn(): T;`           |\n\nSee [Chapter 19: Common Mistakes](book/src/ch19-common-mistakes/) for the full list.\n\n## 🔧 Version Compatibility\n\n- **Compact Language:** v0.16 - v0.18\n- **Compiler:** compact-v0.3.0\n- **Last Updated:** January 2026\n\n## 🤝 Contributing\n\nContributions welcome! Please:\n\n1. Ensure all Compact code compiles\n2. Each exercise tests ONE concept\n3. Follow the progressive difficulty structure\n\n## 📜 License\n\nMIT License - See [LICENSE](LICENSE) for details.\n\n## 🔗 Resources\n\n- [Midnight Official Docs](https://docs.midnight.network)\n- [Compact Language Reference](https://docs.midnight.network/develop/reference/compact/lang-ref)\n- [Midnight Discord](https://discord.gg/midnight)\n- [Local Development Network](https://github.com/bricktowers/midnight-local-network) - Run your own local Midnight node (community tool by Brick Towers)\n\n---\n\n**Happy Learning! 🚀**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOlanetsoft%2Flearn-compact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOlanetsoft%2Flearn-compact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOlanetsoft%2Flearn-compact/lists"}