# Moonbit-ic-cdk – A MoonBit-powered Canister Development Kit for ICP

**URL:** <https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684>\
**Category:** Showcase\
**Created:** [April 11, 2025, 3:20pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684 "2025-04-11T15:20:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 11, 2025, 3:20pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/1 "2025-04-11T15:20:26Z")

</div>

![logo](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/0/8/08dacc07627a0f8197151c7046dea7e86f508379.jpeg)

🚀 **Say hello to moonbit-ic-cdk — The first MoonBit-powered Canister Development Kit for building on the Internet Computer (ICP)**

* * *

🌙 **Why MoonBit + ICP?**

WebAssembly (WASM) is at the core of canister smart contracts on ICP. But here’s the catch:

> Most non-Rust CDKs on ICP struggle with WASM compatibility, performance bottlenecks, or simply developer complexity.

**MoonBit changes that.**

It’s a purpose-built, all-in-one programming language toolchain designed for WebAssembly from the ground up.

With MoonBit, you get:

- 📦 _Significantly smaller_ WASM binaries than most toolchains
- ⚡ _Faster compile times_ and _runtime performance_
- ✍ A _simple, pragmatic_, and _data-oriented_ syntax
- 💡 Easier to learn than Rust (but still powerful enough to build robust dapps)

That’s exactly why we built **moonbit-ic-cdk** — to make building on ICP _faster, lighter, and more accessible_.

* * *

## **🛠 What’s inside**

## **moonbit-ic-cdk**

| **Module** | **Description** |
| --- | --- |
| ic-types | Core IC types like Nat, Principal, Result |
| ic-principal | MoonBit-native Principal implementation and utilities |
| ic0 | Wasmtime FFI bindings to the IC system API |
| ic0-api-warp | Higher-level abstraction over ic0, inspired by Rust’s ic-cdk |
| example | A working canister, fully written in MoonBit and deployed on-chain |

* * *

## 🛣 Roadmap

### ⏳ Next 1–3 Months (High Priority)

The top development focus is completing **candid-moonbit** , an essential part of the `ic-moonbit-cdk` ecosystem:

- **LEB128 encode/decode**  
Develop `leb128-moonbit` to handle Candid-compliant integer serialization.

- **Basic Candid types mapping and se/de implementation**  
Map Candid primitive types to MoonBit types and implement corresponding serialization/deserialization.

- **Serialization/deserialization for core types**  
Implement se/de for types like `number`, `principal`, and `result`.

- **Candid IDL Builder**  
Build type serializer and value serializer generators for Candid interface description.

- **Encapsulation of `http_request`, `http_response`, and storage APIs**  
Simplify building web service canisters with high-level HTTP and storage interfaces.

* * *

### 🔮 Future Feature Plans (Post V2)

- **Further enhancements to `ic-types-moonbit`**
- **Async support for canister-to-canister calls**  
Implement asynchronous messaging if MoonBit introduces async/await primitives.
- **Management Canister API support**
- **Fully-featured CDK API**  
Develop high-level abstractions for stable memory, certified data, traps, and cycles, etc.
- **JSON serialization as default**

🤝 We’re collaborating directly with the MoonBit core team to bring WASM-native development into the heart of ICP.

* * *

## **📚 Resources**

- 🔗 GitHub: [github.com/eliezhao/moonbit-ic-cdk](https://github.com/eliezhao/moonbit-ic-cdk)
- 🌐 MoonBit: [moonbitlang.com](https://www.moonbitlang.com)

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [April 11, 2025, 4:15pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/2 "2025-04-11T16:15:29Z")

</div>

I haven’t heard of moonbit before  
Where is this language used right now and how would it compare to Motoko

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 11, 2025, 4:24pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/3 "2025-04-11T16:24:34Z")

</div>

Hi @Gekctek

Moonbit is a very new language designed to embrace WebAssembly (Wasm). Its core development team is based in Hong Kong, and they’ve previously held several meetups in places like Singapore. They also showcased the language at last year’s Rust China conference.Previously, the Moonbit core team had a brief conversation with DFINITY as well.

Currently, Moonbit is gaining significant popularity in Asia, especially among teams working with Wasm. Many of these teams are choosing Moonbit to build their components, particularly for implementing cryptographic algorithms that can be called from JavaScript.

Motoko is an excellent language—I started using it back in 2021 and have built many DApps with it. However, compared to Motoko, Moonbit has broader recognition in the Asian region. The Moonbit team is also heavily focused on integrating AI into the compiler, with the goal of enhancing developer productivity.  
Their approach includes:

- AI-friendly language design, featuring safety mechanisms, easy testing, and reduced hallucinations from LLMs.
- Built-in AI assistant to automate testing and documentation, streamlining development workflows.
- Intelligent code generation with high accuracy and fast response times.

I hope to bring these developers into the ICP ecosystem through the **moonbit-cdk** , so that ICP can be adopted in more non-crypto industries.

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [April 11, 2025, 5:44pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/4 "2025-04-11T17:44:35Z")

</div>

Maybe worth adding this to

> **[GitHub - dfinity/awesome-internet-computer: A curated list of awesome projects and resources...](https://github.com/dfinity/awesome-internet-computer)**
>
> A curated list of awesome projects and resources relating to the Internet Computer Protocol

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 14, 2025, 6:32am UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/5 "2025-04-14T06:32:22Z")

</div>

> <https://github.com/dfinity/awesome-internet-computer/pull/199>

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 17, 2025, 2:33pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/6 "2025-04-17T14:33:36Z")

</div>

Hi, I’ve updated the upcoming Roadmap for ic-moonbit-cdk:

## 🛣 Roadmap

### ⏳ Next 1–3 Months (High Priority)

The top development focus is completing **candid-moonbit** , an essential part of the `ic-moonbit-cdk` ecosystem:

- **LEB128 encode/decode**  
Develop `leb128-moonbit` to handle Candid-compliant integer serialization.

- **Basic Candid types mapping and se/de implementation**  
Map Candid primitive types to MoonBit types and implement corresponding serialization/deserialization.

- **Serialization/deserialization for core types**  
Implement se/de for types like `number`, `principal`, and `result`.

- **Candid IDL Builder**  
Build type serializer and value serializer generators for Candid interface description.

- **Encapsulation of `http_request`, `http_response`, and storage APIs**  
Simplify building web service canisters with high-level HTTP and storage interfaces.

* * *

### 🔮 Future Feature Plans (Post V2)

- **Further enhancements to `ic-types-moonbit`**
- **Async support for canister-to-canister calls**  
Implement asynchronous messaging if MoonBit introduces async/await primitives.
- **Management Canister API support**
- **Fully-featured CDK API**  
Develop high-level abstractions for stable memory, certified data, traps, and cycles, etc.
- **JSON serialization as default**

* * *

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [April 17, 2025, 3:37pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/7 "2025-04-17T15:37:22Z")

</div>

> [@C-B-Elite](#):
>
> **JSON serialization support** JSON will become the default serialization format for accepting arguments and returning values in canisters. Developers will no longer need to manually handle encoding or decoding logic.

Edit: I see it now under **Future plans** point 3.

What’s the general idea behind a Candid implementation?

- With Motoko the types basically map one to one.
- With the Rust SDK there’s automatic [mapping to Rust types](https://internetcomputer.org/docs/references/candid-ref).
- With the Azle SDK you need to annotate methods with Candid types.

Does the MoonBit language support automatic mapping approaches like the Rust SDK or is an approach like the Azle SDK more straightforward in MoonBit?

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 18, 2025, 4:19am UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/8 "2025-04-18T04:19:13Z")

</div>

Hi @sea-snake , I’m glad you’re interested in this topic!

At this stage, it seems that MoonBit can adopt a similar approach to the Rust CDK. While developing the V1 version, I experimented with serialization/deserialization (de/se) of some basic types and found that handling the raw bytes correctly was often sufficient — although it’s necessary to include some additional headers, such as those defined by DIDL (e.g. length prefixes and type descriptors).

However, my current focus is on supporting JSON serialization and deserialization, since MoonBit has relatively good native support for JSON. I believe the first wave of MoonBit CDK users will also be more familiar with JSON-based workflows.

In V2, I plan to prioritize implementation of point 1 and point 2 from the roadmap. Support for Candid will be introduced in V3. Here’s the planned progression:

- **V1** : Developers need to interact with low-level APIs and handle serialization manually in many cases.
- **V2** : Developers will be able to use a higher-level API similar to the Rust CDK, and deploy services such as web server–like frontend hosting directly on IC.
- **V3** : Focus on deeper compatibility with IC blockchain features, such as threshold signatures and certified data (certification).

If you have other suggestions, feel free to reach out — I’m still planning things carefully. Thanks for your interest and support!

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [April 28, 2025, 2:16pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/9 "2025-04-28T14:16:23Z")

</div>

Just a quick update:  
After some research and discussions over the past period, I have adjusted the implementation roadmap for **ic-moonbit-cdk**.  
The new roadmap has now been updated.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [May 14, 2025, 2:27pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/10 "2025-05-14T14:27:43Z")

</div>

Update:

Look what I’ve discovered—Juno! This is an awesome project.

It features a beautiful, minimalist UI and comprehensive documentation and API. I actually first heard about it through its SNS, and I regret not having started exploring it sooner.

I’m thinking that integrating Juno will be a major goal for me after finishing candid-moonbit(this will officially establish Moonbit as a tool for developing canisters). I believe it’ll be an excellent tool for deploying canisters and providing web services.

It’s a somewhat long-term goal (I’ve been quite busy lately), but I’m really excited about it!

@peterparker

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [May 14, 2025, 2:41pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/11 "2025-05-14T14:41:56Z")

</div>

So great to hear! Likewise, that’s super exciting 🚀

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [December 9, 2025, 2:20pm UTC](https://forum.dfinity.org/t/moonbit-ic-cdk-a-moonbit-powered-canister-development-kit-for-icp/43684/12 "2025-12-09T14:20:20Z")

</div>

# v1.0.0: First Official Release - Full Candid & System API Support

We are excited to announce the first major release of **moonbit-ic-cdk** v1.0.0! 🎉

`moonbit-ic-cdk` is a lightweight, WebAssembly-native Canister Development Kit designed for building high-performance smart contracts on the Internet Computer (ICP) using the Moonbit language.

This release provides the essential foundation for developing production-ready canisters, featuring complete system API bindings, robust data serialization, and HTTP handling capabilities.

## 🚀 Key Features

- **Complete IC System API Bindings** : Access low-level `ic0` FFI bindings and high-level wrappers for seamless interaction with the IC replica.
- **Full Candid Support** : Comprehensive implementation of Candid serialization/deserialization, including LEB128 encoding/decoding, primitive types, and an IDL builder.
- **HTTP Gateway Integration** : Built-in support for handling HTTP requests and responses, compliant with the IC HTTP Gateway interface specification.
- **Principal & Identity Management** : Complete implementation of the `Principal` type for managing user and canister identities.
- **Efficient Memory Management** : APIs for stable memory access and low-level storage operations.
- **MoonBit Optimization** : Leveraging MoonBit’s toolchain to generate compact, high-performance Wasm binaries with exceptional compile-time speed.

## 📦 Getting Started

### Prerequisites

- MoonBit compiler
- DFX (Internet Computer development toolkit)

### Installation

You can clone the repository and build the examples to get started immediately:

```bash
git clone https://github.com/eliezhao/moonbit-ic-cdk.git
cd moonbit-ic-cdk/examples/demo
moon build --target wasm --release

```

## 📚 Documentation & Resources

- **README** : Full documentation on installation, usage, and API structure.
- **Examples** : Check the `examples/` directory for basic usage and a complete demo canister.
- **Community** : We are officially listed in Awesome Internet Computer! Join the discussion on the [suspicious link removed].

## 🤝 Contributors

Special thanks to all contributors and the MoonBit community for their feedback and support in making this release possible.
