Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit 1d308b0

Browse files
committed
Added more documentation & made updates
1 parent f8c2d0a commit 1d308b0

18 files changed

+550
-364
lines changed

docs/Enhanced-Accessibility.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Moonchain zkEVM Enhances Web3 Accessibility
6+
7+
Moonchain, a blockchain-based network designed to connect millions of IoT devices globally, requires a blend of scalability, security, and efficiency to meet its objectives. Recently, Moonchain has integrated zkEVM—a technology that merges the strengths of zero-knowledge proofs with the Ethereum Virtual Machine (EVM)—to enhance accessibility for both projects and users. This article delves into how zkEVM advances Web3 accessibility and how its integration has bolstered the Moonchain network's capabilities.
8+
9+
## Scalability
10+
11+
A key advantage of zkEVM is its scalability. This technology enables projects to benefit from the scalability of layer 2 solutions while maintaining Ethereum-level security. Consequently, projects can expand and process higher transaction volumes without compromising security. Similarly, Moonchain can scale efficiently to accommodate increased transaction and data loads, crucial for its mission to connect a vast number of IoT devices globally.
12+
13+
## Cost Efficiency
14+
15+
zkEVM also offers significant reductions in gas fees compared to the Ethereum mainnet. This cost-effectiveness makes Web3 applications and dApps more accessible. By adopting zkEVM, projects can lower operational costs and concentrate on their core functions. Additionally, zkEVM integration permits the use of MXC tokens for gas fees, thereby enhancing their utility and market demand.
16+
17+
## Privacy
18+
19+
Zero-knowledge proofs facilitate the validation of transactions while keeping details private on the public blockchain. This feature is particularly beneficial for IoT devices transmitting sensitive data. zkEVM enhances Moonchain’s privacy features, ensuring that data exchanged between IoT devices and the blockchain remains secure and tamper-proof.
20+
21+
## Increased Token Utility
22+
23+
The integration of zkEVM has amplified the utility of MXC tokens. MXC tokens can now be used for transaction gas fees within the network, increasing their practical value and demand. This surge in demand further augments the tokens' value for holders. The zkEVM implementation also enhances the overall security and efficiency of the Moonchain network, adding to the utility of MXC tokens.
24+
25+
## Enhanced Security
26+
27+
Combining zero-knowledge proofs with the Ethereum Virtual Machine provides an extra layer of security to the Moonchain network. zkEVM enables faster transaction processing, handling higher transaction volumes more efficiently. This bolstered security is pivotal for Moonchain’s success in linking a multitude of IoT devices worldwide.
28+
29+
## Conclusion
30+
31+
The integration of zkEVM represents a significant advancement for Web3 accessibility, offering reductions in cost, improvements in scalability, and enhanced privacy. For Moonchain, zkEVM integration has markedly improved the network’s security, scalability, and efficiency, while also increasing the value and demand for MXC tokens. With these advancements, Moonchain is well-positioned to realize its goal of connecting millions of IoT devices across the globe.

docs/Moonchain-Design/Hexagons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import Moonchain_Hexagon_Map from '/img/Moonchain_Hexagon_Map.png';
4444
ES6 usage:
4545

4646
```js
47-
import {latLngToCell} from "h3-js";
47+
import { latLngToCell } from "h3-js";
4848
```
4949

5050
CommonJS usage:

docs/Moonchain-Design/Proving-Moonchain-Blocks.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
sidebar_position: 2
33
---
4+
import Proving_Moonchain_Blocks from '/img/Proving_Moonchain_Blocks.gif';
45

56
# Proving Moonchain Blocks
67

@@ -29,8 +30,6 @@ Blocks on Moonchain progress through three distinct states:
2930

3031
Below is a visualization depicting the three stages (Proposed --> Proved --> Verified).
3132

32-
import Proving_Moonchain_Blocks from '/img/Proving_Moonchain_Blocks.gif';
33-
3433
<img src={Proving_Moonchain_Blocks} alt="Proving Moonchain Blocks GIF" style={{width: 600}}/>
3534

