Magnet
Polkadot’s Appchain development stack, leveraging the Coretime model, aims to enhance ecosystem diversity by enabling the creation of appchains that use DOT as the gas fee.
Install / Use
/learn @Magport/MagnetREADME
What is the MAGNET?
Magnet has evolved! Our project now contains two parts, Magnet Network and Magnet Stack.
🔎 For more about Magnet Network, head to our website New version coming soon!<br> 📢 Follow our latest updates on Twitter<br> 🤝 Engage with fellow developers on our Telegram server<br>
Magnet Stack
Magnet Stack is an advanced platform designed to streamline Polkadot Coretime-ready chain deployment and project initiation, significantly simplifying the development process. Magnet Stack allows users to customize their blockchain network through an easy-to-use web UI, and automatically generate node codes.
Key Features
Coretime Functionalities
Magnet Stack supports two types of Coretime functionalities, on-demand and Bulk, optimizing resource management and providing flexibility in blockchain architecture. On-demand coretime mode also supports on-demand block production and assurance mechanisms to further increase resource efficiency and stability.
Multi-VM Support
Magnet Stack leverages Substrate's robust framework to support multiple virtual machines, including EVM, WASM and MoveVM, enabling developers to run and interact with various smart contract environments.
Magnet Template Layer
The platform provides customizable templates for various functionalities, allowing users to tailor their blockchain network to meet specific needs. This layer includes pre-built modules that can be easily integrated into your project, saving development time and effort.
Appchain Model
The Appchain Model offers flexibility with support for multiple models, including parathread and Tanssi-container chains. This allows developers to choose the best architecture for their specific use case.
Dynamic Generator
The Dynamic Generator facilitates the one-click generation of Substrate code for customized features, simplifying the node deployment process. This feature enables developers to quickly create and deploy nodes with the required specifications.
User-Friendly Interface
Magnet Stack enhances the user experience with a user-friendly interface and a comprehensive suite of SDKs, making blockchain development more accessible and efficient for developers of all skill levels.
Getting started with the Magnet Stack APP website, coming soon!
Magnet Network
MAGNET serves as Polkadot's Smart Contract Docking Station, operating on the PAYG Model. It is in the process of developing a scalable smart contract platform, utilizing DOT as the gas fee within this model.
Business Model Introduction
The main roles involved in the business logic are as follows:
Tanssi: As Magnet will become a ContainerChain in the Tanssi Network, Collators will be elected and supported by the Tanssi Network, and Magnet will no longer set up a Collators election mechanism.
Magnet: As a smart contract platform, it provides EVM/WASM smart contract services and charges GAS fees as platform fees.
Polkadot: Provides high-quality BlockSpace for Magnet and offers blockchain security services.

When providing smart contract platform services to users, Magnet calculates the total GAS fees from the current transaction pool and obtains the expected Blockspace/coretime price from RelayChain. By strategically leveraging the price difference, Magnet achieves continuous profits, thereby serving users more efficiently. Once the GAS fees exceed the expected price, Magnet will delegate Collators to package the transactions and submit a Blockspace Order to the Relaychain, strategically collecting gas fees to pay for coretime. Upon successful ordering, the produced blocks will be anchored to the Relaychain for block confirmation.
Magnet pallet introduction
Blockspace Ordering Pallet:
This pallet is crucial for managing and monitoring various aspects of blockspace and transaction processing.
- Monitor Pool Gas: Constantly observes the gas in the pool to ensure smooth transaction processing and to avoid any bottlenecks.
- Monitor Polkadot CoreTime Price: Keeps track of the real-time price of Polkadot CoreTime to facilitate accurate and fair bidding.
- Bidder Triggered, Transaction Added to Block, Block Production, Block Submission, Block Verification Locked: This is a multi-step process where a bidder triggers the addition of a transaction to a block. After this, the block goes through production, submission, and a verification lock to ensure integrity and security.
- Gas Fee Revenue Credited to System Account: The revenue generated from gas fees is credited directly to the system account, maintaining a transparent financial flow.
- Invoke Profit Operator: Calls the Profit Operator pallet to confirm CoreTime cost and calculate block profit.
Profit Operator Pallet:
This pallet is responsible for managing profits and costs associated with CoreTime.
- Confirm CoreTime cost: Validates the cost associated with CoreTime to avoid any discrepancies.
- Calculate Block_Profit: Determines the profit derived from each block considering various parameters and metrics.
- Incremental Era_Cost: Calculates the incremental cost associated with each era to manage financial flow effectively.
- Incremental Era_Profit: Computes the incremental profit for each era, providing a clear information of financial gains.
- Profit Distribution: Distributes the profit based on the incremental Era_Profit value, withdrawing it from the system account. Negative numbers are not triggered to avoid financial discrepancies.
- Deposit Credit account based on the Incremental Era_Cost Value: Credits the account based on the calculated incremental Era_Cost value, ensuring financial accuracy.
- Triggered every era, or Triggered by other module: This pallet is invoked at every era or can be triggered by another module when needed.
Blockspace/Coretime Assurance Pallet:
This pallet ensures the stability and reliability of block intervals and credit account balances.
- Monitor Block Interval Time: Observes the time intervals between blocks to maintain a consistent and efficient block production rate.
- Monitor Credit Account Balance: Keeps a close watch on the credit account balance to avoid any financial irregularities or issues.
- Trigger Order or Profit Distribution Upon Reaching Threshold: Initiates order or profit distribution processes once a certain threshold is reached, ensuring smooth and timely operations.
Each of these pallets plays a pivotal role in maintaining the efficiency, security, and financial integrity of the system, working in tandem to ensure the seamless functioning of the blockchain network.
Installing Substrate Dependencies
Substrate is a modular framework that enables you to create purpose-built blockchains by composing custom or pre-built components. Below is a markdown document that you can use as a template for creating a guide on installing Substrate dependencies.
1. Install Rust
Substrate is developed using Rust; hence, Rust is a prerequisite for Substrate. Install Rust using rustup by running the following command in your terminal:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After completing the installation, restart your terminal and run:
source $HOME/.cargo/env
Or, add the following line to your shell profile file (e.g., ~/.bashrc or ~/.zshrc):
export PATH=$HOME/.cargo/bin:$PATH
Update Rust
Keep your Rust installation up to date by running:
rustup update
2. Install Additional Libraries
Substrate has several library dependencies. Install them using the appropriate commands for your operating system:
For Ubuntu
sudo apt update
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev
For macOS
brew install cmake pkg-config openssl git llvm
3. Install Substrate
With Rust and the necessary libraries installed, proceed to install Substrate:
curl https://getsubstrate.io -sSf | bash -s -- --fast
4. Verify Installation
Check your Substrate installation by running:
substrate --version
This command should output the installed Substrate version.
5. Configure Rust Toolchain
Configure the Rust toolchain for Substrate by running:
rustup default nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
Completion
At this point, you should have a working Substrate development environment. Regularly check for updates and keep your installations current by running rustup update and cargo update.
Remember to replace the placeholder text with the actual content, and feel free to modify the structure and formatting to suit your preferences and requirements.
Start the Magnet Node
To start Magnet, you will need a proper Substrate development environment.
If you need a refresher setting up your Substrate environment, see Substrate's Getting Started Guide.
I. Launching the Local Relay Chain
Using the custom-spec-raw.json file provided by substrate.
1.Build the relay chain node
Clone the most recent release branch of the Polkadot repository to prepare a stable working environment.
git clone --branch release-v1.1.0 https://github.com/paritytech/polkadot-sdk.git
Change to the root of the polkadot directory by running the following command:
cd polkadot
Build the relay chain
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
