diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..1214a38b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +# Ignore artifacts: +build +coverage +node_modules +.docusaurus diff --git a/README.md b/README.md index 0f64f4b8..2f8de797 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Project Documentation -Welcome to the documentation directory for Calimero Network. This directory contains all the necessary files to build and run the project documentation locally, contribute changes, and deploy updates. +Welcome to the documentation directory for Calimero Network. This directory +contains all the necessary files to build and run the project documentation +locally, contribute changes, and deploy updates. ## Getting Started @@ -8,35 +10,38 @@ Follow these steps to get started with the documentation: ### Prerequisites -- Ensure you have [Node.js](https://nodejs.org/) installed (version 18 or later). -- [pnpm](https://pnpm.io/) is our package manager of choice. If you don't have it installed, follow the [installation instructions](https://pnpm.io/installation). +- Ensure you have [Node.js](https://nodejs.org/) installed (version 18 or + later). +- [pnpm](https://pnpm.io/) is our package manager of choice. If you don't have + it installed, follow the + [installation instructions](https://pnpm.io/installation). ### Installation -1. Clone the repository (if you haven't already): +1. Clone the repository (if you haven't already): - ```bash - git clone https://github.com/calimero-network.git - cd yourproject/docs - ``` + ```bash + git clone https://github.com/calimero-network.git + cd yourproject/docs + ``` -2. Install the dependencies: +2. Install the dependencies: ```bash pnpm install ``` -3. Running the Documentation Locally -To start a local development server and open the documentation in your browser: +3. Running the Documentation Locally To start a local development server and + open the documentation in your browser: - ```bash - pnpm start - ``` + ```bash + pnpm start + ``` -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. +This command starts a local development server and opens up a browser window. +Most changes are reflected live without having to restart the server. -1. Contributing -We welcome contributions to our documentation! To contribute: +1. Contributing We welcome contributions to our documentation! To contribute: Create a branch for your changes: @@ -56,17 +61,19 @@ Push your branch and open a pull request against the main branch. 1. Deployment -This command builds the documentation and pushes it to the gh-pages branch, automatically updating the live documentation site. +This command builds the documentation and pushes it to the gh-pages branch, +automatically updating the live documentation site. ### Structure -docs/: Contains the Markdown files for the documentation. -blog/: Contains the Markdown files for the blog. -sidebars.js: Configures the documentation sidebar. Currently autogenerated. -docusaurus.config.js: Contains configuration for Docusaurus, including theme and plugin settings. +docs/: Contains the Markdown files for the documentation. blog/: Contains the +Markdown files for the blog. sidebars.js: Configures the documentation sidebar. +Currently autogenerated. docusaurus.config.js: Contains configuration for +Docusaurus, including theme and plugin settings. ### Support -If you encounter any issues or have questions about contributing to the documentation, please open an issue on GitHub. +If you encounter any issues or have questions about contributing to the +documentation, please open an issue on GitHub. Thank you for contributing to Calimero Network's documentation! diff --git a/docs/01-explore/01-intro.mdx b/docs/01-explore/01-intro.mdx index 1e6da718..6a15599b 100644 --- a/docs/01-explore/01-intro.mdx +++ b/docs/01-explore/01-intro.mdx @@ -5,30 +5,51 @@ title: Introduction ## Welcome to Our Project Documentation -Welcome to our comprehensive documentation. -Here, you'll find all the resources and guidance needed to understand and engage with our technology. Whether you are new to privacy technology or looking to deepen your existing knowledge, this documentation is structured to assist you every step of the way. +Welcome to our comprehensive documentation. Here, you'll find all the resources +and guidance needed to understand and engage with our technology. Whether you +are new to privacy technology or looking to deepen your existing knowledge, this +documentation is structured to assist you every step of the way. -Our documentation is divided into several key sections, each designed to provide you with detailed insights and practical tools: +Our documentation is divided into several key sections, each designed to provide +you with detailed insights and practical tools: ### Explore -Explore is your starting point for smoothly moving between our documentation sections. Here, you'll get a quick overview of what each part covers. Dive into our Manifesto to understand our key beliefs. Then, jump into the Developers Quickstart for simple steps to get hands-on with our product if you prefer to dive into example first. +Explore is your starting point for smoothly moving between our documentation +sections. Here, you'll get a quick overview of what each part covers. Dive into +our Manifesto to understand our key beliefs. Then, jump into the Developers +Quickstart for simple steps to get hands-on with our product if you prefer to +dive into example first. ### Learn -This section is your gateway to understanding our technology and foundational privacy principles. It provides a structured approach to learning, from system architecture and essential terminology to in-depth exploration of both basic and complex privacy concepts. It also addresses the limitations of our technology, ensuring you have a comprehensive understanding. +This section is your gateway to understanding our technology and foundational +privacy principles. It provides a structured approach to learning, from system +architecture and essential terminology to in-depth exploration of both basic and +complex privacy concepts. It also addresses the limitations of our technology, +ensuring you have a comprehensive understanding. ### Build -The "Build" section equips you with the necessary tools and documentation to start creating applications using our technology. It features a quickstart guide for immediate setup, detailed descriptions of our SDKs for Rust and TypeScript, and insights into our protocol, catering to developers at all skill levels. +The "Build" section equips you with the necessary tools and documentation to +start creating applications using our technology. It features a quickstart guide +for immediate setup, detailed descriptions of our SDKs for Rust and TypeScript, +and insights into our protocol, catering to developers at all skill levels. ### Contribute -In the "Contribute" section, we invite you to actively participate in the development and improvement of our project. It provides detailed instructions on how to use GitHub for contributions, including environment setup, submission of changes, and community guidelines. Information on hackathons and available bounties is also included to engage with our community further. +In the "Contribute" section, we invite you to actively participate in the +development and improvement of our project. It provides detailed instructions on +how to use GitHub for contributions, including environment setup, submission of +changes, and community guidelines. Information on hackathons and available +bounties is also included to engage with our community further. ### Resources -Our "Resources" section serves as a comprehensive directory of additional materials, including detailed documentation, community forums, and external readings. It is designed to support your ongoing learning and application of our technology. +Our "Resources" section serves as a comprehensive directory of additional +materials, including detailed documentation, community forums, and external +readings. It is designed to support your ongoing learning and application of our +technology. ### Next steps diff --git a/docs/01-explore/04-why-not/01-blockchain.mdx b/docs/01-explore/04-why-not/01-blockchain.mdx index fef955bc..c819c0f8 100644 --- a/docs/01-explore/04-why-not/01-blockchain.mdx +++ b/docs/01-explore/04-why-not/01-blockchain.mdx @@ -5,14 +5,35 @@ title: Blockchain ## Why not Blockchain? -By virtue of blockchain principles, there's a couple of issues that arise. The major one being that everyone has to agree on the state of the canonical chain, and therefore there can be only one network actor at any given time. Different chains implement different strategies for electing this actor to alleviate the risk of compromise, but the fundamental issue remains, and hence, the long-standing problem of scalability. +By virtue of blockchain principles, there's a couple of issues that arise. The +major one being that everyone has to agree on the state of the canonical chain, +and therefore there can be only one network actor at any given time. Different +chains implement different strategies for electing this actor to alleviate the +risk of compromise, but the fundamental issue remains, and hence, the +long-standing problem of scalability. ## Calimero vs Blockchain -Calimero fundamentally rethinks the problem and offers an alternative approach, local-first execution with eventual consistency. This means that each actor can independently drive their own local state, and the network will eventually reconcile to the same state. Essentially pegging the scalability threshold to the number of actors in the network, and executions are practically instantaneous. +Calimero fundamentally rethinks the problem and offers an alternative approach, +local-first execution with eventual consistency. This means that each actor can +independently drive their own local state, and the network will eventually +reconcile to the same state. Essentially pegging the scalability threshold to +the number of actors in the network, and executions are practically +instantaneous. -State reconciliation is context-aware, meaning that all activity revolves around an instance of an app. This means that participants of a context only have to synchronize with each other, and not the entire network. This is in stark contrast to blockchains, where everyone is forced to synchronize with everyone else and this competition is reflected in gas fees. Calimero doesn't have gas fees, and the cost of execution is directly borne by the actor. +State reconciliation is context-aware, meaning that all activity revolves around +an instance of an app. This means that participants of a context only have to +synchronize with each other, and not the entire network. This is in stark +contrast to blockchains, where everyone is forced to synchronize with everyone +else and this competition is reflected in gas fees. Calimero doesn't have gas +fees, and the cost of execution is directly borne by the actor. -Blockchains achieve integrity through transparency, which is a double-edged sword, essentially precluding you from using it in private environments. Calimero however, leverages the direct-actor relationship to encrypt all network traffic between them, and therefore, the network is inherently private. +Blockchains achieve integrity through transparency, which is a double-edged +sword, essentially precluding you from using it in private environments. +Calimero however, leverages the direct-actor relationship to encrypt all network +traffic between them, and therefore, the network is inherently private. -Calimero is also designed to be embeddable, meaning that client apps themselves become the network actors, and the network is the app itself. This is in stark contrast to blockchains, where the network is a separate entity from the client apps. +Calimero is also designed to be embeddable, meaning that client apps themselves +become the network actors, and the network is the app itself. This is in stark +contrast to blockchains, where the network is a separate entity from the client +apps. diff --git a/docs/01-explore/04-why-not/02-ipfs.mdx b/docs/01-explore/04-why-not/02-ipfs.mdx index 23229655..5f8d344c 100644 --- a/docs/01-explore/04-why-not/02-ipfs.mdx +++ b/docs/01-explore/04-why-not/02-ipfs.mdx @@ -9,4 +9,6 @@ IPFS is a storage solution, it's not designed for generic compute. ## Calimero vs IPFS -Calimero is designed to be a general-purpose compute engine that can be used to build a wide variety of applications. Also worth noting that Calimero does offer a way to store encrypted data, effectively making it a storage solution as well. +Calimero is designed to be a general-purpose compute engine that can be used to +build a wide variety of applications. Also worth noting that Calimero does offer +a way to store encrypted data, effectively making it a storage solution as well. diff --git a/docs/01-explore/04-why-not/03-zk.mdx b/docs/01-explore/04-why-not/03-zk.mdx index c761175e..4e3c4c7f 100644 --- a/docs/01-explore/04-why-not/03-zk.mdx +++ b/docs/01-explore/04-why-not/03-zk.mdx @@ -5,8 +5,14 @@ title: ZK ## Why not ZK? -Zero-Knowledge (ZK) solutions focus on enhancing privacy and reducing the need to reveal data during synchronization, but they don't eliminate the need for synchronization itself. +Zero-Knowledge (ZK) solutions focus on enhancing privacy and reducing the need +to reveal data during synchronization, but they don't eliminate the need for +synchronization itself. ## Calimero vs ZK -Calimero offers a fundamentally different approach with local-first execution and eventual consistency, minimizing synchronization overhead. Additionally, ZK solutions can complement Calimero by providing enhanced privacy features within its framework, offering the best of both worlds without inheriting the synchronization complexities of traditional ZK implementations. +Calimero offers a fundamentally different approach with local-first execution +and eventual consistency, minimizing synchronization overhead. Additionally, ZK +solutions can complement Calimero by providing enhanced privacy features within +its framework, offering the best of both worlds without inheriting the +synchronization complexities of traditional ZK implementations. diff --git a/docs/01-explore/05-use-cases/00-private-dao-management.mdx b/docs/01-explore/05-use-cases/00-private-dao-management.mdx index 295e4d07..0c31a1c6 100644 --- a/docs/01-explore/05-use-cases/00-private-dao-management.mdx +++ b/docs/01-explore/05-use-cases/00-private-dao-management.mdx @@ -3,4 +3,7 @@ id: private-daos-management title: Private DAOs Management --- -Migrate sensitive on-chain and off-chain data into a DAO-owned private Calimero application, enabling you to interact with the base chain of the DAO. DAO members keep the core contract logic on-chain, while shielding all the sensitive data. +Migrate sensitive on-chain and off-chain data into a DAO-owned private Calimero +application, enabling you to interact with the base chain of the DAO. DAO +members keep the core contract logic on-chain, while shielding all the sensitive +data. diff --git a/docs/01-explore/05-use-cases/01-decentralized-voting-systems.mdx b/docs/01-explore/05-use-cases/01-decentralized-voting-systems.mdx index ddc8f9eb..81391d4e 100644 --- a/docs/01-explore/05-use-cases/01-decentralized-voting-systems.mdx +++ b/docs/01-explore/05-use-cases/01-decentralized-voting-systems.mdx @@ -3,4 +3,9 @@ id: decentralized-voting-systems title: Decentralized Voting Systems --- -Enhance trust in voting by creating a secure and tamper-proof voting process application, ensuring each vote is counted accurately and cannot be altered. This technology enhances trust in voting by providing verifiable and immutable records while protecting voter privacy. It empowers voters, reduces the risk of fraud, and promotes democratic participation through a transparent and secure voting platform. +Enhance trust in voting by creating a secure and tamper-proof voting process +application, ensuring each vote is counted accurately and cannot be altered. +This technology enhances trust in voting by providing verifiable and immutable +records while protecting voter privacy. It empowers voters, reduces the risk of +fraud, and promotes democratic participation through a transparent and secure +voting platform. diff --git a/docs/01-explore/05-use-cases/02-decentralized-social-platforms.mdx b/docs/01-explore/05-use-cases/02-decentralized-social-platforms.mdx index 55748ce5..eee1fb71 100644 --- a/docs/01-explore/05-use-cases/02-decentralized-social-platforms.mdx +++ b/docs/01-explore/05-use-cases/02-decentralized-social-platforms.mdx @@ -3,4 +3,8 @@ id: decentralized-social-platforms title: Decentralized Social Platforms --- -Build social experiences which need scalable but private data like social groups, direct messages and others, while eliminating high transaction costs (gas fees associated with blockchains). This can include exclusive groups and gated communities based on ownership of NFTs or token payments which would allow participation and decryption of the community data content. +Build social experiences which need scalable but private data like social +groups, direct messages and others, while eliminating high transaction costs +(gas fees associated with blockchains). This can include exclusive groups and +gated communities based on ownership of NFTs or token payments which would allow +participation and decryption of the community data content. diff --git a/docs/01-explore/05-use-cases/03-deprod.mdx b/docs/01-explore/05-use-cases/03-deprod.mdx index 219e32dd..f8a13c31 100644 --- a/docs/01-explore/05-use-cases/03-deprod.mdx +++ b/docs/01-explore/05-use-cases/03-deprod.mdx @@ -3,4 +3,7 @@ id: deprod title: Decentralized Productivity (DeProd) SaaS --- -Create a decentralized productivity tools suite by self hosting your data on Calimero’s private applications and move away from the control of centralized entities. The new platform would mitigate the burden of lifetime deals and hard migration processes for the current users of Productivity SaaS solutions. \ No newline at end of file +Create a decentralized productivity tools suite by self hosting your data on +Calimero’s private applications and move away from the control of centralized +entities. The new platform would mitigate the burden of lifetime deals and hard +migration processes for the current users of Productivity SaaS solutions. diff --git a/docs/01-explore/05-use-cases/04-decentralized-gig-economy.mdx b/docs/01-explore/05-use-cases/04-decentralized-gig-economy.mdx index bad87f67..d44f002c 100644 --- a/docs/01-explore/05-use-cases/04-decentralized-gig-economy.mdx +++ b/docs/01-explore/05-use-cases/04-decentralized-gig-economy.mdx @@ -3,4 +3,7 @@ id: decentralized-gig-economy title: Decentralized Gig Economy --- -Disrupt the current gig economy players and compose a fully decentralized ride sharing, freelancing, temporary work, mechanical turk platform, or any other shared economy model where each network participant gets their fair share of the profits. \ No newline at end of file +Disrupt the current gig economy players and compose a fully decentralized ride +sharing, freelancing, temporary work, mechanical turk platform, or any other +shared economy model where each network participant gets their fair share of the +profits. diff --git a/docs/01-explore/05-use-cases/05-trustless-gaming.mdx b/docs/01-explore/05-use-cases/05-trustless-gaming.mdx index 9521a84f..9cac6e0e 100644 --- a/docs/01-explore/05-use-cases/05-trustless-gaming.mdx +++ b/docs/01-explore/05-use-cases/05-trustless-gaming.mdx @@ -3,4 +3,6 @@ id: trustless-gaming title: Trustless Gaming --- -Resolve the transparency and verification problems in games with turn mechanics (i.e. Battleship), and in those where private data holds significant importance (i.e. poker). +Resolve the transparency and verification problems in games with turn mechanics +(i.e. Battleship), and in those where private data holds significant importance +(i.e. poker). diff --git a/docs/01-explore/05-use-cases/06-decentralized-edge-compute.mdx b/docs/01-explore/05-use-cases/06-decentralized-edge-compute.mdx index 61db99a3..7b5e87ab 100644 --- a/docs/01-explore/05-use-cases/06-decentralized-edge-compute.mdx +++ b/docs/01-explore/05-use-cases/06-decentralized-edge-compute.mdx @@ -3,6 +3,18 @@ id: decentralized-edge-compute title: Decentralized Edge Compute --- -Most of the general compute today happens on cloud service because that is where most of the data lives. With Calimero, all the applications data is stored locally, whereas Calimero enables edge compute on that data. Combined with the use of decentralized AI and Edge Inference LLMs, there are numerous use cases how Calimero can enhance user experience: Edge AI on users data for social spam filtering, e-commerce shopping recommendations across channels, to name a few. This would allow users to finally maximize the endless possibilities from their data, on their own rules. +Most of the general compute today happens on cloud service because that is where +most of the data lives. With Calimero, all the applications data is stored +locally, whereas Calimero enables edge compute on that data. Combined with the +use of decentralized AI and Edge Inference LLMs, there are numerous use cases +how Calimero can enhance user experience: Edge AI on users data for social spam +filtering, e-commerce shopping recommendations across channels, to name a few. +This would allow users to finally maximize the endless possibilities from their +data, on their own rules. -For example, when you used to purchase from a certain merchant, the data was fully controlled by that merchant or the platform where the data was hosted, which would yield to your recommendations being exclusively tied to that merchant. But if the data would have lived on your device, your data recommendations would have been across various market channels, and not exclusively tied to that specific merchant. \ No newline at end of file +For example, when you used to purchase from a certain merchant, the data was +fully controlled by that merchant or the platform where the data was hosted, +which would yield to your recommendations being exclusively tied to that +merchant. But if the data would have lived on your device, your data +recommendations would have been across various market channels, and not +exclusively tied to that specific merchant. diff --git a/docs/01-explore/05-use-cases/07-decentralized-identity-verification.mdx b/docs/01-explore/05-use-cases/07-decentralized-identity-verification.mdx index e6e67df6..c4f6a509 100644 --- a/docs/01-explore/05-use-cases/07-decentralized-identity-verification.mdx +++ b/docs/01-explore/05-use-cases/07-decentralized-identity-verification.mdx @@ -3,4 +3,8 @@ id: decentralized-identity-verification title: Decentralized Identity Verification --- -Create a private Calimero application network which provides transparent and trusted identity verification for service providers. With Calimero, sensitive procedures such as opening a bank account or applying for Visas would not require service providers to host the data of their users at centralized entities any more. \ No newline at end of file +Create a private Calimero application network which provides transparent and +trusted identity verification for service providers. With Calimero, sensitive +procedures such as opening a bank account or applying for Visas would not +require service providers to host the data of their users at centralized +entities any more. diff --git a/docs/01-explore/05-use-cases/08-decentralized-intellectual-property-management.mdx b/docs/01-explore/05-use-cases/08-decentralized-intellectual-property-management.mdx index 351d4a67..cecb573c 100644 --- a/docs/01-explore/05-use-cases/08-decentralized-intellectual-property-management.mdx +++ b/docs/01-explore/05-use-cases/08-decentralized-intellectual-property-management.mdx @@ -3,4 +3,7 @@ id: decentralized-intellectual-property-management title: Decentralized Intellectual Property Management --- -The traditional platforms for managing and enforcing intellectual property rights are not fully transparent, resulting in creators not being able to maximize the utility of their work. Developing a decentralized IP management platform would result in a fairer compensation system for all creators. +The traditional platforms for managing and enforcing intellectual property +rights are not fully transparent, resulting in creators not being able to +maximize the utility of their work. Developing a decentralized IP management +platform would result in a fairer compensation system for all creators. diff --git a/docs/01-explore/06-awesome-projects/01-only-peers.mdx b/docs/01-explore/06-awesome-projects/01-only-peers.mdx index d010bbd8..a61f4749 100644 --- a/docs/01-explore/06-awesome-projects/01-only-peers.mdx +++ b/docs/01-explore/06-awesome-projects/01-only-peers.mdx @@ -3,4 +3,11 @@ id: only-peers title: Only Peers --- -Only Peers is a decentralized social networking app that empowers you to share your thoughts and engage with your community without compromising your privacy. It allows you to write posts, leave comments, and interact with friends. However, unlike traditional social networks, Only Peers ensures your data remains under your control, protected from central authorities and prying eyes. Experience the freedom of a decentralized platform where your voice cannot be censored and your privacy is prioritized. Explore the source code on [GitHub repository](https://github.com/calimero-network/only-peers-client). +Only Peers is a decentralized social networking app that empowers you to share +your thoughts and engage with your community without compromising your privacy. +It allows you to write posts, leave comments, and interact with friends. +However, unlike traditional social networks, Only Peers ensures your data +remains under your control, protected from central authorities and prying eyes. +Experience the freedom of a decentralized platform where your voice cannot be +censored and your privacy is prioritized. Explore the source code on +[GitHub repository](https://github.com/calimero-network/only-peers-client). diff --git a/docs/01-explore/06-awesome-projects/02-rock-paper-scissors.mdx b/docs/01-explore/06-awesome-projects/02-rock-paper-scissors.mdx index 754f4858..087cb37c 100644 --- a/docs/01-explore/06-awesome-projects/02-rock-paper-scissors.mdx +++ b/docs/01-explore/06-awesome-projects/02-rock-paper-scissors.mdx @@ -3,4 +3,13 @@ id: rock-paper-scissors title: Rock Paper Scissors --- -A popular game we all know and love, but this time played online and enforcing complete security using the commit - reveal scheme. After you pick your choice of either rock, paper or scissors, you encrypt your choice with a password. This ensures the other player can’t see your choice. After your opponent has also decided, it is time to reveal your password and determine the winner. You cannot change your mind between choosing and revealing because your choice is locked with the special password. This prevents any bad actors from changing their minds in the middle of the game.Have fun with a classic game that is completely fair and private! Explore the source code on [GitHub repository](https://github.com/calimero-network/rock-paper-scissors-ui) +A popular game we all know and love, but this time played online and enforcing +complete security using the commit - reveal scheme. After you pick your choice +of either rock, paper or scissors, you encrypt your choice with a password. This +ensures the other player can’t see your choice. After your opponent has also +decided, it is time to reveal your password and determine the winner. You cannot +change your mind between choosing and revealing because your choice is locked +with the special password. This prevents any bad actors from changing their +minds in the middle of the game.Have fun with a classic game that is completely +fair and private! Explore the source code on +[GitHub repository](https://github.com/calimero-network/rock-paper-scissors-ui) diff --git a/docs/01-explore/_03-manifesto.mdx b/docs/01-explore/_03-manifesto.mdx index b134b3c9..533751e2 100644 --- a/docs/01-explore/_03-manifesto.mdx +++ b/docs/01-explore/_03-manifesto.mdx @@ -1,34 +1,62 @@ --- id: manifesto -title: "The Calimero Manifesto" +title: 'The Calimero Manifesto' --- -In a digital era overshadowed by towering giants and watchful overseers, Calimero emerges as a ray of hope. We're part of a burgeoning movement, dedicated to creating a space where privacy is cherished, control over personal data is the standard, and the freedom to express oneself is protected. Join us in this united quest to secure the digital freedoms that belong to every one of us. +In a digital era overshadowed by towering giants and watchful overseers, +Calimero emerges as a ray of hope. We're part of a burgeoning movement, +dedicated to creating a space where privacy is cherished, control over personal +data is the standard, and the freedom to express oneself is protected. Join us +in this united quest to secure the digital freedoms that belong to every one of +us. **Redefining Privacy: Our Core Crusade** -Privacy is the bedrock of our digital freedoms. In a realm rife with surveillance, we draw a line. Our mission, powered by zero-knowledge, multiparty computation, homomorphic encryption, and beyond, is to enshrine privacy as a fundamental right, transforming it from a mere concept into an everyday reality for all. +Privacy is the bedrock of our digital freedoms. In a realm rife with +surveillance, we draw a line. Our mission, powered by zero-knowledge, multiparty +computation, homomorphic encryption, and beyond, is to enshrine privacy as a +fundamental right, transforming it from a mere concept into an everyday reality +for all. **Championing Data Sovereignty** -The era of corporations ruling our digital lives is ending. With Calimero, you ascend to sovereignty over your data. We're dismantling the old structures, ensuring that your data—your digital essence—is yours to control, share, and monetize. Envision a digital realm where your data empowers you, not corporate giants. +The era of corporations ruling our digital lives is ending. With Calimero, you +ascend to sovereignty over your data. We're dismantling the old structures, +ensuring that your data—your digital essence—is yours to control, share, and +monetize. Envision a digital realm where your data empowers you, not corporate +giants. **Defending the Digital Dialogue** -In the battle against censorship's dark veil, cast by both states and corporations, Calimero emerges as a fortress of free speech. We're committed to protecting the diversity of voices, ensuring that every perspective is heard and valued. Our pledge is unwavering: to safeguard the flow of ideas, keeping the digital realm a vibrant forum for debate and discovery. +In the battle against censorship's dark veil, cast by both states and +corporations, Calimero emerges as a fortress of free speech. We're committed to +protecting the diversity of voices, ensuring that every perspective is heard and +valued. Our pledge is unwavering: to safeguard the flow of ideas, keeping the +digital realm a vibrant forum for debate and discovery. **The Calimero Creed: A Triad of Liberty** -Calimero transcends mere technology; we embody a manifesto of digital liberty. Our vision is grand, our path is challenging, but together, we are unstoppable. We invite the bold, the creative, and the outspoken to stand with us. +Calimero transcends mere technology; we embody a manifesto of digital liberty. +Our vision is grand, our path is challenging, but together, we are unstoppable. +We invite the bold, the creative, and the outspoken to stand with us. -- **For Privacy**: We're pioneering the use of advanced cryptography to shield your digital life, making privacy your default setting. -- **For Data Ownership**: We champion your authority over your digital footprint, ensuring it serves you, not the other way around. -- **For Censorship Resistance**: We're constructing an impregnable haven for free thought and expression, where innovation and diversity thrive. +- **For Privacy**: We're pioneering the use of advanced cryptography to shield + your digital life, making privacy your default setting. +- **For Data Ownership**: We champion your authority over your digital + footprint, ensuring it serves you, not the other way around. +- **For Censorship Resistance**: We're constructing an impregnable haven for + free thought and expression, where innovation and diversity thrive. **Join the Vanguard of the New Digital Epoch** -As pioneers at the dawn of a digital renaissance, we envision a web freed from the chains of surveillance, exploitation, and censorship. Calimero is a call to arms, an invitation to be part of a community that cherishes privacy, data sovereignty, and the freedom of speech above all else. +As pioneers at the dawn of a digital renaissance, we envision a web freed from +the chains of surveillance, exploitation, and censorship. Calimero is a call to +arms, an invitation to be part of a community that cherishes privacy, data +sovereignty, and the freedom of speech above all else. -Embrace your role in this revolution. Together, under the banners of our foundational principles, we will sculpt a new digital landscape—a realm that truly belongs to us all. +Embrace your role in this revolution. Together, under the banners of our +foundational principles, we will sculpt a new digital landscape—a realm that +truly belongs to us all. -**We Are Calimero. Together, We Reclaim Our Digital Destiny and Forge Our Future.** +**We Are Calimero. Together, We Reclaim Our Digital Destiny and Forge Our +Future.** diff --git a/docs/02-learn/01-terminology.mdx b/docs/02-learn/01-terminology.mdx index 421e837c..fa2c0866 100644 --- a/docs/02-learn/01-terminology.mdx +++ b/docs/02-learn/01-terminology.mdx @@ -3,13 +3,43 @@ id: terminology title: Terminology --- -As projects grow, it's important to have a shared vocabulary to help communicate effectively. This page provides a list of terms used in the documentation and throughout the codebase. +As projects grow, it's important to have a shared vocabulary to help communicate +effectively. This page provides a list of terms used in the documentation and +throughout the codebase. -- **Node** is any individual device or computer that participates in the network. To avoid confusion with network layer used in the protocol, instead of network we are using term **Context**. -- **Peer** is a specific instance of a node within a P2P network that interacts with other peers. Peer represents user. -- **Peer Id** is a unique identifier assigned to each peer in the network. It is used to distinguish between different peers and ensure that messages are delivered to the correct recipient. -- **Context** is the core of the Calimero ecosystem. It is an application specific network designed to enable direct communication between users, eliminating the need for intermediaries -- **Application** is a software program designed to perform specific tasks or solve particular problems. To ensure compatibility and functionality, it should be developed according to the protocol SDK instructions provided. Once developed, the application should be published in a format that others can use during runtime, specifically in WebAssembly (WASM) format. Developer can also build frontend for an application, deployed separately, allowing users to interact with an app directly. This user interface facilitates interaction with the underlying software, making the application accessible and user-friendly. -- **Root key** is the public part of a wallet cryptographic key pair used to verify the signature of sensitive actions. This public key is used to ensure that any data or actions signed with the corresponding private key can be trusted. Essentially, the root key serves as a trust anchor, enabling users to validate the authenticity and integrity of operations or communications associated with the node. It does not grant direct control over the node but ensures that actions authenticated with the private part of the root key are legitimate. -- **Client key** is a cryptographic key tailored for each user session, acting as a session key or token. Each client key must be signed with the root key to be valid which is done automatically during login. This ensures that only sessions authenticated by the trusted root key can interact with the node. -- **Specialized node** is third-party node that augment a context's capacity and reliability. It participates in a context but have additional capabilities, providing various services while maintaining the decentralized nature of the network. +- **Node** is any individual device or computer that participates in the + network. To avoid confusion with network layer used in the protocol, instead + of network we are using term **Context**. +- **Peer** is a specific instance of a node within a P2P network that interacts + with other peers. Peer represents user. +- **Peer Id** is a unique identifier assigned to each peer in the network. It is + used to distinguish between different peers and ensure that messages are + delivered to the correct recipient. +- **Context** is the core of the Calimero ecosystem. It is an application + specific network designed to enable direct communication between users, + eliminating the need for intermediaries +- **Application** is a software program designed to perform specific tasks or + solve particular problems. To ensure compatibility and functionality, it + should be developed according to the protocol SDK instructions provided. Once + developed, the application should be published in a format that others can use + during runtime, specifically in WebAssembly (WASM) format. Developer can also + build frontend for an application, deployed separately, allowing users to + interact with an app directly. This user interface facilitates interaction + with the underlying software, making the application accessible and + user-friendly. +- **Root key** is the public part of a wallet cryptographic key pair used to + verify the signature of sensitive actions. This public key is used to ensure + that any data or actions signed with the corresponding private key can be + trusted. Essentially, the root key serves as a trust anchor, enabling users to + validate the authenticity and integrity of operations or communications + associated with the node. It does not grant direct control over the node but + ensures that actions authenticated with the private part of the root key are + legitimate. +- **Client key** is a cryptographic key tailored for each user session, acting + as a session key or token. Each client key must be signed with the root key to + be valid which is done automatically during login. This ensures that only + sessions authenticated by the trusted root key can interact with the node. +- **Specialized node** is third-party node that augment a context's capacity and + reliability. It participates in a context but have additional capabilities, + providing various services while maintaining the decentralized nature of the + network. diff --git a/docs/02-learn/02-architecture.mdx b/docs/02-learn/02-architecture.mdx index b6be285a..57a5aabd 100644 --- a/docs/02-learn/02-architecture.mdx +++ b/docs/02-learn/02-architecture.mdx @@ -3,17 +3,27 @@ id: architecture title: Architecture --- -Calimero Network offers a robust framework for developing and running peer-to-peer (P2P) applications. Our framework allows users to participate in the network or build applications for others to use. +Calimero Network offers a robust framework for developing and running +peer-to-peer (P2P) applications. Our framework allows users to participate in +the network or build applications for others to use. ## Participate -Users participate in the network with a client node. By encapsulating the complexities of operating a client node, we aim to make it easy and intuitive for everyone to engage in the decentralized world. +Users participate in the network with a client node. By encapsulating the +complexities of operating a client node, we aim to make it easy and intuitive +for everyone to engage in the decentralized world. -- Client node acts as a gateway that runs applications and connects with other peers -- Each application is loaded and isolated from other applications into a separate context. This ensures that each application runs independently while still allowing interactions through shared states or messages. -- Context consolidates all necessary components into a secure, isolated environment. +- Client node acts as a gateway that runs applications and connects with other + peers +- Each application is loaded and isolated from other applications into a + separate context. This ensures that each application runs independently while + still allowing interactions through shared states or messages. +- Context consolidates all necessary components into a secure, isolated + environment. -Some networks may require specialized functionalities, which are provided by a dedicated compute market. Users can integrate these special functionalities from a pool of available specialized nodes. +Some networks may require specialized functionalities, which are provided by a +dedicated compute market. Users can integrate these special functionalities from +a pool of available specialized nodes. ![Calimero Architecture](/learn/architecture.png) @@ -21,9 +31,13 @@ Some networks may require specialized functionalities, which are provided by a d To develop applications on the Calimero Network, we provide comprehensive SDKs: -- Protocol SDK to define how the application should behave and communicate with the node. -- Client SDK to connect to node and use data in user interface and authenticate using wallets UI. +- Protocol SDK to define how the application should behave and communicate with + the node. +- Client SDK to connect to node and use data in user interface and authenticate + using wallets UI. -Developer applications are shared through application registry where developers upload their applications and share it with other users +Developer applications are shared through application registry where developers +upload their applications and share it with other users -Explore other sections to learn more about each component, and how they contribute to a seamless decentralized experience. +Explore other sections to learn more about each component, and how they +contribute to a seamless decentralized experience. diff --git a/docs/02-learn/03-core-concepts/01-identity (DID).mdx b/docs/02-learn/03-core-concepts/01-identity (DID).mdx index ed6757d7..3e72aa1d 100644 --- a/docs/02-learn/03-core-concepts/01-identity (DID).mdx +++ b/docs/02-learn/03-core-concepts/01-identity (DID).mdx @@ -5,32 +5,45 @@ title: Identity ### Key Management -Calimero's key management is centered around two types: Node Keys for node management and Application Keys for app operation. This structure ensures secure, anonymous and decentralized control across the network. +Calimero's key management is centered around two types: Node Keys for node +management and Application Keys for app operation. This structure ensures +secure, anonymous and decentralized control across the network. ### Node Keys -Node Keys are used to for node operations which include, add new node keys, identifier listing, and key deletion. Web3 wallets can be used as node keys, easing the setup process. +Node Keys are used to for node operations which include, add new node keys, +identifier listing, and key deletion. Web3 wallets can be used as node keys, +easing the setup process. **Key Initialization Process**: -1. **Starting Without Keys**: Initially, nodes have no keys. The addition of the first key is crucial for setting up application identities. +1. **Starting Without Keys**: Initially, nodes have no keys. The addition of the + first key is crucial for setting up application identities. 2. **Adding the First Key**: - - In the node admin UI, connect a wallet, such as MetaMask or Near wallets compliant with [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md). + - In the node admin UI, connect a wallet, such as MetaMask or Near wallets + compliant with + [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md). - Sign a challenge from the node and submit the signature. - - If the signature matches the challenge and the public key, the first node key is added, activating key management capabilities. + - If the signature matches the challenge and the public key, the first node + key is added, activating key management capabilities. ### Application Keys -Application Keys initiate applications, with keypairs stored in browser local storage. +Application Keys initiate applications, with keypairs stored in browser local +storage. **Application Key Usage**: 1. **Key Creation**: Users generate a new keypair in their browser. 2. **Verification**: - - A Verifiable Presentation Request is sent to the node, which responds with a challenge. + - A Verifiable Presentation Request is sent to the node, which responds with + a challenge. - The challenge and public key are signed using the node key. - - Upon node verification of the request and signature, the new key is cleared for JSONRPC API communication from the browser to the node. + - Upon node verification of the request and signature, the new key is cleared + for JSONRPC API communication from the browser to the node. -Calimero's TypeScript SDK supports developers in building browser and CLI applications by simplifying interaction with the network. +Calimero's TypeScript SDK supports developers in building browser and CLI +applications by simplifying interaction with the network. -This key management setup underpins secure and efficient operations within the Calimero Network, facilitating both node and application functionalities. +This key management setup underpins secure and efficient operations within the +Calimero Network, facilitating both node and application functionalities. diff --git a/docs/02-learn/03-core-concepts/02-node/01-client-node.mdx b/docs/02-learn/03-core-concepts/02-node/01-client-node.mdx index 89ac4cc0..7b29dfd1 100644 --- a/docs/02-learn/03-core-concepts/02-node/01-client-node.mdx +++ b/docs/02-learn/03-core-concepts/02-node/01-client-node.mdx @@ -5,42 +5,69 @@ title: Client Node ### Runtime -Overview: The runtime environment of a client node in the Calimero Network is crucial for the execution of decentralized applications (DApps), particularly those compiled to WebAssembly (WASM). +Overview: The runtime environment of a client node in the Calimero Network is +crucial for the execution of decentralized applications (DApps), particularly +those compiled to WebAssembly (WASM). Functionality: -- State Synchronization: Each node can download and synchronize the state with existing applications, ensuring that all nodes participating in a particular application network are consistent and up-to-date. -- Application Settings: Nodes can be configured with specific settings for each application, including which WASM modules to run, source URLs for fetching these modules, encryption protocols to be used, and more. -- Network Topology & Update Rules: Defines the structure of the network and how nodes communicate and update each other. Proper update rules are crucial for application security and integrity, particularly in a decentralized setting where trust is distributed. +- State Synchronization: Each node can download and synchronize the state with + existing applications, ensuring that all nodes participating in a particular + application network are consistent and up-to-date. +- Application Settings: Nodes can be configured with specific settings for each + application, including which WASM modules to run, source URLs for fetching + these modules, encryption protocols to be used, and more. +- Network Topology & Update Rules: Defines the structure of the network and how + nodes communicate and update each other. Proper update rules are crucial for + application security and integrity, particularly in a decentralized setting + where trust is distributed. #### Recommendations for Developers: Thorough testing of applications in a controlled environment is advised before deploying them in production to ensure stability and security. Additionally, developers are encouraged to implement locked update rules to prevent unauthorized modifications to the application's behavior. ### Storage -Overview: Storage on client nodes involves maintaining the state and data required for the decentralized applications they support. +Overview: Storage on client nodes involves maintaining the state and data +required for the decentralized applications they support. Functionality: -- Local Storage: Each node stores application data locally, contributing to the overall decentralized storage model of the network. This ensures that data is distributed across the network, enhancing privacy and resilience against central points of failure. +- Local Storage: Each node stores application data locally, contributing to the + overall decentralized storage model of the network. This ensures that data is + distributed across the network, enhancing privacy and resilience against + central points of failure. ### Encryption: -Data stored on client nodes can be encrypted, providing an additional layer of security and privacy for user data. +Data stored on client nodes can be encrypted, providing an additional layer of +security and privacy for user data. ### Identity Management -Overview: Managing identities on the Calimero Network is fundamental for ensuring secure and private interactions between nodes and applications. +Overview: Managing identities on the Calimero Network is fundamental for +ensuring secure and private interactions between nodes and applications. Functionality: ### Authentication -Nodes implement mechanisms for authenticating users and applications, ensuring that interactions are secure and that entities are who they claim to be. +Nodes implement mechanisms for authenticating users and applications, ensuring +that interactions are secure and that entities are who they claim to be. ### Key Management -The management of cryptographic keys is an integral part of identity management, enabling secure communication and data encryption across the network. +The management of cryptographic keys is an integral part of identity management, +enabling secure communication and data encryption across the network. ### Application Marketplace -Current State: The marketplace for decentralized applications within the Calimero Network is facilitated by a smart contract on the NEAR blockchain, with application data and metadata hosted on IPFS. This setup serves as a temporary solution while further community engagement and discussions are underway to refine the marketplace's infrastructure and governance. -The Calimero Network's approach to client nodes emphasizes security, decentralization, and privacy, with a strong recommendation for users to engage with applications that have securely locked update mechanisms. These applications are more reliable for critical use cases and are the only ones featured in the official marketplace, ensuring a curated and trustworthy selection of DApps for users. This framework demonstrates Calimero Network's commitment to building a secure and user-centric decentralized ecosystem. +Current State: The marketplace for decentralized applications within the +Calimero Network is facilitated by a smart contract on the NEAR blockchain, with +application data and metadata hosted on IPFS. This setup serves as a temporary +solution while further community engagement and discussions are underway to +refine the marketplace's infrastructure and governance. The Calimero Network's +approach to client nodes emphasizes security, decentralization, and privacy, +with a strong recommendation for users to engage with applications that have +securely locked update mechanisms. These applications are more reliable for +critical use cases and are the only ones featured in the official marketplace, +ensuring a curated and trustworthy selection of DApps for users. This framework +demonstrates Calimero Network's commitment to building a secure and user-centric +decentralized ecosystem. diff --git a/docs/02-learn/03-core-concepts/02-node/02-runtime.mdx b/docs/02-learn/03-core-concepts/02-node/02-runtime.mdx index 02e57f81..40481da1 100644 --- a/docs/02-learn/03-core-concepts/02-node/02-runtime.mdx +++ b/docs/02-learn/03-core-concepts/02-node/02-runtime.mdx @@ -3,20 +3,48 @@ id: runtime title: Runtime --- -The runtime environment in the Calimero Network is essential for executing decentralized applications (DApps). It acts as a bridge between the application logic, the network, and storage layers, ensuring seamless operation and integration. The runtime ensures secure, isolated, and efficient execution of applications by managing resources effectively, supporting real-time event handling, enabling scalability, and providing robust storage and transaction management. +The runtime environment in the Calimero Network is essential for executing +decentralized applications (DApps). It acts as a bridge between the application +logic, the network, and storage layers, ensuring seamless operation and +integration. The runtime ensures secure, isolated, and efficient execution of +applications by managing resources effectively, supporting real-time event +handling, enabling scalability, and providing robust storage and transaction +management. ### Core Capabilities -- **Security and Isolation**: The runtime provides a secure execution environment for Calimero applications using WebAssembly (WASM). Each application is sandboxed in the WASM VM, ensuring proper isolation and preventing interference between applications. This setup also ensures that applications cannot access unauthorized resources, maintaining a secure environment. - -- **Multi-Application Support**: The runtime allows multiple applications to run concurrently on the same node and supports multiple instances (contexts) of the same application, each with its own state. This capability enhances the flexibility and scalability of the network. - -- **Scoped Storage**: The runtime manages storage by partitioning it and governing where each context stores its state. These implementation details are abstracted from the app developer, ensuring that storage management is handled seamlessly and securely. - -- **Atomic Transactions**: The runtime guarantees atomic transactions, ensuring that if a transaction fails, it is completely rolled back with no state updates or side effects detected. This guarantees consistency and reliability in the application's state and any connected clients. - -- **Log Collection and Relaying Events**: The runtime facilitates log collection and relays events emitted by the applications to connected clients, enabling real-time monitoring and interaction. - -- **Resource Management**: The runtime defines resource limits for applications to ensure fair usage and prevent malicious behavior. This includes limiting CPU, memory, and network usage to prevent any single application from monopolizing system resources or compromising the host system. - -- **Task Management and Performance**: The runtime keeps track of WASM instances up to a defined threshold, effortlessly queueing transactions to reuse live instances and shutting down stale ones to reclaim system resources. These optimizations ensure efficient resource utilization and improved performance. +- **Security and Isolation**: The runtime provides a secure execution + environment for Calimero applications using WebAssembly (WASM). Each + application is sandboxed in the WASM VM, ensuring proper isolation and + preventing interference between applications. This setup also ensures that + applications cannot access unauthorized resources, maintaining a secure + environment. + +- **Multi-Application Support**: The runtime allows multiple applications to run + concurrently on the same node and supports multiple instances (contexts) of + the same application, each with its own state. This capability enhances the + flexibility and scalability of the network. + +- **Scoped Storage**: The runtime manages storage by partitioning it and + governing where each context stores its state. These implementation details + are abstracted from the app developer, ensuring that storage management is + handled seamlessly and securely. + +- **Atomic Transactions**: The runtime guarantees atomic transactions, ensuring + that if a transaction fails, it is completely rolled back with no state + updates or side effects detected. This guarantees consistency and reliability + in the application's state and any connected clients. + +- **Log Collection and Relaying Events**: The runtime facilitates log collection + and relays events emitted by the applications to connected clients, enabling + real-time monitoring and interaction. + +- **Resource Management**: The runtime defines resource limits for applications + to ensure fair usage and prevent malicious behavior. This includes limiting + CPU, memory, and network usage to prevent any single application from + monopolizing system resources or compromising the host system. + +- **Task Management and Performance**: The runtime keeps track of WASM instances + up to a defined threshold, effortlessly queueing transactions to reuse live + instances and shutting down stale ones to reclaim system resources. These + optimizations ensure efficient resource utilization and improved performance. diff --git a/docs/02-learn/03-core-concepts/02-node/03-server.mdx b/docs/02-learn/03-core-concepts/02-node/03-server.mdx index e3415f2a..ca8cfd02 100644 --- a/docs/02-learn/03-core-concepts/02-node/03-server.mdx +++ b/docs/02-learn/03-core-concepts/02-node/03-server.mdx @@ -3,19 +3,33 @@ id: server title: Server --- -The server is a core component for interacting with a Calimero node. Calimero can be embedded with your client to make it a self-contained node, or it can run as a remote node that multiple clients can connect to, allowing centralized state management. +The server is a core component for interacting with a Calimero node. Calimero +can be embedded with your client to make it a self-contained node, or it can run +as a remote node that multiple clients can connect to, allowing centralized +state management. ### Core Capabilities -- **JSON-RPC API**: Provides a standardized way for clients to query or mutate the state of their counterpart applications on the node, ensuring seamless integration and communication. +- **JSON-RPC API**: Provides a standardized way for clients to query or mutate + the state of their counterpart applications on the node, ensuring seamless + integration and communication. -- **WebSocket Interface**: Allows clients to subscribe to events emitted from applications, enabling real-time reactions to activity triggered by other peers in the network. +- **WebSocket Interface**: Allows clients to subscribe to events emitted from + applications, enabling real-time reactions to activity triggered by other + peers in the network. - **Admin API**: Manages various aspects of the node, including: - - **Context Administration**: Create, delete, invite others to contexts, and accept invitations. - - **Storage Management**: Track usage, view raw state storage for each context, and view encrypted blobs. - - **State Management**: Manually garbage collect state-transitional transactions. + - **Context Administration**: Create, delete, invite others to contexts, and + accept invitations. + - **Storage Management**: Track usage, view raw state storage for each + context, and view encrypted blobs. + - **State Management**: Manually garbage collect state-transitional + transactions. - **Network Management**: Manually connect to peers and manage blocklists. - - **Application Management**: Manage installed applications, create contexts from applications, delete applications if no contexts are associated, and manually sideload applications. - - **Peer Identity Management**: Rotate peer identities without affecting context identities. - - **Node Metrics**: Track network bandwidth usage, both total and by context, to manage resource usage effectively. + - **Application Management**: Manage installed applications, create contexts + from applications, delete applications if no contexts are associated, and + manually sideload applications. + - **Peer Identity Management**: Rotate peer identities without affecting + context identities. + - **Node Metrics**: Track network bandwidth usage, both total and by context, + to manage resource usage effectively. diff --git a/docs/02-learn/03-core-concepts/02-node/04-storage.mdx b/docs/02-learn/03-core-concepts/02-node/04-storage.mdx index 38c27d83..c02d73d8 100644 --- a/docs/02-learn/03-core-concepts/02-node/04-storage.mdx +++ b/docs/02-learn/03-core-concepts/02-node/04-storage.mdx @@ -3,20 +3,44 @@ id: storage title: Storage --- -The storage component in the Calimero Network is essential for managing and maintaining the data generated and utilized by decentralized applications (DApps). It ensures data integrity, security, and efficient access, enabling seamless operation of applications within the network. +The storage component in the Calimero Network is essential for managing and +maintaining the data generated and utilized by decentralized applications +(DApps). It ensures data integrity, security, and efficient access, enabling +seamless operation of applications within the network. ### Core Capabilities -- **Generic Storage Interface**: Calimero provides a flexible storage interface that allows app developers to choose their preferred database. By default, Calimero uses RocksDB, but it can also support LevelDB, Sled, TigerBeetle, SQLite, or even cloud storage solutions like S3. - -- **Context State Storage**: The context state is backed by a Patricia-Trie structure flattened into the key-value map of the datastore. This structure ensures efficient state management and retrieval. - -- **Data Blobs**: The storage system handles non-state-transitional, encrypted blobs of data, similar to BitTorrent or IPFS. Nodes can lazily share these data blobs without needing centralized storage, ensuring efficient and secure data distribution across the network. By default, the blobstore is the local filesystem, but it can be configured to use any cloud storage option or content-addressed storage like IPFS. - -- **Data Encryption**: All data stored within the network is encrypted at rest, ensuring that sensitive information remains protected. This includes both state-transitional data and non-state-transitional data like attached files in DMs or collaborative document assets. - -- **Efficient Data Operations**: The storage component is optimized for quick data operations, ensuring that applications can access, retrieve, and update the data they need promptly. Caching mechanisms are employed to further improve data access speeds. - -- **Garbage Collection**: The system includes mechanisms for garbage collection using reference counting for trie data, allowing for the cleanup of obsolete or redundant data. This helps in maintaining optimal storage performance and resource utilization. - -- **Metrics and Monitoring**: The storage component provides detailed metrics on storage usage, including total usage and breakdowns by context. This allows for effective monitoring and management of storage resources. +- **Generic Storage Interface**: Calimero provides a flexible storage interface + that allows app developers to choose their preferred database. By default, + Calimero uses RocksDB, but it can also support LevelDB, Sled, TigerBeetle, + SQLite, or even cloud storage solutions like S3. + +- **Context State Storage**: The context state is backed by a Patricia-Trie + structure flattened into the key-value map of the datastore. This structure + ensures efficient state management and retrieval. + +- **Data Blobs**: The storage system handles non-state-transitional, encrypted + blobs of data, similar to BitTorrent or IPFS. Nodes can lazily share these + data blobs without needing centralized storage, ensuring efficient and secure + data distribution across the network. By default, the blobstore is the local + filesystem, but it can be configured to use any cloud storage option or + content-addressed storage like IPFS. + +- **Data Encryption**: All data stored within the network is encrypted at rest, + ensuring that sensitive information remains protected. This includes both + state-transitional data and non-state-transitional data like attached files in + DMs or collaborative document assets. + +- **Efficient Data Operations**: The storage component is optimized for quick + data operations, ensuring that applications can access, retrieve, and update + the data they need promptly. Caching mechanisms are employed to further + improve data access speeds. + +- **Garbage Collection**: The system includes mechanisms for garbage collection + using reference counting for trie data, allowing for the cleanup of obsolete + or redundant data. This helps in maintaining optimal storage performance and + resource utilization. + +- **Metrics and Monitoring**: The storage component provides detailed metrics on + storage usage, including total usage and breakdowns by context. This allows + for effective monitoring and management of storage resources. diff --git a/docs/02-learn/03-core-concepts/02-node/05-network.mdx b/docs/02-learn/03-core-concepts/02-node/05-network.mdx index fe5a3e11..b3c502f0 100644 --- a/docs/02-learn/03-core-concepts/02-node/05-network.mdx +++ b/docs/02-learn/03-core-concepts/02-node/05-network.mdx @@ -1,20 +1,25 @@ --- - id: network title: Network --- ## Overview -This document provides an overview of the networking component of Calimero Network, which is implemented using the `libp2p` library. The network consists of two types of peers: client nodes and boot nodes, each serving distinct roles and utilizing specific protocols to facilitate peer-to-peer communication. -Client node is the component which hosts and runs client applications, communicates and shares data between other client nodes. -Boot node is the component used for the initial discovery of the peers in the network. +This document provides an overview of the networking component of Calimero +Network, which is implemented using the `libp2p` library. The network consists +of two types of peers: client nodes and boot nodes, each serving distinct roles +and utilizing specific protocols to facilitate peer-to-peer communication. +Client node is the component which hosts and runs client applications, +communicates and shares data between other client nodes. Boot node is the +component used for the initial discovery of the peers in the network. ## Node Types ### Client Node + - **Deployment:** Can run on any machine - **Protocols Utilized:** + - [dcutr](#dcutr-direct-connection-upgrade-through-relay) - [gossipsub](#gossipsub) - [identify](#identify) @@ -27,15 +32,40 @@ Boot node is the component used for the initial discovery of the peers in the ne - **Behavior:** - **Configuration:** A client node can be configured to use zero boot nodes. - **External Address:** - - **Direct Public External Address:** Nodes with a direct public external address do not require reservation at the relay server. These nodes publish their public external address to the Kademlia DHT, making them directly accessible to other peers. - - **Relayed External Address:** Nodes that do not have a direct public external address, typically those behind a NAT or firewall, can obtain a relayed external address by requesting a reservation at a relay server. Once the reservation is accepted, the node publishes its new external address to the rendezvous server. This allows other nodes to discover relayed addresses of a peers in a certain rendezvous namespace. The relay server can be used for the coordination of the hole punching between two nodes. If the hole punching attempt fails, the relay server will bridge the traffic. + - **Direct Public External Address:** Nodes with a direct public external + address do not require reservation at the relay server. These nodes + publish their public external address to the Kademlia DHT, making them + directly accessible to other peers. + - **Relayed External Address:** Nodes that do not have a direct public + external address, typically those behind a NAT or firewall, can obtain a + relayed external address by requesting a reservation at a relay server. + Once the reservation is accepted, the node publishes its new external + address to the rendezvous server. This allows other nodes to discover + relayed addresses of a peers in a certain rendezvous namespace. The relay + server can be used for the coordination of the hole punching between two + nodes. If the hole punching attempt fails, the relay server will bridge + the traffic. - **Discovery Protocols:** `mDNS`, `rendezvous` and `Kademlia` - - **Connection Management:** A peer, identified via PeerId, can be discovered either via mDNS, rendezvous or Kademlia. mDNS discovery provides local network addresses, rendezvous discovery provides relayed addresses, and Kademlia discovery provides direct public external addresses. The node maintains information about its connections to peers, including the discovery source. For a discovered external address, either relayed or direct public, the node will only attempt to dial the peer if the same peer is not already connected via a discovered local address. This ensures that local connections have higher priority and that there are no unnecessary hole punching attempts. - - **Message Relaying:** The node participates in the `gossipsub` protocol, relaying messages to all connected peers that support it. This enables efficient and scalable message dissemination across the network. + - **Connection Management:** A peer, identified via PeerId, can be discovered + either via mDNS, rendezvous or Kademlia. mDNS discovery provides local + network addresses, rendezvous discovery provides relayed addresses, and + Kademlia discovery provides direct public external addresses. The node + maintains information about its connections to peers, including the + discovery source. For a discovered external address, either relayed or + direct public, the node will only attempt to dial the peer if the same peer + is not already connected via a discovered local address. This ensures that + local connections have higher priority and that there are no unnecessary + hole punching attempts. + - **Message Relaying:** The node participates in the `gossipsub` protocol, + relaying messages to all connected peers that support it. This enables + efficient and scalable message dissemination across the network. ### Boot Node -- **Deployment:** Must run on a publicly available machine with a static IP address. + +- **Deployment:** Must run on a publicly available machine with a static IP + address. - **Protocols Utilized:** + - [identify](#identify) - [kad](#kademlia-kad) - [ping](#ping) @@ -43,59 +73,125 @@ Boot node is the component used for the initial discovery of the peers in the ne - [relay](#relay) - **Behavior:** - - **Characteristics:** Boot nodes are publicly available, long-running nodes that provide stable entry points to the network. + - **Characteristics:** Boot nodes are publicly available, long-running nodes + that provide stable entry points to the network. - **Functions:** - - **Bootstrap Node:** Acts as a well-known peer for the Kademlia protocol, facilitating peer discovery and network join operations. - - **Circuit Relay Server:** Serves as a generic relay that provides the medium that facilitates the hole punching, enabling peers to establish direct connections even when they are behind NAT or firewalls. The relay server is used for the coordination of the hole punching between two nodes, and briding traffic if the hole punching attempt fails. - - **Rendezvous Server:** Facilitates peer discovery by allowing nodes to register their presence and query for other peers within a shared rendezvous namespace. This enables dynamic and efficient peer-to-peer connections without relying on a static list of peers. + - **Bootstrap Node:** Acts as a well-known peer for the Kademlia protocol, + facilitating peer discovery and network join operations. + - **Circuit Relay Server:** Serves as a generic relay that provides the + medium that facilitates the hole punching, enabling peers to establish + direct connections even when they are behind NAT or firewalls. The relay + server is used for the coordination of the hole punching between two + nodes, and briding traffic if the hole punching attempt fails. + - **Rendezvous Server:** Facilitates peer discovery by allowing nodes to + register their presence and query for other peers within a shared + rendezvous namespace. This enables dynamic and efficient peer-to-peer + connections without relying on a static list of peers. ## P2P protocols and techniques ### Protocol Descriptions #### DCUtR (Direct Connection Upgrade through Relay) -- DCUtR is used to upgrade connections through relay nodes, allowing peers to establish direct connections even if they are behind NATs or firewalls. Peers initially connect via a relay node, then use the DCUtR protocol to attempt a direct connection, which reduces latency and bandwidth usage. -- **Reference:** [libp2p DCUtR Documentation](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md) + +- DCUtR is used to upgrade connections through relay nodes, allowing peers to + establish direct connections even if they are behind NATs or firewalls. Peers + initially connect via a relay node, then use the DCUtR protocol to attempt a + direct connection, which reduces latency and bandwidth usage. +- **Reference:** + [libp2p DCUtR Documentation](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md) #### Gossipsub -- Gossipsub is a scalable and efficient pub-sub protocol for message dissemination. It combines the best aspects of gossip protocols and topic-based pub-sub systems. It minimizes bandwidth usage by only gossiping metadata and ensuring that messages are only sent once per peer. -- **Reference:** [libp2p Gossipsub Documentation](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub) + +- Gossipsub is a scalable and efficient pub-sub protocol for message + dissemination. It combines the best aspects of gossip protocols and + topic-based pub-sub systems. It minimizes bandwidth usage by only gossiping + metadata and ensuring that messages are only sent once per peer. +- **Reference:** + [libp2p Gossipsub Documentation](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub) #### Identify -- The Identify protocol allows peers to identify themselves and share their capabilities with other peers. Peers exchange identification information such as supported protocols, listen addresses, and public keys. This helps peers make informed decisions about connecting and interacting. -- **Reference:** [libp2p Identify Documentation](https://github.com/libp2p/specs/blob/master/identify/README.md) + +- The Identify protocol allows peers to identify themselves and share their + capabilities with other peers. Peers exchange identification information such + as supported protocols, listen addresses, and public keys. This helps peers + make informed decisions about connecting and interacting. +- **Reference:** + [libp2p Identify Documentation](https://github.com/libp2p/specs/blob/master/identify/README.md) #### Kademlia (Kad) -- Kademlia is a distributed hash table (DHT) protocol used for peer discovery and data routing. It uses an XOR metric to ensure efficient and scalable peer lookup. Each node maintains a routing table with information about other nodes, facilitating quick lookups and robust network operation. -- **Reference:** [libp2p Kademlia DHT Documentation](https://github.com/libp2p/specs/tree/master/kad-dht) + +- Kademlia is a distributed hash table (DHT) protocol used for peer discovery + and data routing. It uses an XOR metric to ensure efficient and scalable peer + lookup. Each node maintains a routing table with information about other + nodes, facilitating quick lookups and robust network operation. +- **Reference:** + [libp2p Kademlia DHT Documentation](https://github.com/libp2p/specs/tree/master/kad-dht) #### mDNS (Multicast DNS) -- mDNS enables local network peer discovery without the need for a central server. It uses multicast DNS to allow peers to find each other on the same local network by broadcasting their presence and listening for broadcasts from other peers. -- **Reference:** [libp2p mDNS Documentation](https://github.com/libp2p/specs/tree/master/discovery/mdns) + +- mDNS enables local network peer discovery without the need for a central + server. It uses multicast DNS to allow peers to find each other on the same + local network by broadcasting their presence and listening for broadcasts from + other peers. +- **Reference:** + [libp2p mDNS Documentation](https://github.com/libp2p/specs/tree/master/discovery/mdns) #### Ping -- The Ping protocol measures the round-trip time (latency) between peers. It regularly pings connected peers and measures the time it takes for a response. This helps in maintaining healthy connections and understanding network latency. -- **Reference:** [libp2p Ping Documentation](https://github.com/libp2p/go-libp2p-ping) + +- The Ping protocol measures the round-trip time (latency) between peers. It + regularly pings connected peers and measures the time it takes for a response. + This helps in maintaining healthy connections and understanding network + latency. +- **Reference:** + [libp2p Ping Documentation](https://github.com/libp2p/go-libp2p-ping) #### Relay -- The Relay protocol supports relay-based communication, allowing peers to communicate through intermediary nodes when direct connections are not possible. Nodes can use relay nodes to forward their traffic, which is especially useful for nodes behind NATs or firewalls. The protocol includes mechanisms for reserving relay slots and managing relay connections. -- **Reference:** [libp2p Relay Documentation](https://github.com/libp2p/specs/tree/master/relay) + +- The Relay protocol supports relay-based communication, allowing peers to + communicate through intermediary nodes when direct connections are not + possible. Nodes can use relay nodes to forward their traffic, which is + especially useful for nodes behind NATs or firewalls. The protocol includes + mechanisms for reserving relay slots and managing relay connections. +- **Reference:** + [libp2p Relay Documentation](https://github.com/libp2p/specs/tree/master/relay) #### Rendezvous -- The Rendezvous protocol enables peers to discover each other by registering at and querying a shared rendezvous point. This is useful for dynamically finding peers without needing a central directory or pre-established list of peers. Peers register their presence at a rendezvous server and can also query the server to find other peers. -- **Reference:** [libp2p Rendezvous Documentation](https://github.com/libp2p/specs/tree/master/rendezvous) + +- The Rendezvous protocol enables peers to discover each other by registering at + and querying a shared rendezvous point. This is useful for dynamically finding + peers without needing a central directory or pre-established list of peers. + Peers register their presence at a rendezvous server and can also query the + server to find other peers. +- **Reference:** + [libp2p Rendezvous Documentation](https://github.com/libp2p/specs/tree/master/rendezvous) ### NAT Traversal Techniques -One of the common techniques used for NAT traversal in P2P networks is **Hole Punching**. This technique allows two peers, each behind a NAT, to establish a direct connection with each other. Here's a brief explanation: +One of the common techniques used for NAT traversal in P2P networks is **Hole +Punching**. This technique allows two peers, each behind a NAT, to establish a +direct connection with each other. Here's a brief explanation: - **Hole Punching:** This technique involves three steps: - - **Step 1 - Connection to Public Server:** Both peers initially connect to a public server (in this case, the relay server). This creates a NAT mapping (a "hole") for outgoing packets to the server. - - **Step 2 - Exchange of Address Information:** The server shares the public address information of each peer with the other. This information includes the IP address and port number that the NAT has assigned for the connection to the server. - - **Step 3 - Direct Connection:** Each peer sends a packet to the other peer's public address. Since a mapping for this address already exists in the NAT (from the connection to the server), the NAT forwards the packet to the appropriate internal address, and a direct connection is established. - -This technique is particularly useful in P2P networks, as it allows peers to communicate directly, reducing the load on relay servers and improving network efficiency. However, it's worth noting that hole punching may not work with all types of NATs, and success can depend on the specific NAT implementation and configuration. - -- **Reference:** [Hole punching in libp2p](https://blog.ipfs.tech/2022-01-20-libp2p-hole-punching/) -- **Reference:** [How NAT traversal works](https://tailscale.com/blog/how-nat-traversal-works) - + - **Step 1 - Connection to Public Server:** Both peers initially connect to a + public server (in this case, the relay server). This creates a NAT mapping + (a "hole") for outgoing packets to the server. + - **Step 2 - Exchange of Address Information:** The server shares the public + address information of each peer with the other. This information includes + the IP address and port number that the NAT has assigned for the connection + to the server. + - **Step 3 - Direct Connection:** Each peer sends a packet to the other peer's + public address. Since a mapping for this address already exists in the NAT + (from the connection to the server), the NAT forwards the packet to the + appropriate internal address, and a direct connection is established. + +This technique is particularly useful in P2P networks, as it allows peers to +communicate directly, reducing the load on relay servers and improving network +efficiency. However, it's worth noting that hole punching may not work with all +types of NATs, and success can depend on the specific NAT implementation and +configuration. + +- **Reference:** + [Hole punching in libp2p](https://blog.ipfs.tech/2022-01-20-libp2p-hole-punching/) +- **Reference:** + [How NAT traversal works](https://tailscale.com/blog/how-nat-traversal-works) diff --git a/docs/02-learn/03-core-concepts/02-node/admin-api.mdx b/docs/02-learn/03-core-concepts/02-node/admin-api.mdx index 10d2458b..c70d2168 100644 --- a/docs/02-learn/03-core-concepts/02-node/admin-api.mdx +++ b/docs/02-learn/03-core-concepts/02-node/admin-api.mdx @@ -5,9 +5,11 @@ title: Admin Client API ### About Admin Client API -Our Admin Client API offers a comprehensive set of endpoints designed to facilitate the management and administration of the node states. -With intuitive routes and robust handlers, administrators can seamlessly navigate various node operations with ease and efficiency. -The Admin Client API, paired with the **Admin UI** — a web application, is your go-to tool for managing node states, +Our Admin Client API offers a comprehensive set of endpoints designed to +facilitate the management and administration of the node states. With intuitive +routes and robust handlers, administrators can seamlessly navigate various node +operations with ease and efficiency. The Admin Client API, paired with the +**Admin UI** — a web application, is your go-to tool for managing node states, simplifying interactions with the server. The Admin API empowers you to: @@ -18,31 +20,46 @@ The Admin API empowers you to: - Fetch decentralized identifiers (DID) - Manage client keys -In essence, the Admin API simplifies node management, while the Admin UI offers an intuitive interface for seamless control. +In essence, the Admin API simplifies node management, while the Admin UI offers +an intuitive interface for seamless control. ### How to Use -To utilize the Admin API endpoints effectively, the recommended approach is to leverage the **Admin UI web application**. The Admin UI automates various steps involved in interacting with the Admin API, ensuring seamless integration and providing the best user experience. +To utilize the Admin API endpoints effectively, the recommended approach is to +leverage the **Admin UI web application**. The Admin UI automates various steps +involved in interacting with the Admin API, ensuring seamless integration and +providing the best user experience. -By using the Admin UI, administrators can streamline their workflow, access essential functionalities with ease, and benefit from intuitive visualizations and controls. This approach not only simplifies the management of decentralized networks but also ensures that administrators have access to the best options and features available. +By using the Admin UI, administrators can streamline their workflow, access +essential functionalities with ease, and benefit from intuitive visualizations +and controls. This approach not only simplifies the management of decentralized +networks but also ensures that administrators have access to the best options +and features available. ### API Endpoints -1. **Root Key Request** - This endpoint allows administrators to add root keys for secure authentication and access control within the decentralized network environment. - Validation Challenge Generation +1. **Root Key Request** - This endpoint allows administrators to add root keys + for secure authentication and access control within the decentralized network + environment. Validation Challenge Generation - **Pre requirements** - Before calling "Root Key Request" endpoint, it is essential to first call the "/request-challenge" endpoint. This step is necessary as the "Root Key Request" endpoint requires a challenge to be passed and verified during the process of adding the root key + **Pre requirements** - Before calling "Root Key Request" endpoint, it is + essential to first call the "/request-challenge" endpoint. This step is + necessary as the "Root Key Request" endpoint requires a challenge to be + passed and verified during the process of adding the root key **POST** `/root-key` **Parameters**: - `accountId` : The account identifier associated with the request. - - `signature` : The signature generated by signing the challenge and message with the wallet. + - `signature` : The signature generated by signing the challenge and message + with the wallet. - `publicKey` : The public key used for verification. - `callbackUrl` : The URL to which the response callback should be sent. - Note: The parameters for this POST request, including accountId, signature, and publicKey, are generated by signing the challenge and message with the wallet. + Note: The parameters for this POST request, including accountId, signature, + and publicKey, are generated by signing the challenge and message with the + wallet. **Example call with curl** @@ -62,7 +79,9 @@ By using the Admin UI, administrators can streamline their workflow, access esse { error: "Failed to add root key: " } ``` -2. **Request authentication challenge** - Administrators can utilize this endpoint to generate validation challenges, enabling users to authenticate their identity via wallet signatures for enhanced security measures. +2. **Request authentication challenge** - Administrators can utilize this + endpoint to generate validation challenges, enabling users to authenticate + their identity via wallet signatures for enhanced security measures. **POST** `/request-challenge` @@ -81,7 +100,9 @@ By using the Admin UI, administrators can streamline their workflow, access esse { error: "Failed to fetch challenge: " } ``` -3. **Install Application** - This endpoint facilitates the installation of new applications on the node, expanding the functionality and capabilities of the decentralized network ecosystem. +3. **Install Application** - This endpoint facilitates the installation of new + applications on the node, expanding the functionality and capabilities of the + decentralized network ecosystem. **POST** `/install-application` @@ -108,7 +129,9 @@ By using the Admin UI, administrators can streamline their workflow, access esse { error: "Failed to install application: " } ``` -4. **List installed Application** - This endpoint returns a list of installed applications, providing valuable insights into the current state of the decentralized network ecosystem +4. **List installed Application** - This endpoint returns a list of installed + applications, providing valuable insights into the current state of the + decentralized network ecosystem **GET** `/applications` @@ -133,7 +156,9 @@ By using the Admin UI, administrators can streamline their workflow, access esse { error: "Failed to fetch installed applications: " } ``` -5. **Add Client Key** - Administrators can add new client keys via this endpoint, enabling seamless access and authentication for authorized users within the network. +5. **Add Client Key** - Administrators can add new client keys via this + endpoint, enabling seamless access and authentication for authorized users + within the network. **POST** `/add-client-key` @@ -141,7 +166,8 @@ By using the Admin UI, administrators can streamline their workflow, access esse - `wallet_signature` : Signature generated with the wallet - `payload` : Reqest payload containing message and metadata - - `wallet_metadata` : Crypto wallet metadata containing information for wallet_type and signing_key + - `wallet_metadata` : Crypto wallet metadata containing information for + wallet_type and signing_key **Example call with curl** @@ -161,7 +187,9 @@ By using the Admin UI, administrators can streamline their workflow, access esse { error: "Failed to add client key: " } ``` -6. **Get the DID** - Fetches the Decentralized Identifier (DID) associated with the node, providing a unique identifier for network entities and enabling interoperability across decentralized applications. +6. **Get the DID** - Fetches the Decentralized Identifier (DID) associated with + the node, providing a unique identifier for network entities and enabling + interoperability across decentralized applications. **GET** `/did` diff --git a/docs/02-learn/03-core-concepts/03-applications.mdx b/docs/02-learn/03-core-concepts/03-applications.mdx index e9a5fd57..eeeffe06 100644 --- a/docs/02-learn/03-core-concepts/03-applications.mdx +++ b/docs/02-learn/03-core-concepts/03-applications.mdx @@ -3,46 +3,86 @@ id: applications title: Applications --- -Applications in Calimero define the core logic governing how peers interact within a decentralized network. Developers can programmatically augment the protocol to create customized functionalities, supporting a wide range of applications tailored to various use cases, from direct messaging and communication channels to interactive games and collaborative editing. +Applications in Calimero define the core logic governing how peers interact +within a decentralized network. Developers can programmatically augment the +protocol to create customized functionalities, supporting a wide range of +applications tailored to various use cases, from direct messaging and +communication channels to interactive games and collaborative editing. ### Examples of Applications 1. **Communication Platforms** - - **Direct Messages and Channels**: Support for private, encrypted messaging between users and group communications in shared, secure spaces. This setup can scale from one-on-one conversations to large group discussions, similar to Slack channels or Discord communities. - - **Community Platforms**: Decentralized alternatives to platforms like Reddit or Hacker News, enabling independent contexts for different purposes, fostering discussions, and sharing content securely. + + - **Direct Messages and Channels**: Support for private, encrypted messaging + between users and group communications in shared, secure spaces. This setup + can scale from one-on-one conversations to large group discussions, similar + to Slack channels or Discord communities. + - **Community Platforms**: Decentralized alternatives to platforms like + Reddit or Hacker News, enabling independent contexts for different + purposes, fostering discussions, and sharing content securely. 2. **Interactive Games** - - **Privacy-Focused Games**: These games require the privacy of each player's moves until both have played, ensuring fair play and maintaining the confidentiality of strategies. Examples include: - - **Rock-Paper-Scissors**: Players' choices are revealed simultaneously after both have made their moves. - - **Battleship**: The positions of ships are kept secret until revealed through gameplay. - - **Non-Privacy Games**: These games do not require concealment of moves and allow all actions to be visible to both players. Examples include: - - **Chess**: A strategy game where all moves are visible to both players, with game logic running locally. - - **Checkers**: Another strategy game where all moves are open and visible to both players. + - **Privacy-Focused Games**: These games require the privacy of each player's + moves until both have played, ensuring fair play and maintaining the + confidentiality of strategies. Examples include: + + - **Rock-Paper-Scissors**: Players' choices are revealed simultaneously + after both have made their moves. + - **Battleship**: The positions of ships are kept secret until revealed + through gameplay. + + - **Non-Privacy Games**: These games do not require concealment of moves and + allow all actions to be visible to both players. Examples include: + - **Chess**: A strategy game where all moves are visible to both players, + with game logic running locally. + - **Checkers**: Another strategy game where all moves are open and visible + to both players. 3. **Collaborative Work** - - **Document Collaboration**: Real-time collaboration on documents, akin to Google Docs, but decentralized and secure. - - **Creative Projects**: Shared canvases or environments for drawing, designing, or working on various creative projects, where all contributions are securely encrypted. + - **Document Collaboration**: Real-time collaboration on documents, akin to + Google Docs, but decentralized and secure. + - **Creative Projects**: Shared canvases or environments for drawing, + designing, or working on various creative projects, where all contributions + are securely encrypted. ### Benefits of Decentralized Applications -- **Resilience**: Distributed application logic ensures the system functions smoothly even if some devices go offline. -- **Autonomy**: Users control their data and activities without relying on a central authority. -- **Scalability**: The system scales effectively as more users join due to optimistic execution, with state being conflict-free and eventually reconciled. -- **Privacy**: Keeping data local and encrypted prevents exposure to third parties, crucial for sensitive information. +- **Resilience**: Distributed application logic ensures the system functions + smoothly even if some devices go offline. +- **Autonomy**: Users control their data and activities without relying on a + central authority. +- **Scalability**: The system scales effectively as more users join due to + optimistic execution, with state being conflict-free and eventually + reconciled. +- **Privacy**: Keeping data local and encrypted prevents exposure to third + parties, crucial for sensitive information. ### Security and Data Management -All non-state-transitional data, such as attached files in DMs, collaborative document assets, and game resources, inherit the same level of security as state-transitional transactions. This ensures that all forms of data within the Calimero network are encrypted and secure. +All non-state-transitional data, such as attached files in DMs, collaborative +document assets, and game resources, inherit the same level of security as +state-transitional transactions. This ensures that all forms of data within the +Calimero network are encrypted and secure. -Calimero also functions as a decentralized filesystem for these non-state-transitional, encrypted blobs of data. Similar to BitTorrent or IPFS, nodes can lazily share the data without needing any centralized storage options. This decentralized approach allows for efficient and secure data distribution across the network. +Calimero also functions as a decentralized filesystem for these +non-state-transitional, encrypted blobs of data. Similar to BitTorrent or IPFS, +nodes can lazily share the data without needing any centralized storage options. +This decentralized approach allows for efficient and secure data distribution +across the network. ### Building Applications -Developers can leverage Calimero's framework to programmatically build and augment a wide range of applications using provided tools and documentation. This includes setting up the development environment and deploying applications within the network. +Developers can leverage Calimero's framework to programmatically build and +augment a wide range of applications using provided tools and documentation. +This includes setting up the development environment and deploying applications +within the network. -1. **Development Tools** - Calimero offers the Rust SDK and intuitive APIs, enabling developers to create applications that integrate seamlessly with the network. +1. **Development Tools** Calimero offers the Rust SDK and intuitive APIs, + enabling developers to create applications that integrate seamlessly with the + network. -2. **Documentation and Support** - Comprehensive documentation and community support assist developers in every step of the application development process, ensuring that they can build and deploy high-quality, secure applications efficiently. +2. **Documentation and Support** Comprehensive documentation and community + support assist developers in every step of the application development + process, ensuring that they can build and deploy high-quality, secure + applications efficiently. diff --git a/docs/02-learn/03-core-concepts/04-context.mdx b/docs/02-learn/03-core-concepts/04-context.mdx index 17d6a381..819a56b8 100644 --- a/docs/02-learn/03-core-concepts/04-context.mdx +++ b/docs/02-learn/03-core-concepts/04-context.mdx @@ -3,23 +3,60 @@ id: contexts title: Contexts --- - -Contexts are the core of the Calimero ecosystem. These are application specific networks designed to enable direct communication between users, eliminating the need for intermediaries. Here's a closer look at how they operate: +Contexts are the core of the Calimero ecosystem. These are application specific +networks designed to enable direct communication between users, eliminating the +need for intermediaries. Here's a closer look at how they operate: #### **How Contexts Work:** -1. **Initialization**: A user selects a WebAssembly (WASM) module from a repository, which contains the logic and rules for the application. With this, they initiate a new Application Network, creating a unique identity for this specific network and setting the initial parameters and update strategies. +1. **Initialization**: A user selects a WebAssembly (WASM) module from a + repository, which contains the logic and rules for the application. With + this, they initiate a new Application Network, creating a unique identity for + this specific network and setting the initial parameters and update + strategies. 2. **Joining the Network**: - - **Inviting Peers**: The initial user can invite others directly or set up Access Control Lists (ACLs) to govern how new members can join the network. - - **New Member Process**: When a new user joins, they generate a unique identity for the network, download the relevant WASM module, and synchronize with the existing data on the network. This process ensures they're up to speed and ready to engage fully with the network's activities. - -3. **Data Interaction**: Within the network, users can query and modify data according to the application's rules. Each Application Network autonomously manages data interactions, ensuring consistency and integrity. - -4. **Security and Privacy**: All communications within an Application Network are secured with end-to-end encryption, utilizing the Double Ratchet Algorithm. This ensures that data exchanged between peers remains private and secure. - -5. **Offline Capability and Consistency**: Calimero's design is 'offline-first,' accommodating the reality that peers may not always be online. When a peer goes offline and later returns, they synchronize with the network to update and reconcile any changes, maintaining eventual consistency across the network's state. - -6. **Governance and Updates**: Application Networks can be governed by the users themselves, with decisions made through a consensus mechanism. Updates to the network, including changes to the WASM module or network parameters, can be proposed and voted on by the network's members. -7. **Extending network capabilities**: In addition to the core components of Application Networks, Calimero introduces Specialized Nodes to further enhance network capabilities. These nodes are designed to perform specific functions that go beyond the standard operations of client nodes, such as heavy data processing, advanced encryption tasks, or providing additional storage solutions. They play a crucial role in scaling the network's functionality and performance, ensuring that even as demand grows, the network remains efficient and responsive. Specialized Nodes can be deployed by any participant in the network, including Calimero, third-party developers, or users themselves, offering a flexible and decentralized approach to augmenting the network's capabilities. By leveraging these nodes, Application Networks can meet the diverse needs of different applications, ensuring that each network can be customized and optimized for its unique requirements, all while maintaining the overarching principles of privacy, security, and decentralization inherent to Calimero. + - **Inviting Peers**: The initial user can invite others directly or set up + Access Control Lists (ACLs) to govern how new members can join the network. + - **New Member Process**: When a new user joins, they generate a unique + identity for the network, download the relevant WASM module, and + synchronize with the existing data on the network. This process ensures + they're up to speed and ready to engage fully with the network's + activities. + +3. **Data Interaction**: Within the network, users can query and modify data + according to the application's rules. Each Application Network autonomously + manages data interactions, ensuring consistency and integrity. + +4. **Security and Privacy**: All communications within an Application Network + are secured with end-to-end encryption, utilizing the Double Ratchet + Algorithm. This ensures that data exchanged between peers remains private and + secure. + +5. **Offline Capability and Consistency**: Calimero's design is 'offline-first,' + accommodating the reality that peers may not always be online. When a peer + goes offline and later returns, they synchronize with the network to update + and reconcile any changes, maintaining eventual consistency across the + network's state. + +6. **Governance and Updates**: Application Networks can be governed by the users + themselves, with decisions made through a consensus mechanism. Updates to the + network, including changes to the WASM module or network parameters, can be + proposed and voted on by the network's members. + +7. **Extending network capabilities**: In addition to the core components of + Application Networks, Calimero introduces Specialized Nodes to further + enhance network capabilities. These nodes are designed to perform specific + functions that go beyond the standard operations of client nodes, such as + heavy data processing, advanced encryption tasks, or providing additional + storage solutions. They play a crucial role in scaling the network's + functionality and performance, ensuring that even as demand grows, the + network remains efficient and responsive. Specialized Nodes can be deployed + by any participant in the network, including Calimero, third-party + developers, or users themselves, offering a flexible and decentralized + approach to augmenting the network's capabilities. By leveraging these nodes, + Application Networks can meet the diverse needs of different applications, + ensuring that each network can be customized and optimized for its unique + requirements, all while maintaining the overarching principles of privacy, + security, and decentralization inherent to Calimero. diff --git a/docs/02-learn/04-advanced-concepts/01-specialized-nodes.mdx b/docs/02-learn/04-advanced-concepts/01-specialized-nodes.mdx index 90b8216c..a22e6857 100644 --- a/docs/02-learn/04-advanced-concepts/01-specialized-nodes.mdx +++ b/docs/02-learn/04-advanced-concepts/01-specialized-nodes.mdx @@ -3,25 +3,50 @@ id: specialized-nodes title: Specialized Nodes --- -Specialized nodes in the Calimero Network are third-party nodes that augment a context's capacity and reliability. They participate in a context but have additional capabilities, providing various services while maintaining the decentralized nature of the network. +Specialized nodes in the Calimero Network are third-party nodes that augment a +context's capacity and reliability. They participate in a context but have +additional capabilities, providing various services while maintaining the +decentralized nature of the network. ### Key Concepts -- **Incentivization**: These nodes can be incentivized through contracts on blockchains that pay them for their services, ensuring they remain motivated to perform their roles effectively. -- **Permissions and Roles**: Specialized nodes can have different levels of permissions, ranging from being subscribed to encrypted network events to fully participating as part of the context. +- **Incentivization**: These nodes can be incentivized through contracts on + blockchains that pay them for their services, ensuring they remain motivated + to perform their roles effectively. +- **Permissions and Roles**: Specialized nodes can have different levels of + permissions, ranging from being subscribed to encrypted network events to + fully participating as part of the context. ### Types of Specialized Nodes 1. **Storage Nodes**: - - **Encrypted Transaction Storage**: These nodes store encrypted transactions without the ability to read them. They guarantee 100% uptime, ensuring that all transactions are available even when peers are offline. When peers come back online, the node provides missed transactions and new transactions for replication. - - **Blob Storage**: These nodes also store encrypted blobs of non-state-transitional data, ensuring that all necessary data is always available without holding decryption keys. + + - **Encrypted Transaction Storage**: These nodes store encrypted transactions + without the ability to read them. They guarantee 100% uptime, ensuring that + all transactions are available even when peers are offline. When peers come + back online, the node provides missed transactions and new transactions for + replication. + - **Blob Storage**: These nodes also store encrypted blobs of + non-state-transitional data, ensuring that all necessary data is always + available without holding decryption keys. 2. **Delegated Execution Nodes**: - - **Context Maintenance**: These nodes fully join a context and maintain the context state on their end. They can handle resource-intensive executions, delegating specific calls to optimize performance and resource utilization. + + - **Context Maintenance**: These nodes fully join a context and maintain the + context state on their end. They can handle resource-intensive executions, + delegating specific calls to optimize performance and resource utilization. 3. **Administrative Nodes**: - - **Event Observation and Action**: These nodes observe real-world events and act on them within the context. For example, in a billionaire's club context, an administrative node could monitor members' accounts on a blockchain and evict them if their balance falls below a certain threshold. + - **Event Observation and Action**: These nodes observe real-world events and + act on them within the context. For example, in a billionaire's club + context, an administrative node could monitor members' accounts on a + blockchain and evict them if their balance falls below a certain threshold. ### Reliability Through Decentralization -Specialized nodes ensure that the context remains operational and consistent, even when primary peers are offline. They provide the necessary data and transactions to keep the context up-to-date. The decentralized nature ensures that the state is eventually consistent. Fragmentation does not cause issues as the system reconciles itself when peers come back online, highlighting the network's reliability without reliance on any single specialized node. +Specialized nodes ensure that the context remains operational and consistent, +even when primary peers are offline. They provide the necessary data and +transactions to keep the context up-to-date. The decentralized nature ensures +that the state is eventually consistent. Fragmentation does not cause issues as +the system reconciles itself when peers come back online, highlighting the +network's reliability without reliance on any single specialized node. diff --git a/docs/02-learn/04-advanced-concepts/02-encryption.mdx b/docs/02-learn/04-advanced-concepts/02-encryption.mdx index 5e09c2ee..51689a00 100644 --- a/docs/02-learn/04-advanced-concepts/02-encryption.mdx +++ b/docs/02-learn/04-advanced-concepts/02-encryption.mdx @@ -3,29 +3,50 @@ id: encryption title: Encryption --- -Encryption in Calimero ensures data security in transit over the network, maintaining confidentiality and integrity. +Encryption in Calimero ensures data security in transit over the network, +maintaining confidentiality and integrity. ### Key Principles -1. **Forward Secrecy**: Ensuring past messages remain secure even if a key is compromised in the future. -2. **Post-Compromise Security**: Ensuring future messages remain secure even after any previous message has been compromised. +1. **Forward Secrecy**: Ensuring past messages remain secure even if a key is + compromised in the future. +2. **Post-Compromise Security**: Ensuring future messages remain secure even + after any previous message has been compromised. 3. **Zero Trust in Third Parties**: No reliance on intermediaries for security. -4. **Verifiable End-to-End Encryption**: Confirming that only the intended recipients can read the messages. -5. **Asynchronous Communication**: Ability to start communications without recipients being online. +4. **Verifiable End-to-End Encryption**: Confirming that only the intended + recipients can read the messages. +5. **Asynchronous Communication**: Ability to start communications without + recipients being online. 6. **Multi-Device Support**: Ensuring seamless use across multiple devices. -7. **Deniability**: Providing plausible deniability for message authorship to non-context members. -8. **Non-Interactive Group Management**: Adding and removing context members without requiring interaction. +7. **Deniability**: Providing plausible deniability for message authorship to + non-context members. +8. **Non-Interactive Group Management**: Adding and removing context members + without requiring interaction. ### Double Ratchet Algorithm -Each network message uses a distinct encryption key derived from the ratchet state, providing forward secrecy by ensuring that the compromise of one key does not affect the security of previous messages. +Each network message uses a distinct encryption key derived from the ratchet +state, providing forward secrecy by ensuring that the compromise of one key does +not affect the security of previous messages. -Each context can configure Diffie-Hellman reset parameters. For one-on-one peer interactions, resets can occur instantaneously, while for larger groups, resets can happen at non-deterministic intervals to balance security and performance. +Each context can configure Diffie-Hellman reset parameters. For one-on-one peer +interactions, resets can occur instantaneously, while for larger groups, resets +can happen at non-deterministic intervals to balance security and performance. ### Tree-Based Diffie-Hellman Key Exchange -All contexts use a tree-based Diffie-Hellman key exchange. This method efficiently manages shared secrets among multiple members, ensuring that keys are updated and propagated correctly. The reset of keys occurs at the leaf nodes of the tree, guaranteeing post-compromise security. - -Adding a new member involves existing members using their prekeys to complete an X3DH (Triple Diffie-Hellman) exchange, securely adding the new member without requiring direct interaction. Removing a member involves invalidating their keys and updating the shared secrets among remaining members, ensuring efficient and secure updates. - -By leveraging advanced encryption techniques such as the Double Ratchet Algorithm and tree-based Diffie-Hellman key exchange, Calimero ensures that all data in transit is protected, maintaining the confidentiality and integrity of network messages. +All contexts use a tree-based Diffie-Hellman key exchange. This method +efficiently manages shared secrets among multiple members, ensuring that keys +are updated and propagated correctly. The reset of keys occurs at the leaf nodes +of the tree, guaranteeing post-compromise security. + +Adding a new member involves existing members using their prekeys to complete an +X3DH (Triple Diffie-Hellman) exchange, securely adding the new member without +requiring direct interaction. Removing a member involves invalidating their keys +and updating the shared secrets among remaining members, ensuring efficient and +secure updates. + +By leveraging advanced encryption techniques such as the Double Ratchet +Algorithm and tree-based Diffie-Hellman key exchange, Calimero ensures that all +data in transit is protected, maintaining the confidentiality and integrity of +network messages. diff --git a/docs/02-learn/04-advanced-concepts/_03-scaling.mdx b/docs/02-learn/04-advanced-concepts/_03-scaling.mdx index b7978c6b..c96a7c18 100644 --- a/docs/02-learn/04-advanced-concepts/_03-scaling.mdx +++ b/docs/02-learn/04-advanced-concepts/_03-scaling.mdx @@ -1,4 +1,4 @@ --- id: scaling title: Scaling ---- \ No newline at end of file +--- diff --git a/docs/02-learn/04-advanced-concepts/_04-state-reconciliation.mdx b/docs/02-learn/04-advanced-concepts/_04-state-reconciliation.mdx index 1ece6b14..ab78ddfd 100644 --- a/docs/02-learn/04-advanced-concepts/_04-state-reconciliation.mdx +++ b/docs/02-learn/04-advanced-concepts/_04-state-reconciliation.mdx @@ -1,4 +1,4 @@ --- id: state-reconciliation title: State Reconciliation ---- \ No newline at end of file +--- diff --git a/docs/02-learn/04-advanced-concepts/_05-data-availability.mdx b/docs/02-learn/04-advanced-concepts/_05-data-availability.mdx index 78e20bf5..31b54b27 100644 --- a/docs/02-learn/04-advanced-concepts/_05-data-availability.mdx +++ b/docs/02-learn/04-advanced-concepts/_05-data-availability.mdx @@ -1,4 +1,4 @@ --- id: data-availability title: Data Availability ---- \ No newline at end of file +--- diff --git a/docs/02-learn/04-advanced-concepts/_06-multichain.mdx b/docs/02-learn/04-advanced-concepts/_06-multichain.mdx index d7777546..66cf1211 100644 --- a/docs/02-learn/04-advanced-concepts/_06-multichain.mdx +++ b/docs/02-learn/04-advanced-concepts/_06-multichain.mdx @@ -1,4 +1,4 @@ --- id: multichain title: Multichain ---- \ No newline at end of file +--- diff --git a/docs/03-getting-started/01-setup.mdx b/docs/03-getting-started/01-setup.mdx index 01b108ee..72ad2c1f 100644 --- a/docs/03-getting-started/01-setup.mdx +++ b/docs/03-getting-started/01-setup.mdx @@ -3,7 +3,8 @@ id: setup title: Setup --- -Before you start, make sure you are familiar with [Calimero Terminology](/learn/terminology). +Before you start, make sure you are familiar with +[Calimero Terminology](/learn/terminology). ## Setup your local node @@ -15,20 +16,23 @@ Clone repository from GitHub. git clone git@github.com:calimero-network/core.git ``` -Position in the root of the project and create a data folder for all configuration files. +Position in the root of the project and create a data folder for all +configuration files. ```bash title="Terminal" $ mkdir data ``` -Make sure you have Rust installed on your machine. If not, you can install it by following the instructions on the [Rust website](https://www.rust-lang.org/tools/install). +Make sure you have Rust installed on your machine. If not, you can install it by +following the instructions on the +[Rust website](https://www.rust-lang.org/tools/install). -> **_NOTE:_** -> Use minimum rust version 1.79.0 +> **_NOTE:_** Use minimum rust version 1.79.0 ### Setup -Setup coordinator node used for managing the network transactions and peer nodes representing the network participants. +Setup coordinator node used for managing the network transactions and peer nodes +representing the network participants. #### Initialize and start coordinator node (separate terminal) @@ -48,4 +52,5 @@ Node is now initialized and ready for use. ### Congratulations on setting up your node! -Your next step is to add an authentication mechanism to your node by adding a decentralized identity. +Your next step is to add an authentication mechanism to your node by adding a +decentralized identity. diff --git a/docs/03-getting-started/02-admin-dashboard.mdx b/docs/03-getting-started/02-admin-dashboard.mdx index a64656ac..d11be578 100644 --- a/docs/03-getting-started/02-admin-dashboard.mdx +++ b/docs/03-getting-started/02-admin-dashboard.mdx @@ -3,19 +3,27 @@ id: admin-dashboard title: Admin Dashboard --- -Node is gated with authentication. In order to interact with the node from any app, you need to register a decentralized identity. -We have build an Admin Dashboard which is a web application designed to streamline the management of node states within your system. Seamlessly connected with the API provided by the Admin Client API, this user interface offers a user-friendly platform for overseeing and controlling various aspects of your node infrastructure. +Node is gated with authentication. In order to interact with the node from any +app, you need to register a decentralized identity. We have build an Admin +Dashboard which is a web application designed to streamline the management of +node states within your system. Seamlessly connected with the API provided by +the Admin Client API, this user interface offers a user-friendly platform for +overseeing and controlling various aspects of your node infrastructure. ### Access Admin Dashboard -Admin Dashboard is published to GitHub pages so you can access it directly from the browser. +Admin Dashboard is published to GitHub pages so you can access it directly from +the browser. -Admin dashboard is available at https://calimero-network.github.io/admin-dashboard/. +Admin dashboard is available at +https://calimero-network.github.io/admin-dashboard/. -> **_NOTE:_** -> Update `NODE_PORT` in the placeholder `http://localhost:NODE_PORT` with the `--server-port` value defined during node setup in [Getting-started](./01-setup.mdx) +> **_NOTE:_** Update `NODE_PORT` in the placeholder `http://localhost:NODE_PORT` +> with the `--server-port` value defined during node setup in +> [Getting-started](./01-setup.mdx) -After the initial setup yourou will see login page. On the first login, your selected wallet will be used as a root key to use further functionalities. +After the initial setup yourou will see login page. On the first login, your +selected wallet will be used as a root key to use further functionalities. ### Admin Dashboard functionalities: @@ -27,18 +35,21 @@ Preview added root keys or add new root key. #### Contexts -Preview context which you have already joined or invited. You can also create a new context. +Preview context which you have already joined or invited. You can also create a +new context. ![Contexts](/admin-dashboard/contexts.png) #### Applications -Preview available applications from other developers or applications you published. You can also publish new application +Preview available applications from other developers or applications you +published. You can also publish new application ![Applications](/admin-dashboard/applications.png) #### Export -Allows you to export you identity on current device and import it on new device so you have seamless experience while onboarding to another device. +Allows you to export you identity on current device and import it on new device +so you have seamless experience while onboarding to another device. ![Export](/admin-dashboard/export-identity.png) diff --git a/docs/03-getting-started/03-example-app.mdx b/docs/03-getting-started/03-example-app.mdx index f2cb468b..a188c779 100644 --- a/docs/03-getting-started/03-example-app.mdx +++ b/docs/03-getting-started/03-example-app.mdx @@ -3,12 +3,14 @@ id: example-app title: Example Application --- -We have created simple and easy to use example application called `only-peers`. Application enables writing posts and leaving comments. -To try out application you need to create new context where application will be installed. +We have created simple and easy to use example application called `only-peers`. +Application enables writing posts and leaving comments. To try out application +you need to create new context where application will be installed. ### Create new context -Navigate back to Admin Dashboard. If you have not started Admin Dashboard, follow the instructions in [Admin Dashboard](./02-admin-dashboard.mdx). +Navigate back to Admin Dashboard. If you have not started Admin Dashboard, +follow the instructions in [Admin Dashboard](./02-admin-dashboard.mdx). - Follow context creation instructions and select `only-peers` app. @@ -20,12 +22,15 @@ You are now part of the context and can start using the application. We have built and deployed a demo app so you can try it out immediately. -Navigate to https://calimero-network.github.io/only-peers-client/ to access app frontend. +Navigate to https://calimero-network.github.io/only-peers-client/ to access app +frontend. -You will be asked to setup the app by the adding the node url. It is the same url you used while starting the node in [Getting-started](./01-setup.mdx) `http://localhost:NODE_PORT` -After setting up node url, you will be asked to login. +You will be asked to setup the app by the adding the node url. It is the same +url you used while starting the node in [Getting-started](./01-setup.mdx) +`http://localhost:NODE_PORT` After setting up node url, you will be asked to +login. -> **_NOTE:_** -> Use your wallet which you have already added as root key in [Admin Dashboard. ](./02-admin-dashboard.mdx) +> **_NOTE:_** Use your wallet which you have already added as root key in +> [Admin Dashboard. ](./02-admin-dashboard.mdx) You are now ready to use the app. Enjoy! diff --git a/docs/03-getting-started/_admin-dashboard-ui.mdx b/docs/03-getting-started/_admin-dashboard-ui.mdx index ca8f1118..24e4a47a 100644 --- a/docs/03-getting-started/_admin-dashboard-ui.mdx +++ b/docs/03-getting-started/_admin-dashboard-ui.mdx @@ -2,25 +2,34 @@ 1. **Login page** - The Login Page initiates the authentication process by calling the /request-challenge endpoint. This endpoint generates a challenge that is then signed along with the user's message using their wallet. + The Login Page initiates the authentication process by calling the + /request-challenge endpoint. This endpoint generates a challenge that is then + signed along with the user's message using their wallet. ![Login Page](/admin-dashboard/login-page.png) 2. **Add root key** - The "Add Root Key" feature facilitates the addition of a root key to the node. This process involves sending parameters such as signature, public key, account ID, and callback URL to the /root-key API endpoint, which is hosted by the Admin API. + The "Add Root Key" feature facilitates the addition of a root key to the + node. This process involves sending parameters such as signature, public key, + account ID, and callback URL to the /root-key API endpoint, which is hosted + by the Admin API. ![Add root key](/admin-dashboard/request-root-key.png) 3. **List installed applications** - The "List Installed Applications" feature provides overview of all installed applications on a node + The "List Installed Applications" feature provides overview of all installed + applications on a node ![List installed application](/admin-dashboard/list-application.png) 4. **Install new application** - The "Install New Application" process involves the user filling out a form to add a new package, uploading the application release WebAssembly (Wasm) file, and then submitting another form to add the new application for installation on the node. + The "Install New Application" process involves the user filling out a form to + add a new package, uploading the application release WebAssembly (Wasm) file, + and then submitting another form to add the new application for installation + on the node. ![Add new application package](/admin-dashboard/add-application-package.png) @@ -34,6 +43,7 @@ 6. **List saved node keys** - The "List saved node keys" feature provides overview of all keys saved on a node + The "List saved node keys" feature provides overview of all keys saved on a + node ![List saved node keys](/admin-dashboard/list-keys.png) diff --git a/docs/03-getting-started/_kv-store.mdx b/docs/03-getting-started/_kv-store.mdx index f580b354..c5104990 100644 --- a/docs/03-getting-started/_kv-store.mdx +++ b/docs/03-getting-started/_kv-store.mdx @@ -6,7 +6,8 @@ Build the application to inspect node local storage. $ ./apps/kv-store/build.sh ``` -All configured node sessions will fall into interactive mode which means you can interact with the node using the command line where node runs. +All configured node sessions will fall into interactive mode which means you can +interact with the node using the command line where node runs. ```console Usage: [call|peers|pool|gc|store] [args] diff --git a/docs/04-build/00-quickstart.mdx b/docs/04-build/00-quickstart.mdx index f4033904..c78f20d2 100644 --- a/docs/04-build/00-quickstart.mdx +++ b/docs/04-build/00-quickstart.mdx @@ -3,7 +3,13 @@ id: quickstart title: Quickstart --- -Welcome to the exciting world of application development in the decentralized space! As a developer, you have the opportunity to build cutting-edge applications using our comprehensive suite of tools. Start by shaping the core application logic with our Protocol SDK and then bring your application to life by crafting intuitive user interfaces with the Client SDK. Join our community of developers and start creating powerful decentralized applications that can make a significant impact in the tech world. +Welcome to the exciting world of application development in the decentralized +space! As a developer, you have the opportunity to build cutting-edge +applications using our comprehensive suite of tools. Start by shaping the core +application logic with our Protocol SDK and then bring your application to life +by crafting intuitive user interfaces with the Client SDK. Join our community of +developers and start creating powerful decentralized applications that can make +a significant impact in the tech world. Application development consists of two main parts: @@ -12,24 +18,45 @@ Application development consists of two main parts: ## Protocol SDK -The Protocol SDK within the Calimero Network equips developers with tools for creating, testing, and deploying protocols essential for decentralized applications (DApps). It features capabilities such as code generation, security enhancement, and interoperability support to ensure robust and efficient DApp operations. This SDK is crucial for integrating with the Calimero Network's components, facilitating seamless updates and versioning critical for DApps in fields like decentralized messaging and finance. +The Protocol SDK within the Calimero Network equips developers with tools for +creating, testing, and deploying protocols essential for decentralized +applications (DApps). It features capabilities such as code generation, security +enhancement, and interoperability support to ensure robust and efficient DApp +operations. This SDK is crucial for integrating with the Calimero Network's +components, facilitating seamless updates and versioning critical for DApps in +fields like decentralized messaging and finance. -Currently we have SDK only for rust but in the future we will have SDKs for other languages as well. +Currently we have SDK only for rust but in the future we will have SDKs for +other languages as well. ## Client SDKs -The Client SDK includes straightforward tools to help you build your application. For logging in, we provide functions that allow users to authenticate using their wallet credentials, which must be set up as root keys in the admin dashboard. This setup ensures that access is both secure and straightforward. For handling data, the SDK supports JSON-RPC for direct data transactions and websockets for live updates. These features are designed to make your development process efficient and effective, allowing you to focus on creating a great user experience. +The Client SDK includes straightforward tools to help you build your +application. For logging in, we provide functions that allow users to +authenticate using their wallet credentials, which must be set up as root keys +in the admin dashboard. This setup ensures that access is both secure and +straightforward. For handling data, the SDK supports JSON-RPC for direct data +transactions and websockets for live updates. These features are designed to +make your development process efficient and effective, allowing you to focus on +creating a great user experience. -Currently we have SDK only for typescript but in the future we will have SDKs for other languages as well. +Currently we have SDK only for typescript but in the future we will have SDKs +for other languages as well. ## Publish app -After you have created your application logic with Rust and your application UI with TypeScript, you can publish your app. Follow instructions in the [Publish App](./03-publish-app.mdx) guide to learn how to publish your app and how users can download and run it. +After you have created your application logic with Rust and your application UI +with TypeScript, you can publish your app. Follow instructions in the +[Publish App](./03-publish-app.mdx) guide to learn how to publish your app and +how users can download and run it. ## Building app from template -We have prepared template repository for you to get started quickly. You can find the template repository [here](https://github.com/calimero-network/core-app-template). -Repository contains two folders, `logic` and `app`. `logic` folder contains the application logic written in Rust and `app` folder contains the application client interface written in TypeScript. +We have prepared template repository for you to get started quickly. You can +find the template repository +[here](https://github.com/calimero-network/core-app-template). Repository +contains two folders, `logic` and `app`. `logic` folder contains the application +logic written in Rust and `app` folder contains the application client interface +written in TypeScript. -> **_NOTE:_** -> Logic is still under development and may not be yet published. +> **_NOTE:_** Logic is still under development and may not be yet published. diff --git a/docs/04-build/01-protocol-sdks/01-protocol-sdk.mdx b/docs/04-build/01-protocol-sdks/01-protocol-sdk.mdx index 115d723a..e30e412b 100644 --- a/docs/04-build/01-protocol-sdks/01-protocol-sdk.mdx +++ b/docs/04-build/01-protocol-sdks/01-protocol-sdk.mdx @@ -3,28 +3,74 @@ id: protocol-sdk title: Protocol SDK --- - -The Protocol SDK within the Calimero Network serves as a foundational tool for developers, enabling them to design, develop, and deploy the specific protocols that govern the operation of their decentralized applications (DApps). This SDK is particularly crucial in a network like Calimero, where privacy, security, and decentralized communication are paramount. Here's an overview of the Protocol SDK, highlighting its features, functionalities, and its role in the development lifecycle of DApps: +The Protocol SDK within the Calimero Network serves as a foundational tool for +developers, enabling them to design, develop, and deploy the specific protocols +that govern the operation of their decentralized applications (DApps). This SDK +is particularly crucial in a network like Calimero, where privacy, security, and +decentralized communication are paramount. Here's an overview of the Protocol +SDK, highlighting its features, functionalities, and its role in the development +lifecycle of DApps: ### Features and Functionalities -- **Protocol Definition**: Allows developers to define the rules and behaviors of their application networks, including communication protocols, data formats, and interaction patterns among nodes. -- **Code Generation**: Automates the generation of boilerplate code required to implement the defined protocols, significantly speeding up the development process and reducing the potential for errors. -- **Interoperability Support**: Facilitates the creation of protocols that can interact with various blockchains and external systems, ensuring that Calimero-based DApps can operate within the broader blockchain ecosystem. -- **Security Focus**: Provides tools and libraries to incorporate advanced security features into protocols, such as end-to-end encryption, secure key management, and privacy-preserving data sharing mechanisms. -- **Performance Optimization**: Includes optimization tools and best practices to ensure that the protocols are efficient in terms of resource usage, suitable for decentralized networks where performance can be a critical concern. + +- **Protocol Definition**: Allows developers to define the rules and behaviors + of their application networks, including communication protocols, data + formats, and interaction patterns among nodes. +- **Code Generation**: Automates the generation of boilerplate code required to + implement the defined protocols, significantly speeding up the development + process and reducing the potential for errors. +- **Interoperability Support**: Facilitates the creation of protocols that can + interact with various blockchains and external systems, ensuring that + Calimero-based DApps can operate within the broader blockchain ecosystem. +- **Security Focus**: Provides tools and libraries to incorporate advanced + security features into protocols, such as end-to-end encryption, secure key + management, and privacy-preserving data sharing mechanisms. +- **Performance Optimization**: Includes optimization tools and best practices + to ensure that the protocols are efficient in terms of resource usage, + suitable for decentralized networks where performance can be a critical + concern. ### Role in DApp Development -- **Protocol Development**: At the core of any DApp on the Calimero Network is a protocol that dictates how the application functions, how nodes within the application's network communicate, and how data is handled and stored. The Protocol SDK is the primary tool for developing these protocols. -- **Testing and Deployment**: The SDK provides an environment for thorough testing of the protocols in simulated conditions before they are deployed on the live network. This ensures that any issues can be identified and resolved in a controlled setting, minimizing risks. -- **Versioning and Updates**: Supports protocol versioning, enabling developers to iterate on their protocols and roll out updates in a structured manner. This is crucial for maintaining compatibility and ensuring the longevity and scalability of DApps. + +- **Protocol Development**: At the core of any DApp on the Calimero Network is a + protocol that dictates how the application functions, how nodes within the + application's network communicate, and how data is handled and stored. The + Protocol SDK is the primary tool for developing these protocols. +- **Testing and Deployment**: The SDK provides an environment for thorough + testing of the protocols in simulated conditions before they are deployed on + the live network. This ensures that any issues can be identified and resolved + in a controlled setting, minimizing risks. +- **Versioning and Updates**: Supports protocol versioning, enabling developers + to iterate on their protocols and roll out updates in a structured manner. + This is crucial for maintaining compatibility and ensuring the longevity and + scalability of DApps. ### Integration with Other Calimero Components -- **Client Nodes**: Protocols developed with the Protocol SDK are deployed on client nodes, which act as the runtime environment for the DApps built on these protocols. -- **Client SDKs**: These SDKs interact with the protocols at a higher level, providing interfaces for end-users to interact with the DApps. The seamless integration between the Protocol SDK and Client SDKs ensures a smooth user experience. -- **Specialized Nodes**: Some protocols may require specialized computational resources or functionalities. The Protocol SDK allows for the integration of these services, enabling DApps to leverage the specialized nodes within the Calimero Network. + +- **Client Nodes**: Protocols developed with the Protocol SDK are deployed on + client nodes, which act as the runtime environment for the DApps built on + these protocols. +- **Client SDKs**: These SDKs interact with the protocols at a higher level, + providing interfaces for end-users to interact with the DApps. The seamless + integration between the Protocol SDK and Client SDKs ensures a smooth user + experience. +- **Specialized Nodes**: Some protocols may require specialized computational + resources or functionalities. The Protocol SDK allows for the integration of + these services, enabling DApps to leverage the specialized nodes within the + Calimero Network. ### Use Cases -- **Decentralized Messaging**: For a messaging app, the Protocol SDK could be used to define the encryption protocols, message delivery mechanisms, and peer discovery protocols. -- **Decentralized Finance (DeFi)**: In a DeFi application, the SDK could define the protocols for executing smart contracts, handling transactions, and interacting with external blockchains for asset transfers. -The Protocol SDK is a critical component of the Calimero Network, empowering developers to build sophisticated, secure, and efficient decentralized applications. By abstracting much of the complexity associated with protocol development, the SDK enables developers to focus on the unique features and functionalities of their DApps, fostering innovation and growth within the Calimero ecosystem. \ No newline at end of file +- **Decentralized Messaging**: For a messaging app, the Protocol SDK could be + used to define the encryption protocols, message delivery mechanisms, and peer + discovery protocols. +- **Decentralized Finance (DeFi)**: In a DeFi application, the SDK could define + the protocols for executing smart contracts, handling transactions, and + interacting with external blockchains for asset transfers. + +The Protocol SDK is a critical component of the Calimero Network, empowering +developers to build sophisticated, secure, and efficient decentralized +applications. By abstracting much of the complexity associated with protocol +development, the SDK enables developers to focus on the unique features and +functionalities of their DApps, fostering innovation and growth within the +Calimero ecosystem. diff --git a/docs/04-build/01-protocol-sdks/02-protocol-rs-sdk.mdx b/docs/04-build/01-protocol-sdks/02-protocol-rs-sdk.mdx index 16e1dc6d..1768f10f 100644 --- a/docs/04-build/01-protocol-sdks/02-protocol-rs-sdk.mdx +++ b/docs/04-build/01-protocol-sdks/02-protocol-rs-sdk.mdx @@ -5,13 +5,19 @@ title: Rust Protocol SDK ## Getting Started with Calimero SDK for Rust -The Calimero SDK for Rust empowers developers to build applications that compile to WebAssembly (Wasm) and run securely within the Calimero virtual machine (VM). This guide will walk you through setting up a Rust project using the Calimero SDK, writing an application, and preparing it for deployment. +The Calimero SDK for Rust empowers developers to build applications that compile +to WebAssembly (Wasm) and run securely within the Calimero virtual machine (VM). +This guide will walk you through setting up a Rust project using the Calimero +SDK, writing an application, and preparing it for deployment. ### Prerequisites -Before you begin, ensure you have Rust installed on your system. If not, follow the official Rust installation guide for your platform: [Rust Installation Guide](https://www.rust-lang.org/tools/install). +Before you begin, ensure you have Rust installed on your system. If not, follow +the official Rust installation guide for your platform: +[Rust Installation Guide](https://www.rust-lang.org/tools/install). -You should ensure you have the `wasm32-unknown-unknown` target installed. Run the following command in your terminal to install the target: +You should ensure you have the `wasm32-unknown-unknown` target installed. Run +the following command in your terminal to install the target: ```bash title="Terminal" rustup target add wasm32-unknown-unknown @@ -19,7 +25,8 @@ rustup target add wasm32-unknown-unknown ### Setting Up Your Project -To create a new project, initialize a Rust library project using Cargo. Run the following command in your terminal: +To create a new project, initialize a Rust library project using Cargo. Run the +following command in your terminal: ```bash title="Terminal" cargo new --lib kv-store @@ -43,21 +50,24 @@ At this point, we can `cd` into the `kv-store` directory: cd kv-store ``` -Next, you need to specify the crate-type as `cdylib` in your `Cargo.toml` file to generate a dynamic library that can be compiled to Wasm: +Next, you need to specify the crate-type as `cdylib` in your `Cargo.toml` file +to generate a dynamic library that can be compiled to Wasm: ```toml title="File: Cargo.toml" [lib] crate-type = ["cdylib"] ``` -You can now configure your project to use the Calimero SDK by adding it as a dependency in your `Cargo.toml` file: +You can now configure your project to use the Calimero SDK by adding it as a +dependency in your `Cargo.toml` file: ```toml title="File: Cargo.toml" [dependencies] calimero-sdk = { git = "https://github.com/calimero-network/core" } ``` -Then, we need to specify a custom build profile for the most compact Wasm output: +Then, we need to specify a custom build profile for the most compact Wasm +output: ```toml title="File: Cargo.toml" [profile.app-release] @@ -103,7 +113,8 @@ overflow-checks = true -And finally, create a `build.sh` script to compile your application into Wasm format, for example: +And finally, create a `build.sh` script to compile your application into Wasm +format, for example: ```bash title="File: build.sh" showLineNumbers #!/bin/bash @@ -122,7 +133,10 @@ mkdir -p res cp $TARGET/wasm32-unknown-unknown/app-release/kv_store.wasm ./res/ ``` -You can optionally choose to install and use [`wasm-opt`](https://github.com/WebAssembly/binaryen), for an additional optimization step in the build script. This step is not required but can help reduce the size of the generated Wasm file: +You can optionally choose to install and use +[`wasm-opt`](https://github.com/WebAssembly/binaryen), for an additional +optimization step in the build script. This step is not required but can help +reduce the size of the generated Wasm file: ```bash title="File: build.sh" if command -v wasm-opt > /dev/null; then @@ -151,7 +165,8 @@ $ tree ### Writing Your Application -Now, let's create a simple key-value store application using the Calimero SDK. Start by defining your application logic in `lib.rs`: +Now, let's create a simple key-value store application using the Calimero SDK. +Start by defining your application logic in `lib.rs`: ```rust title="File: src/lib.rs" showLineNumbers use calimero_sdk::borsh::{BorshDeserialize, BorshSerialize}; @@ -166,9 +181,14 @@ struct KvStore {} impl KvStore {} ``` -The `KvStore` struct represents the state of your application, which will be borsh-encoded in the app-scoped state partition on the node's storage. The `#[app::state]` attribute macro marks the struct as the application state, permitting its use by Calimero SDK. +The `KvStore` struct represents the state of your application, which will be +borsh-encoded in the app-scoped state partition on the node's storage. The +`#[app::state]` attribute macro marks the struct as the application state, +permitting its use by Calimero SDK. -The `#[app::logic]` attribute macro marks the implementation block as the application logic, allowing you to define the methods that interact with the application state. +The `#[app::logic]` attribute macro marks the implementation block as the +application logic, allowing you to define the methods that interact with the +application state. Consider a method like `get` that retrieves a value from the key-value store: @@ -178,7 +198,9 @@ pub fn get(&self, key: &str) -> Option<&str> { } ``` -The inputs must be deserializable from the transaction data, and the output must be serializable to the response data. The `Option` type is used to represent the possibility of the key not being present in the store. +The inputs must be deserializable from the transaction data, and the output must +be serializable to the response data. The `Option` type is used to represent the +possibility of the key not being present in the store. And now, here's a complete example of a key-value store application: @@ -232,7 +254,9 @@ impl KvStore { ### Building Your Application -Once your application logic is defined, run the `./build.sh` script to compile your application into Wasm format. This script will generate `kv_store.wasm` in the `res` folder of your application. +Once your application logic is defined, run the `./build.sh` script to compile +your application into Wasm format. This script will generate `kv_store.wasm` in +the `res` folder of your application. ```bash title="Terminal" $ ./build.sh @@ -256,7 +280,8 @@ $ tree ### Deploying Your Application -After successfully building your application, you can upload the compiled `kv_store.wasm` to the registry for use by a live Calimero node. +After successfully building your application, you can upload the compiled +`kv_store.wasm` to the registry for use by a live Calimero node. ### Writing Efficient Code with Calimero SDK @@ -268,17 +293,31 @@ pub fn get(&self, key: &str) -> Option<&str> { } ``` -you'll notice that we prioritize using references instead of owned values. This approach optimizes performance and memory usage by minimizing unnecessary data copying. +you'll notice that we prioritize using references instead of owned values. This +approach optimizes performance and memory usage by minimizing unnecessary data +copying. -For input parameters, such as `&str` and `&[u8]`, utilizing references allows you to avoid unnecessary copying of data. Similarly, for output values, you can return references to data that live as long as `&self` or any of the input parameters. By doing so, you reduce memory overhead and improve the overall efficiency of your application. +For input parameters, such as `&str` and `&[u8]`, utilizing references allows +you to avoid unnecessary copying of data. Similarly, for output values, you can +return references to data that live as long as `&self` or any of the input +parameters. By doing so, you reduce memory overhead and improve the overall +efficiency of your application. -By returning a reference to the value associated with the provided key instead of cloning the entire value, you ensure efficient memory usage and enhance the performance of your application. +By returning a reference to the value associated with the provided key instead +of cloning the entire value, you ensure efficient memory usage and enhance the +performance of your application. ### Handling Errors with Calimero SDK -When designing methods that may potentially fail, it's recommended to return a `Result` type with an error variant representing the possible failure cases. This enables you to handle errors more effectively and communicate error conditions to users of your application. As opposed to panicking which would only return a string message, using `Result` allows you to provide a structured error type with additional context. +When designing methods that may potentially fail, it's recommended to return a +`Result` type with an error variant representing the possible failure cases. +This enables you to handle errors more effectively and communicate error +conditions to users of your application. As opposed to panicking which would +only return a string message, using `Result` allows you to provide a structured +error type with additional context. -First, let's define an error type `Error<'a>` with a lifetime tied to the key `&'a str`: +First, let's define an error type `Error<'a>` with a lifetime tied to the key +`&'a str`: ```rust title="File: src/lib.rs" use calimero_sdk::serde::Serialize; @@ -290,9 +329,12 @@ pub enum Error<'a> { } ``` -In the above definition, `Error` represents the possible error variants that may occur during the execution of your method. Each variant can carry additional data to provide context about the error condition. +In the above definition, `Error` represents the possible error variants that may +occur during the execution of your method. Each variant can carry additional +data to provide context about the error condition. -Next, let's modify the `get` method to return a `Result` with `Error` as the error type: +Next, let's modify the `get` method to return a `Result` with `Error` as the +error type: ```rust title="File: src/lib.rs" pub fn get<'a>(&self, key: &'a str) -> Result<&'a str, Error<'a>> { @@ -303,19 +345,34 @@ pub fn get<'a>(&self, key: &'a str) -> Result<&'a str, Error<'a>> { } ``` -In the `get` method, we return `Ok(value)` if the key exists in the key-value store, and `Err(Error::NotFound(key))` if the key is not found. This allows callers of the method to handle the possibility of the key not being present in the store. +In the `get` method, we return `Ok(value)` if the key exists in the key-value +store, and `Err(Error::NotFound(key))` if the key is not found. This allows +callers of the method to handle the possibility of the key not being present in +the store. -Additionally, ensure that the `Error` type is serializable by implementing (or deriving) the `Serialize` trait, as shown in the definition above. This enables errors to be encoded in a structured format when returned as part of a call error. +Additionally, ensure that the `Error` type is serializable by implementing (or +deriving) the `Serialize` trait, as shown in the definition above. This enables +errors to be encoded in a structured format when returned as part of a call +error. -By following this approach, you can handle errors more gracefully and provide meaningful feedback to users of your Calimero application. +By following this approach, you can handle errors more gracefully and provide +meaningful feedback to users of your Calimero application. ### Emitting Events with Calimero SDK -To facilitate real-time monitoring of state transitions within your Calimero application, you can emit events using the `app::emit!` macro provided by the Calimero SDK. Event emission is particularly useful for handling live state transitions triggered by other actors, allowing subscribed clients to receive immediate updates about relevant actions. +To facilitate real-time monitoring of state transitions within your Calimero +application, you can emit events using the `app::emit!` macro provided by the +Calimero SDK. Event emission is particularly useful for handling live state +transitions triggered by other actors, allowing subscribed clients to receive +immediate updates about relevant actions. -Let's focus on emitting events for mutating calls, specifically `set` and `remove` methods: +Let's focus on emitting events for mutating calls, specifically `set` and +`remove` methods: -First, define your custom events using the `#[app::event]` proc macro. In this example, we'll define events for setting a new key-value pair (`Inserted`), updating an existing value (`Updated`), and removing a key-value pair (`Removed`): +First, define your custom events using the `#[app::event]` proc macro. In this +example, we'll define events for setting a new key-value pair (`Inserted`), +updating an existing value (`Updated`), and removing a key-value pair +(`Removed`): ```rust title="File: src/lib.rs" use calimero_sdk::app; @@ -330,7 +387,8 @@ pub enum Event<'a> { Each event variant can carry additional data to provide context about the event. -Now, you need to associate the event with the application logic by annotating the application state. +Now, you need to associate the event with the application logic by annotating +the application state. ```rust title="File: src/lib.rs" #[app::state(emits = for<'a> Event<'a>)] @@ -340,7 +398,8 @@ struct KvStore { } ``` -And finally, within your application logic methods, emit events using the `app::emit!` macro: +And finally, within your application logic methods, emit events using the +`app::emit!` macro: ```rust title="File: src/lib.rs" use std::collections::hash_map::Entry; @@ -371,33 +430,62 @@ pub fn remove(&mut self, key: &str) -> Result { } ``` -In each method, we emit the corresponding event with relevant data. This allows external observers to react to these events and take appropriate actions. +In each method, we emit the corresponding event with relevant data. This allows +external observers to react to these events and take appropriate actions. -By emitting events, you can ensure connected clients receive real-time updates about state transitions within your Calimero application, enabling them to respond to changes as they occur. +By emitting events, you can ensure connected clients receive real-time updates +about state transitions within your Calimero application, enabling them to +respond to changes as they occur. ### Ensuring Atomicity and Event Reliability in Calimero Applications -In Calimero applications, ensuring atomicity of state changes and reliability of event emission is crucial for maintaining data consistency and facilitating reliable communication between actors. Here's how atomicity and event reliability are enforced: +In Calimero applications, ensuring atomicity of state changes and reliability of +event emission is crucial for maintaining data consistency and facilitating +reliable communication between actors. Here's how atomicity and event +reliability are enforced: #### Atomic State Changes -When a method call fails, whether due to panics or returning an `Err`, all state changes made up to that point are discarded. This ensures that if an operation cannot be completed successfully, the application's state remains consistent and unaffected by partial updates. By enforcing atomicity, Calimero promotes data integrity and prevents inconsistencies that may arise from incomplete transactions. +When a method call fails, whether due to panics or returning an `Err`, all state +changes made up to that point are discarded. This ensures that if an operation +cannot be completed successfully, the application's state remains consistent and +unaffected by partial updates. By enforcing atomicity, Calimero promotes data +integrity and prevents inconsistencies that may arise from incomplete +transactions. #### Reliable Event Emission -Similarly, event emission in Calimero applications is tied to the successful execution of transactions. Events are only relayed when a transaction has been successfully executed, ensuring that external observers receive updates about state changes reliably. By linking event emission to transaction execution, Calimero guarantees that event notifications accurately reflect the application's current state, enhancing the reliability and consistency of communication between actors. +Similarly, event emission in Calimero applications is tied to the successful +execution of transactions. Events are only relayed when a transaction has been +successfully executed, ensuring that external observers receive updates about +state changes reliably. By linking event emission to transaction execution, +Calimero guarantees that event notifications accurately reflect the +application's current state, enhancing the reliability and consistency of +communication between actors. -This also means it doesn't matter if the event emission is done before or after the state change, as the event will only be emitted if the state change is successful. +This also means it doesn't matter if the event emission is done before or after +the state change, as the event will only be emitted if the state change is +successful. -By adhering to these principles of atomicity and event reliability, Calimero applications maintain data integrity and enable robust interaction between different components, facilitating the development of secure and dependable decentralized systems. +By adhering to these principles of atomicity and event reliability, Calimero +applications maintain data integrity and enable robust interaction between +different components, facilitating the development of secure and dependable +decentralized systems. ### Local-First Efficiency: No Network Overhead for Read-Only Calls -In Calimero, adherence to the local-first principle eliminates the need for network communication in read-only calls. Since read-only operations don't modify the state, there's no associated network overhead. This local-first approach streamlines data access, promoting efficient and responsive application performance without unnecessary network activity. +In Calimero, adherence to the local-first principle eliminates the need for +network communication in read-only calls. Since read-only operations don't +modify the state, there's no associated network overhead. This local-first +approach streamlines data access, promoting efficient and responsive application +performance without unnecessary network activity. ### Conclusion -You've now learned how to set up a Rust project using the Calimero SDK, write a simple application, build it into Wasm, and prepare it for deployment. Experiment with different features and functionalities to create powerful and secure applications with Calimero. +You've now learned how to set up a Rust project using the Calimero SDK, write a +simple application, build it into Wasm, and prepare it for deployment. +Experiment with different features and functionalities to create powerful and +secure applications with Calimero.