3635
This approach ensures the integrity and reliability of state transitions within the Moonchain zkEVM ecosystem, supporting secure and efficient blockchain operations.
+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
sidebar_position: 10
3+
---
4+
5+
import DFU_1 from '/img/X2E/DFU_1.png';
6+
import DFU_2 from '/img/X2E/DFU_2.png';
7+
import DFU_3 from '/img/X2E/DFU_3.png';
8+
import DFU_4 from '/img/X2E/DFU_4.png';
9+
import at_ok from '/img/X2E/at_ok.png';
10+
import pid_csv from '/img/X2E/pid_csv.png';
11+
import pid_email from '/img/X2E/pid_email.png';
12+
import temp_email from '/img/X2E/temp_email.png';
13+
import x2e_connections from '/img/X2E/x2e_connections.png';
14+
import x2e_provisioned from '/img/X2E/x2e_provisioned.png';
15+
import x2e_reboot from '/img/X2E/x2e_reboot.png';
16+
17+
# Controlling a Physical Device via Moonchain
18+
19+
This demonstration illustrates how to control a physical device using Moonchain, specifically through remotely toggling an LED on or off. It emphasizes the seamless integration of blockchain technology with real-world hardware, showcasing the potential for secure, decentralized control in various applications.
20+
21+
### English
22+
<iframe
23+
width="800" height="450" src="https://www.youtube.com/embed/30CATOQeYKc"
24+
title="YouTube video player" frameborder="0"
25+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
26+
allowFullScreen>
27+
</iframe>
28+
29+
### German
30+
<iframe
31+
width="800" height="450" src="https://www.youtube.com/embed/1uU0s5Zzf3I"
32+
title="YouTube video player" frameborder="0"
33+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
34+
allowFullScreen>
35+
</iframe>
36+
37+
## Moonchain Info
38+
- Contract Proposals: [MEPs Repository](https://github.com/MXCzkEVM/MEPs)
39+
- Deployed Contrace Addresses:
40+
- MEP801: <code>0x070B3e2229a27CDd34126E96B2Ce65c63BD1A5CE</code>
41+
- MEP802: <code>0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6</code>
42+
- MEP803: <code>0xBFc77Ee5959699eC4171891b625D6EccdC9e00cD</code>
43+
44+
:::info[NOTE]
45+
Commands in this document use the wallet address `0xa2d9E584F4cF0167d283dB6EB4922082269B6bB7` as an example. MXC tokens are required for gas fees and other transaction costs.
46+
:::
47+
- Private Key: <code>318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368</code>
48+
49+
```
50+
318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368
51+
```
52+
53+
### Change the X2E Firmware
54+
- Firmware Repository: [Moonchain-Control-X2E](https://github.com/MXCzkEVM/Moonchain-Control-X2E)
55+
- Download the Mobile App Tool (Nordic DFU):
56+
- [Google Play Store](https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu&hl=en&gl=US)
57+
- [Apple App Store](https://apps.apple.com/tt/app/nrf-device-firmware-update/id1624454660)(requires iOS 16 or higher)
58+
- Update Firmware:
59+
- Copy `demo_controls_dfu_ism2400.zip` to your mobile phone (Place it in the download folder for recognition).
60+
<img src={DFU_1} style={{width: 600}}/>
61+
- Open the DFU App, select the firmware binary file, and start scanning for BLE devices.
62+
<img src={DFU_2} style={{width: 600}}/>
63+
- Hold the X2E board's "USER" button for 5 seconds to initiate DFU mode.
64+
<img src={DFU_3} style={{width: 600}}/>
65+
- Select the X2E board on the app, tap "Start" to upgrade the firmware, and wait for completion.
66+
<img src={DFU_4} style={{width: 600}}/>
67+
68+
### Connection of X2E
69+
To control an LED, follow these connection guidelines:
70+
<img src={x2e_connections} style={{width: 600}}/>
71+
72+
### Purchase a Provision ID (PID)
73+
- Obtain a temporary email address to receive the PID. This prevents exposing your personal email on Moonchain.
74+
<img src={temp_email} style={{width: 600}}/>
75+
- Check Device Profile
76+
- Ensure it matches the firmware of your X2E board. Use the ISM2400 profile with index 3.
77+
```bash
78+
cast call 0xBFc77Ee5959699eC4171891b625D6EccdC9e00cD "deviceProfileList(uint256) (uint256,string,address,string,bool,uint256)" 3 --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368
79+
```
80+
- Response will be similar to one below
81+
```bash
82+
3
83+
X2E Class C - ISM2400
84+
0xD9892d06C864a41A38915dDd48DF11A0DBfdCf89
85+
https://api.github.com/repos/MatchX-GmbH/iso-device-profile/contents/matchx/x2e_class_c_ism2400.json
86+
true
87+
100000000000000000`
88+
```
89+
90+
- Check PID Unit Price
91+
```bash
92+
cast call 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "pidUnitPrice() (uint256)" --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368
93+
```
94+
- Response: `123450000000000000000 wei` (123.45 MXC).
95+
- Purchase PID
96+
- Replace the email with your own and use the following command to purchase a PID via MEP802.
97+
```bash
98+
cast send 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "producePid(string,uint256,uint256)" "[email protected]" 1 3 --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368 --value 123450000000000000000
99+
```
100+
- After a few minutes, you will receive an email with a PID CSV file.
101+
<img src={pid_email} style={{width: 600}}/>
102+
- Extract PID and pidZkevmHash
103+
- Use the PID and pidZkevmHash from the CSV file to set up the X2E board.
104+
<img src={pid_csv} style={{width: 600}}/>
105+
106+
### Setup the X2E Board
107+
108+
- Connect the X2E board to your computer using a USB Type-C cable.
109+
- Launch a serial terminal program (e.g., minicom on Linux or PuTTY on Windows) with settings `115200 8N1`.
110+
- Use the following command:
111+
```bash
112+
minicom -b 115200 -8 -D /dev/ttyACM0 -o
113+
```
114+
- Send "AT" command to verify connection. You should receive "OK".
115+
- Run the `AT` command
116+
<img src={at_ok} style={{width: 600}}/>
117+
- Change the PID of the X2E board:
118+
- Use the following command:
119+
```bash
120+
AT+CQRCODE={"PID":"K2ILSDXUOO3O4EEIWZDDW6SL","B":"MatchX","M":"X2E","V":"1.3"}
121+
```
122+
- Clear all data and reboot
123+
- Run the command below:
124+
```bash
125+
AT+IREBOOT=8
126+
```
127+
<img src={x2e_reboot} style={{width: 600}}/>
128+
129+
Wait for a while, the X2E board will finish the provisioning process with the new PID. After that, it will start to join the network and send data. After it joined, the status LED will lite steady and the Control pin (IO14) will go higher. If you are using the suggested connection, the target LED will be lit.
130+
131+
If this doesn't happen after 6 minutes, please check the status of your NEO miner and make sure it is running.
132+
<img src={x2e_provisioned} style={{width: 600}}/>
133+
134+
### Mint the Sensor NFT for the X2E Board
135+
- Check Minting Price
136+
```bash
137+
cast call 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "priceInfoList(uint256) (uint256,uint,bool)" 0 --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368
138+
```
139+
- Response `9876500000000000000 wei` (9.8765 MXC).
140+
- Mint the NFT
141+
- Replace `0xf6d4bd...` with the pidZkevmHash and use the following command:
142+
```bash
143+
cast send 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "mintSensorNFT(uint256,uint256,string)" 0xf6d4bda9e25797a1423a41c485bfaa8e03930f0dbdf2d2b324d79fa71d8c9108 0 "https://global.matchx.io/iso/x2e/x2e_ref_sensor.jpeg" --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368 --value 9876500000000000000
144+
```
145+
- Burn Sensor NFT to Repeat Process
146+
```bash
147+
cast send 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "burnSensorNFT(uint256)" 0xf6d4bda9e25797a1423a41c485bfaa8e03930f0dbdf2d2b324d79fa71d8c9108 --rpc-url https://geneva-rpc.moonchain.com --private-key 318dee0c207c20f4767e342a52e876b816379334a53277773c783b0e9348d368
148+
```
149+
### Controlling via Moonchain
150+
You can control the pin output in three modes: always low, always high, or cycling (blinking). Replace `0xf6d4bd...` with the pidZkevmHash from earlier commands.
151+
- Set to Low (Turn off LED)
152+
```bash
153+
cast send 0x28479D68cD3ef5661BDB7505EFD1712D5D0951F6 "enqueueDownlink(uint256,string,uint8,uint8)" 0xf6d4bda9e25797a1423a41c485bfaa8e03930f0dbdf2d2b324d79fa71d8c9108 "Qh
154+
```

docs/intro.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Prepare your applications thoroughly on the Geneva testnet to ensure seamless de
5959
## 🤝 Become a Contributor to Moonchain
6060

6161
Moonchain is a fully open-source and community driven project, check out our Telegram or Github to get started as a contributor!
62+
6263
<a href="https://t.me/Moonchain_official" class="big-button">Telegram</a>
6364
<a href="https://github.com/MXCzkEVM" class="big-button">Github</a>
6465

0 commit comments

Comments
 (0)