{"id":10724,"date":"2024-11-29T10:11:20","date_gmt":"2024-11-29T10:11:20","guid":{"rendered":"https:\/\/metaschool.so\/articles\/?p=10724"},"modified":"2024-11-29T10:23:41","modified_gmt":"2024-11-29T10:23:41","slug":"build-on-cosmos-sdk-custom-blockchain","status":"publish","type":"post","link":"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/","title":{"rendered":"Build on Cosmos SDK \u2014 Comprehensive guide to build Custom Blockchains Using Cosmos 2024 ?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_56_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Pre-requisites_for_Blockchain_Development\" title=\"Pre-requisites for Blockchain Development\">Pre-requisites for Blockchain Development<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#The_Cosmos_SDK_A_Modular_Blockchain_Framework\" title=\"The Cosmos SDK: A Modular Blockchain Framework\">The Cosmos SDK: A Modular Blockchain Framework<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#AppChains_vs_Other_Blockchains\" title=\"AppChains vs Other Blockchains\">AppChains vs Other Blockchains<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Why_Build_Your_Blockchain\" title=\"Why Build Your Blockchain?\">Why Build Your Blockchain?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Key_Components_of_the_Cosmos_SDK\" title=\"Key Components of the Cosmos SDK\">Key Components of the Cosmos SDK<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Building_a_Blockchain_Step-by-Step\" title=\"Building a Blockchain Step-by-Step\">Building a Blockchain Step-by-Step<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_1_Setting_Up_with_Ignite_CLI\" title=\"Step 1: Setting Up with Ignite CLI\">Step 1: Setting Up with Ignite CLI<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_2_Adding_Module\" title=\"Step 2: Adding Module\">Step 2: Adding Module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_3_Integrating_Module\" title=\"Step 3: Integrating Module\">Step 3: Integrating Module<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_4_Testing_Your_Blockchain\" title=\"Step 4: Testing Your Blockchain\">Step 4: Testing Your Blockchain<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_5_Running_the_Blockchain_Locally\" title=\"Step 5: Running the Blockchain Locally\">Step 5: Running the Blockchain Locally<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Step_6_Building_a_Frontend\" title=\"Step 6: Building a Frontend\">Step 6: Building a Frontend<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#The_Future_of_the_Cosmos_SDK\" title=\"The Future of the Cosmos SDK\">The Future of the Cosmos SDK<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#Frequently_Asked_Questions\" title=\"Frequently Asked Questions \">Frequently Asked Questions <\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#What_is_the_Cosmos_SDK\" title=\"What is the Cosmos SDK?\">What is the Cosmos SDK?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#What_language_does_Cosmos_SDK_use\" title=\"What language does Cosmos SDK use?\">What language does Cosmos SDK use?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#What_is_the_ATOM_cosmos_used_for\" title=\"What is the ATOM cosmos used for?\">What is the ATOM cosmos used for?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/metaschool.so\/articles\/build-on-cosmos-sdk-custom-blockchain\/#What_is_the_difference_between_Cosmos_and_Ethereum_SDK\" title=\"What is the difference between Cosmos and Ethereum SDK?\">What is the difference between Cosmos and Ethereum SDK?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>Cosmos is referred to as the &#8220;Internet of Blockchains&#8221;. In one of our articles, we have talked in-depth about the Cosmos Ecosystem and how is it changing the web3 ecosystem with its vision. If you are new to the cosmos ecosystem read more about Cosmos in our article &#8220;<a href=\"https:\/\/metaschool.so\/articles\/what-is-cosmos-ecosystem\/\" data-type=\"link\" data-id=\"https:\/\/metaschool.so\/articles\/what-is-cosmos-ecosystem\/\">What is Cosmos Ecosystem<\/a>&#8220;. <\/p>\n\n\n\n<p>Creating your blockchain might sound intimidating, but with the <strong>Cosmos SDK<\/strong>, it&#8217;s an achievable and very simple process. Imagine being able to design how transactions are processed, implement custom features, and even name your blockchain something unique\u2014perhaps &#8220;MyChain&#8221;. While this might seem complicated at first, the Cosmos SDK provides a very structured framework that simplifies the overall process of blockchain development. This guide will walk you through the essentials of building a blockchain with the Cosmos SDK, from preparation to deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Pre-requisites_for_Blockchain_Development\"><\/span>Pre-requisites for Blockchain Development<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To get started on creating your blockchain journey, certain prerequisites must be met. This preparation ensures a smooth experience as you navigate the Cosmos SDK ecosystem.<\/p>\n\n\n\n<p>First and foremost, familiarity with programming, especially <strong>Go (Golang)<\/strong>, is essential. The Cosmos SDK is built using Go, making it the foundation of your development work. If you are new to Go, consider taking a short course or going through the <a href=\"https:\/\/go.dev\/\" data-type=\"link\" data-id=\"https:\/\/go.dev\/\" target=\"_blank\" rel=\"noopener\">official documentation<\/a> to get a basic understanding. Without this foundational knowledge, navigating the intricacies of the SDK may become challenging.<\/p>\n\n\n\n<p>The second most crucial step is setting up your <strong>development environment<\/strong>. A machine equipped with Go (version 1.19 or later) is required.  For version control management you can use <strong>Git<\/strong>, which you\u2019ll use for cloning and managing your code repositories. A code editor such as <strong>VS Code<\/strong>, with Go extensions installed, will help you manage your project effectively and also enhance your productivity by providing syntax highlighting, error detection, and other features.<\/p>\n\n\n\n<p>You must also be comfortable with using the command line. Much of the development process involves running CLI commands, from scaffolding projects to testing modules. While it\u2019s not mandatory to be a command-line expert, having a basic understanding of shell scripting can help streamline your workflow.<\/p>\n\n\n\n<p>The <strong>Ignite CLI<\/strong> (formerly Starport) is an essential tool for blockchain developers working with the Cosmos SDK. Ignite simplifies project scaffolding and automates the repetitive setup work, allowing you to focus on building functionality. You can install Ignite with the following command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\ncurl &lt;https:\/\/get.ignite.com\/cli&gt;! \" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">curl<\/span><span style=\"color: #D4D4D4\"> &lt;<\/span><span style=\"color: #C8C8C8\">https<\/span><span style=\"color: #D4D4D4\">:<\/span><span style=\"color: #6A9955\">\/\/get.ignite.com\/cli&gt;! <\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Additionally, a working understanding of blockchain basics\u2014such as how blocks are created, how transactions happen on a blockchain, ideas about different consensus mechanisms like Proof of Work(PoW) and Proof of Stake(PoS), and validators is very essential. Familiarity with these concepts will help you grasp how the Cosmos SDK operates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Cosmos_SDK_A_Modular_Blockchain_Framework\"><\/span>The Cosmos SDK: A Modular Blockchain Framework<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Cosmos SDK is an open-source framework designed for building custom blockchains. It simplifies the development process by providing prebuilt modules for common functionalities and a modular architecture that supports customization. One of the standout features of the Cosmos SDK is its <strong>customizability<\/strong>. Unlike general-purpose blockchains like Ethereum, which impose predefined constraints, the Cosmos SDK allows you to design every aspect of your blockchain, from how transactions are processed to the rules governing consensus.<\/p>\n\n\n\n<p>The SDK\u2019s <strong>modular architecture<\/strong> is another key advantage. It includes prebuilt modules for functionalities such as staking, governance, and token transfers. These modules can be integrated into your blockchain with minimal effort, saving you the time and complexity of building them from scratch. Another groundbreaking feature is <strong>Inter-Blockchain Communication (IBC)<\/strong>. IBC enables blockchains in the Cosmos ecosystem to exchange data and assets seamlessly. This feature is particularly useful for developers who want their blockchain to interact with existing networks like Cosmos Hub or Osmosis. <\/p>\n\n\n\n<p>Using these standout features you can build your own Application Specific Blockchain. Just to provide a quick context AppChains, or application-specific blockchains, are designed to meet the unique requirements of a particular use case or business need. Unlike general-purpose blockchains, AppChains are optimized for specific functions, striving for more efficient processing, reduced congestion, and lower transaction costs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"AppChains_vs_Other_Blockchains\"><\/span>AppChains vs Other Blockchains<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>AppChains differ from other types of blockchains in several ways. Unlike monolithic chains, which are designed to handle a wide range of applications, AppChains are optimized for a specific function. This aims to make them more efficient and less congested than general chains. Compared to modular chains, which are made up of interchangeable parts, AppChains are built for efficiency around specific tasks. Finally, unlike&nbsp;Layer-2 chains, which are built on top of existing blockchains to improve scalability, AppChains can operate independently. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Build_Your_Blockchain\"><\/span>Why Build Your Blockchain?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Popular blockchains like Ethereum and Bitcoin, though very popular and powerful, have their limitations. Ethereum, for example, often experiences network congestion and high gas fees, making it unsuitable for certain use cases and thus we see so many L2s and other scaling solutions being built to solve this problem. Bitcoin, on the other hand, prioritizes security over flexibility, limiting its applicability to tasks beyond simple transactions.<\/p>\n\n\n\n<p>Building your blockchain with the Cosmos SDK allows you to tailor the network to your specific needs. For instance, you can create a decentralized exchange (DEX) with optimized token swaps, a governance platform for managing community decisions, or a blockchain game with unique in-game assets. This level of customization empowers you to bypass the constraints of existing ecosystems and implement solutions that align with your vision.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Key_Components_of_the_Cosmos_SDK\"><\/span>Key Components of the Cosmos SDK<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Cosmos SDK is built on a layered architecture that ensures scalability, reliability, and flexibility. Each layer has a specific role in the overall system. At its core is <strong>Tendermint<\/strong>, a consensus engine that ensures the reliability of your blockchain. Tendermint\u2019s Byzantine Fault Tolerance (BFT) algorithm allows your blockchain to function smoothly even in the presence of malicious nodes. Above Tendermint lies <strong>BaseApp<\/strong>, which acts as the middleware layer. BaseApp facilitates communication between Tendermint and your application logic, ensuring seamless operation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"585\" src=\"https:\/\/metaschool.so\/articles\/wp-content\/uploads\/2024\/11\/image-34.png\" alt=\"Cosmos SDK - Components\n\" class=\"wp-image-10731\" srcset=\"https:\/\/metaschool.so\/articles\/wp-content\/uploads\/2024\/11\/image-34.png 800w, https:\/\/metaschool.so\/articles\/wp-content\/uploads\/2024\/11\/image-34-300x219.png 300w, https:\/\/metaschool.so\/articles\/wp-content\/uploads\/2024\/11\/image-34-768x562.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>The <strong>modules<\/strong> in the Cosmos SDK are its building blocks. Prebuilt modules like <code>Auth<\/code>, <code>Bank<\/code>, and <code>Staking<\/code> handle essential functionalities such as account management, token transfers, and proof-of-stake consensus. For custom requirements, developers can create new modules, adding unique features to their blockchain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Building_a_Blockchain_Step-by-Step\"><\/span>Building a Blockchain Step-by-Step<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Setting_Up_with_Ignite_CLI\"><\/span>Step 1: Setting Up with Ignite CLI<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The first step in building a blockchain with the Cosmos SDK is to scaffold the project using Ignite CLI. Run the following command to create a new blockchain project:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"ignite scaffold chain mychain\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">ignite<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">scaffold<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">chain<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">mychain<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This command generates a basic blockchain structure, including configuration files and essential modules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Adding_Module\"><\/span>Step 2: Adding Module<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Modules define the functionalities of your blockchain. For example, the <code>Bank<\/code> module handles token transfers, while the <code>Staking<\/code> module implements proof-of-stake consensus. To scaffold a custom module, use the following command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\nignite scaffold module nameservice\n\n\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ignite<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">scaffold<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">module<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">nameservice<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Once the module is scaffolded, you can add functionality to it. For instance, if you are building a name service module, you can create commands to allow users to buy and set names:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\nignite scaffold message buyName name price\nignite scaffold message setName name value\n\n\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ignite<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">scaffold<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">message<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">buyName<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">name<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">price<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ignite<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">scaffold<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">message<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">setName<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">name<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">value<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>These commands generate the necessary files and boilerplate code, allowing you to focus on implementing the logic for each feature.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Integrating_Module\"><\/span>Step 3: Integrating Module<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>After creating your modules, you need to register them with the blockchain\u2019s core. This is done by updating the <code>app.go<\/code> file. Here, you\u2019ll integrate your modules into the blockchain\u2019s ecosystem, ensuring that they interact seamlessly with other components.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Testing_Your_Blockchain\"><\/span>Step 4: Testing Your Blockchain<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Testing is a critical step in blockchain development. The Cosmos SDK includes tools for unit testing, integration testing, and IBC-specific testing. Running tests helps identify and fix issues before deploying your blockchain. For example, you can test your custom module using the following command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\ngo test .\/x\/nameservice\/...\n\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">go<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">test<\/span><span style=\"color: #D4D4D4\"> .\/<\/span><span style=\"color: #9CDCFE\">x<\/span><span style=\"color: #D4D4D4\">\/<\/span><span style=\"color: #9CDCFE\">nameservice<\/span><span style=\"color: #D4D4D4\">\/...<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Running_the_Blockchain_Locally\"><\/span>Step 5: Running the Blockchain Locally<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Once your blockchain is ready, you can run it locally to test its functionality. Use the following command to start your blockchain:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\nignite chain serve\n\n\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">ignite<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">chain<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">serve<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This command launches your blockchain, allowing you to interact with it in a controlled environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Building_a_Frontend\"><\/span>Step 6: Building a Frontend<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A user-friendly front end is very essential for interacting with your blockchain. Using tools like <strong>CosmJS<\/strong>, you can build a frontend in frameworks like React or Vue. CosmJS simplifies the integration process by providing libraries for connecting to your blockchain and executing transactions. The Cosmos SDK also exposes APIs via gRPC, making it easy to develop decentralized applications (dApps) that interact with your blockchain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Future_of_the_Cosmos_SDK\"><\/span>The Future of the Cosmos SDK<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Cosmos SDK is continuously evolving. Future updates aim to enhance its modularity, allowing developers to swap out components like the consensus engine. This flexibility will enable greater innovation and adaptability, ensuring that the Cosmos SDK remains at the forefront of blockchain development.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The Cosmos SDK is not just a development tool, it\u2019s a gateway to innovation in blockchain technology. Whether you\u2019re building a decentralized finance application, a blockchain game, or an experimental project, the SDK provides you with all the necessary tools to be able to develop it with ease. With its modular architecture, customizable features, and support for interoperability, the Cosmos SDK simplifies the process of building a blockchain. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1732875479678\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"What_is_the_Cosmos_SDK\"><\/span>What is the Cosmos SDK?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The Cosmos SDK is a blockchain development framework that enables developers to create custom, application-specific blockchains. It provides a modular architecture where developers can compose different components to build their blockchain applications. <\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1732875508761\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"What_language_does_Cosmos_SDK_use\"><\/span>What language does Cosmos SDK use?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The Cosmos SDK uses the Go language. All its elements like Tendermint, IBC, etc are also written in Go language. This choice was made because Go offers excellent performance characteristics, strong typing, and built-in concurrency support, which are crucial for blockchain development.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1732875584677\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"What_is_the_ATOM_cosmos_used_for\"><\/span>What is the ATOM cosmos used for?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>ATOM is the native token of the Cosmos Hub and serves multiple essential functions within the ecosystem. It acts as a staking token for securing the network through proof-of-stake consensus, facilitates governance by allowing holders to vote on protocol changes, and enables the payment of transaction fees. It also plays a crucial role in the inter-blockchain communication (IBC) protocol, helping to secure cross-chain transactions.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1732875633584\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><span class=\"ez-toc-section\" id=\"What_is_the_difference_between_Cosmos_and_Ethereum_SDK\"><\/span>What is the difference between Cosmos and Ethereum SDK?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The distinction between Cosmos SDK and Ethereum&#8217;s development framework lies in their fundamental architecture. While Ethereum&#8217;s SDK focuses on building smart contracts that run on the Ethereum Virtual Machine (EVM) within a single blockchain, Cosmos SDK enables the creation of entirely independent, sovereign blockchains called APP chains or Application Blockchains that can communicate with each other through the IBC protocol. These are optimized for specific use cases and have their own validator sets, while Ethereum contracts share the same underlying blockchain infrastructure and compete for resources.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":24,"featured_media":10732,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[17],"tags":[],"class_list":["post-10724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain"],"_links":{"self":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/10724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/comments?post=10724"}],"version-history":[{"count":3,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/10724\/revisions"}],"predecessor-version":[{"id":10744,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/10724\/revisions\/10744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media\/10732"}],"wp:attachment":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media?parent=10724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/categories?post=10724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/tags?post=10724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}