<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Archethic</title>
    <description>The latest articles on DEV Community by Archethic (@archethic).</description>
    <link>https://dev.to/archethic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F5975%2Fb3d10c3c-61d8-435d-8cbe-ad510bcb164d.png</url>
      <title>DEV Community: Archethic</title>
      <link>https://dev.to/archethic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/archethic"/>
    <language>en</language>
    <item>
      <title>How to Build &amp; Deploy Smart Contracts on Archethic?</title>
      <dc:creator>Samuel Manzanera</dc:creator>
      <pubDate>Thu, 20 Oct 2022 16:34:46 +0000</pubDate>
      <link>https://dev.to/archethic/how-to-build-deploy-smart-contracts-on-archethic-3f22</link>
      <guid>https://dev.to/archethic/how-to-build-deploy-smart-contracts-on-archethic-3f22</guid>
      <description>&lt;p&gt;Archethic is a new generation of decentralized and distributed ledger using the concept of TransactionChains to provide fast, scalable and secure network. &lt;/p&gt;

&lt;p&gt;Archethic smart contracts are designed to be simple to use by its language, by its concepts and being based on the TransactionChains paradigm.&lt;/p&gt;

&lt;h2&gt;
  
  
  TransactionChains
&lt;/h2&gt;

&lt;p&gt;Archethic relies on TransactionChain's which reduce to the most atomic form of block: the transaction.&lt;br&gt;
Instead of sharing a block of the transactions with multiple other transactions, a chain is built from a wallet, a service, a smart contract.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzb98r8ah6rzor60aadk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffzb98r8ah6rzor60aadk.png" alt="Blockchain vs TransactionChains" width="398" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scalability and the speed of the transaction validation is then decoupled.&lt;/p&gt;
&lt;h2&gt;
  
  
  Smart Contract
&lt;/h2&gt;

&lt;p&gt;Archethic leverage smart contract technology embedded into any transactions. In other words, any transaction can be a smart contract.&lt;/p&gt;

&lt;p&gt;The smart contracts are interpreted making it easy to understand by the creators, the auditors, and the network.&lt;/p&gt;

&lt;p&gt;They rely on 3 main concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Triggers: what are the event which will execute some code&lt;/li&gt;
&lt;li&gt;Conditions: what are the conditions met to execute some code&lt;/li&gt;
&lt;li&gt;Actions: The code itself to generate a new transaction on the chain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apart from those concepts, the smart contract are easy to use thanks to a domain-specific language reducing most of the complexity and upgradable via the TransactionChains.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's build something
&lt;/h2&gt;

&lt;p&gt;Nothing is better to explain sometimes than to show.&lt;br&gt;
So, we will code and create a smart contract to demonstrate the capabilities.&lt;/p&gt;

&lt;p&gt;For this example, we will build a crowd-sale smart contract for an ICO.&lt;/p&gt;

&lt;p&gt;What the contract will do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accept some cryptocurrency transfers&lt;/li&gt;
&lt;li&gt;Transfers some token in exchange&lt;/li&gt;
&lt;li&gt;Close the sales after a certain duration&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Conditions
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Transactions
&lt;/h4&gt;

&lt;p&gt;We will define some conditions for the smart contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;condition transaction: [
    uco_transfers: size() &amp;gt; 0,
    timestamp: transaction.timestamp &amp;lt; 1665750161
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are defining the condition to accept only incoming transactions with some UCO transfers and before a given UNIX timestamp (the closing date of the ICO)&lt;/p&gt;

&lt;h4&gt;
  
  
  Inherit
&lt;/h4&gt;

&lt;p&gt;Because Archethic relies on TransactionChains, after an executed code, a new transaction might be generated.&lt;br&gt;
But to achieve that, the creator has to delegate its cryptographic keys to the validators, so we could generate new transactions.&lt;/p&gt;

&lt;p&gt;However, to prevent a bad usage of the chain, we have to define some constraints making the transactions behave like expected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;condition inherit: [
   token_transfers: size() == 1
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Disclaimer: This is just an example, it should not be taken as production ready. To harden it, you would have to check whether the destination address is within the previous transaction inputs (the UCO transfer)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By having those condition, the next transaction – while being validated – will ensure its integrity by asserting the conditions defined.&lt;/p&gt;

&lt;h3&gt;
  
  
  Triggers &amp;amp; Actions
&lt;/h3&gt;

&lt;p&gt;The last remaining part is the definition of the code itself and the triggers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;actions triggered_by: transaction do
   # Get the amount of uco send to this contract
   amount_send = transaction.uco_transfers[contract.address]

   if amount_send &amp;gt; 0 do
      # Convert UCO to the number of tokens to credit. Each UCO worth 10 token
      token_to_credit = amount_send * 10

      # Send the new transaction
      add_token_transfer to: transaction.address, token_address: contract.address, amount: token_to_credit
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this snippet, a new incoming transaction would trigger a code which will convert the UCO transferred into a new token transfer, based on the defined rate.&lt;/p&gt;

&lt;p&gt;To summarize the contract creation for an ICO fits in the snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;condition inherit: [
   token_transfers: size() == 1
]

condition transaction: [
    uco_transfers: size() &amp;gt; 0,
    timestamp: transaction.timestamp &amp;lt; 1665750161
]

actions triggered_by: transaction do
   # Get the amount of uco send to this contract
   amount_send = transaction.uco_transfers[contract.address]

   if amount_send &amp;gt; 0 do
      # Convert UCO to the number of tokens to credit. Each UCO worth 10 token
      token_to_credit = amount_send * 10

      # Send the new transaction
      add_token_transfer to: transaction.address, token_address: contract.address, amount: token_to_credit
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let's test it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Get some funds
&lt;/h3&gt;

&lt;p&gt;To be able to exchange on the network, you need some funds, you can get some funds from the faucet either using the &lt;a href="https://mainnet.archethic.net/faucet" rel="noopener noreferrer"&gt;https://mainnet.archethic.net/faucet&lt;/a&gt; or a local node (&lt;a href="https://github.com/archethic-foundation/archethic-node" rel="noopener noreferrer"&gt;https://github.com/archethic-foundation/archethic-node&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pm1uzjxjrtwqpekgi42.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pm1uzjxjrtwqpekgi42.png" alt="Archethic's faucet" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Build the transaction
&lt;/h3&gt;

&lt;p&gt;Archethic have an SDK to build transactions (&lt;a href="https://github.com/archethic-foundation/libjs" rel="noopener noreferrer"&gt;https://github.com/archethic-foundation/libjs&lt;/a&gt;), which provide a page to build transaction (example/transactionBuilder)&lt;/p&gt;

&lt;h4&gt;
  
  
  Write the code
&lt;/h4&gt;

&lt;p&gt;We are using the transaction builder to forge the transaction, by passing the chain's seed (previously funded), the code mentioned above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffarz6zm47sfs0irugfg2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffarz6zm47sfs0irugfg2.png" alt="Transaction builder" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Mint a token
&lt;/h4&gt;

&lt;p&gt;Moreover, to use an existing token, we will mint a token in the same time. &lt;br&gt;
Just specify the type of transaction as: &lt;code&gt;token&lt;/code&gt; and defines it in the content section. (for more details, please refer to the token standard definition: &lt;a href="https://archethic-foundation.github.io/archethic-docs/learn/token" rel="noopener noreferrer"&gt;https://archethic-foundation.github.io/archethic-docs/learn/token&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bk7ub3t95cljs8qvd52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5bk7ub3t95cljs8qvd52.png" alt="Token definition" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Authorized the nodes
&lt;/h4&gt;

&lt;p&gt;Now, as explained before, we have to allow nodes to generate transaction in our behalf. Hence, we have to encrypt the chain's seed to be decrypted only by the nodes, by using the &lt;code&gt;Ownerships&lt;/code&gt; section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2bm6tawktsm1m7w9diu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2bm6tawktsm1m7w9diu.png" alt="Image description" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The secret being the seed, the public key being the &lt;code&gt;Storage nonce public key&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Contract created
&lt;/h3&gt;

&lt;p&gt;After the transaction generated and sent, we have a new transaction on the chain with the tokens minted and the contract deployed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgaa77shcxbg5h7x22job.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgaa77shcxbg5h7x22job.png" alt="Image description" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Test the interactions
&lt;/h3&gt;

&lt;p&gt;We will go back to the transaction builder and generate a new transaction from another chain (funded as well), and we will send UCO to this smart contract's address (previously created)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We also have to mention the recipient address to say we want to execute code in the smart contract and not only send UCO to it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmev56r4khgfuzma2kn7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmev56r4khgfuzma2kn7z.png" alt="Image description" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After sending, the chain would have created a new transaction  by sending the tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zan47h5vqn0l0xa2d8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zan47h5vqn0l0xa2d8x.png" alt="Token sent" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sender will have now in possession its token, while the contract would have got the UCO.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83pc7mojg312vote0lpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83pc7mojg312vote0lpr.png" alt="Token received" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The way to create smart contract on Archethic are quite innovative to allow users to create simple code but powerful by leveraging triggers and bring confidence/security with well-defined conditions. &lt;/p&gt;

&lt;p&gt;Apart from this, other really interesting features are supported such as easy upgrade or few triggers (date, interval, oracles, etc.)&lt;/p&gt;

</description>
      <category>archethic</category>
      <category>blockchain</category>
      <category>smartcontract</category>
      <category>web3</category>
    </item>
    <item>
      <title>Archethic Wallet: User vs Developer Perspective</title>
      <dc:creator>Margarita Manzanera</dc:creator>
      <pubDate>Mon, 03 Oct 2022 20:48:17 +0000</pubDate>
      <link>https://dev.to/archethic/archethic-wallet-user-vs-developer-perspective-1pee</link>
      <guid>https://dev.to/archethic/archethic-wallet-user-vs-developer-perspective-1pee</guid>
      <description>&lt;h1&gt;
  
  
  What is the Archethic wallet?
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Archethic has developed a fully decentralized and non-custodial cryptocurrency hot wallet that enables users to safely manage assets on Layer 1 Archethic blockchain.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No signup or KYC needed, users just control their services and access keychain, protected by different secure access methods like PIN Code, Password, YubiKey like devices and Biometrics.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the features of the Archethic wallet?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The user's perspective 👩🏿
&lt;/h2&gt;

&lt;p&gt;Archethic Wallet has implemented the following features:&lt;/p&gt;

&lt;h4&gt;
  
  
  Main features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Decentralized keychain management&lt;/li&gt;
&lt;li&gt;Multiple accounts' management&lt;/li&gt;
&lt;li&gt;Creation of Fungible Tokens&lt;/li&gt;
&lt;li&gt;Creation of NFTs&lt;/li&gt;
&lt;li&gt;Support for transactions (Sending and Receiving UCO Token, Fungible Tokens and NFTs)&lt;/li&gt;
&lt;li&gt;List of recent transactions&lt;/li&gt;
&lt;li&gt;List of acquired tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Security
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Security access with Password, PIN, Yubicloud OTP, Face ID, Touch ID, Uniris Biometrics (2023)&lt;/li&gt;
&lt;li&gt;Use of 24 Words Mnemonics&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Customization
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Support for English and French Language&lt;/li&gt;
&lt;li&gt;Support for multiple Currencies (view only, not meant as multiple cryptocurrencies wallet)&lt;/li&gt;
&lt;li&gt;Multi themes (9 themes available)&lt;/li&gt;
&lt;li&gt;UI customization&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Other features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Local notifications&lt;/li&gt;
&lt;li&gt;Access to exchanges to buy ERC20 UCO&lt;/li&gt;
&lt;li&gt;Share address with QR Code or mobile share feature&lt;/li&gt;
&lt;li&gt;Address book&lt;/li&gt;
&lt;li&gt;UCO Price chart&lt;/li&gt;
&lt;li&gt;Access latest Archethic blog articles&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How is the Archethic wallet developed?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The developer's perspective 👨🏻‍💻
&lt;/h2&gt;

&lt;p&gt;We developed the wallet using &lt;strong&gt;Flutter&lt;/strong&gt; based on &lt;strong&gt;Dart&lt;/strong&gt; language.&lt;/p&gt;

&lt;p&gt;Flutter is an open-source mobile application development framework from Google. The main reason for its popularity is that it supports the creation of cross-platform applications. Flutter is also used to create interactive apps that run on web pages or on the desktop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpqxrrhk1a6yy9x71en9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxpqxrrhk1a6yy9x71en9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Here are some of Flutter's features*
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Single code base for Android, iOS, Windows, Linux, macOS, Web, Extension:&lt;/strong&gt; This approach simplifies and reduces the development time, cost, and maintenance is also an easy task. The Flutter-based user interface can be installed virtually on any platform. It has its own rendering engine that allows developers to keep the UI as it is while moving to another platform. As a result, application users can enjoy an excellent native-like experience on various platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open-source and made by Google:&lt;/strong&gt; Flutter is a popular choice among developers because of the huge community support. Google designed the Flutter framework with all the security issues of modern applications in mind. One can find reliable and well-tested plugins in Flutter to mitigate security risks such as user authentication flaws, malicious code injections and data leaks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dart Programming:&lt;/strong&gt; Flutter uses an easy to learn and implement programming language called Dart, which is Google's general purpose programming language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; As a cross-platform framework, Flutter offers unmatched performance compared to its competitors. Flutter compiles designs to native code. Unlike React Native, Flutter renders widgets directly from the native library rather than downloading libraries and components to the device before rendering.&lt;/p&gt;

&lt;p&gt;*Source: &lt;a href="https://mobiskill.fr/blog/conseils-emploi-tech/pourquoi-utiliser-flutter-en-2022/" rel="noopener noreferrer"&gt;https://mobiskill.fr/blog/conseils-emploi-tech/pourquoi-utiliser-flutter-en-2022/&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  On which platforms is the application available?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejctxjfpeiccoyuylxu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejctxjfpeiccoyuylxu7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to install the application and secure your funds?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The user's perspective 👩
&lt;/h2&gt;

&lt;p&gt;You can now download our wallet on the Google Play Store in beta for the Android mobile version and via the official website of Archethic for the macOs version (&lt;a href="https://www.archethic.net/aewallet.html" rel="noopener noreferrer"&gt;https://www.archethic.net/aewallet.html&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;During the onboarding process, a screen invites you to create a new wallet or to restore a wallet you already own, from a series of 24 words (seed phrase).&lt;/p&gt;

&lt;p&gt;In the case of a new wallet, a series of 24 words (seed phrase) is proposed in English or French. This allows you to generate your private and public keys for your wallet. These words are currently the only way to recover your funds in case of loss of your mobile or uninstallation of the wallet. It is therefore essential to keep this seed phrase hidden from view and on some medium other than your devices.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;Remember that Archethic will never ask you for your 24 words series.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the seed phrase is saved, you can fully enjoy your wallet.&lt;/p&gt;

&lt;p&gt;In the case of a wallet restoration, you just have to enter the 24 words of your seed phrase in the right order and the application will find your keychain and associated accounts, from the information stored on the blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The developer's perspective 👨‍💻
&lt;/h2&gt;

&lt;p&gt;When the wallet is created, a seed is randomly created from a cryptographically secure random number generator provided by Dart.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static String generateSeed() {
    String result = '';
    const String chars = 'abcdef0123456789';
    final Random rng = Random.secure();
    for (int i = 0; i &amp;lt; 64; i++) {
      result += chars[rng.nextInt(chars.length)];
    }
    return result.toUpperCase();
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to make the seed more accessible, BIP39 is used and aims to provide a method of simplifying the reading of the seed using a series of mnemonic words. BIP39 takes random words (usually from the English language, although they can be from another language) and creates a long phrase with them, usually 12 to 24 words. In the case of the Archethic wallet, we use 24 words because the higher the number of words, the greater the entropy and security attributable to the resulting sentence. These words are chosen from a dictionary of 2048 words. The flutter library &lt;a href="https://pub.dev/packages/bip39_mnemonic" rel="noopener noreferrer"&gt;bip39_mnemonic&lt;/a&gt; is thus used with English and French dictionaries.&lt;/p&gt;

&lt;p&gt;In the case of wallet restoration, the library &lt;a href="https://pub.dev/packages/bip39_mnemonic" rel="noopener noreferrer"&gt;bip39_mnemonic&lt;/a&gt; allows to find the seed from the seed phrase.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to secure the application?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The user's perspective 👨🏾‍🦱
&lt;/h2&gt;

&lt;p&gt;Access to the application and interactions with the blockchain are secured so that certain actions are not done beyond the user's control.&lt;/p&gt;

&lt;p&gt;Following are the ways to access:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;by &lt;strong&gt;PIN code&lt;/strong&gt;, comprising of 6 digits, with the possibility to mix the numbers of the keyboard to reduce the risks of access to your code by observation,&lt;/li&gt;
&lt;li&gt;by &lt;strong&gt;password&lt;/strong&gt;,&lt;/li&gt;
&lt;li&gt;by using a &lt;strong&gt;YubiKey&lt;/strong&gt;, it is an electronic authentication device to secure your access. Whether you are using NFC with your mobile or USB on your desktop, you can identify yourself with this key,&lt;/li&gt;
&lt;li&gt;by the &lt;strong&gt;touch ID or face ID system&lt;/strong&gt;, depends on the capabilities of your device.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqwd837f2e0ex8qsi9qd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqwd837f2e0ex8qsi9qd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The developer's perspective 👩🏽‍💻
&lt;/h2&gt;

&lt;p&gt;In the case of &lt;strong&gt;PIN&lt;/strong&gt; and &lt;strong&gt;password&lt;/strong&gt;, authentication information is stored locally (see "What data is stored in my device?").&lt;br&gt;
In the case of &lt;strong&gt;touch ID&lt;/strong&gt; or &lt;strong&gt;Face ID&lt;/strong&gt;, the Flutter &lt;a href="https://pub.dev/packages/local_auth" rel="noopener noreferrer"&gt;Local Auth&lt;/a&gt; library provides the means to authenticate on devices supporting fingerprint or facial recognition authentication.&lt;/p&gt;

&lt;p&gt;Finally, for &lt;strong&gt;OTP&lt;/strong&gt; via &lt;a href="https://www.yubico.com/products/services-software/yubicloud" rel="noopener noreferrer"&gt;Yubicloud&lt;/a&gt;: Yubico OTP is a simple yet strong authentication mechanism that is supported by all YubiKeys out of the box. Yubico OTP can be used as the second factor in a 2-factor authentication scheme or on its own, providing 1-factor authentication. YubiCloud is the name of Yubico’s web service for verifying OTPs. Before using YubiCloud, you need to get an API key from &lt;a href="https://upgrade.yubico.com/getapikey/" rel="noopener noreferrer"&gt;here&lt;/a&gt; - it is quick, free and helps us in preventing misuse of YubiCloud. &lt;br&gt;
I developed a &lt;a href="https://pub.dev/packages/yubidart" rel="noopener noreferrer"&gt;Yubico dart library&lt;/a&gt; for Dart/Flutter to interact with Yubicloud in my personal GitHub repository.&lt;/p&gt;
&lt;h1&gt;
  
  
  What data is stored in my device?
&lt;/h1&gt;
&lt;h2&gt;
  
  
  The user's perspective 👨
&lt;/h2&gt;

&lt;p&gt;We store a set of information so that the application is functional in both online and offline mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwayc909xsq886wvor4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwayc909xsq886wvor4x.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first group of information represents the globally available user preferences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;First Launch&lt;/strong&gt;: Allows to know if this is the first launch of the application in order to clear the keystore for iOS. Indeed, iOS key store is persistent, so if this is first launch then we will clear the keystore.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentification Method&lt;/strong&gt;: Allows to know which authentication mode is used (PIN, password, YubiKey, biometrics).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Currency&lt;/strong&gt;: Allows you to know what currency is used in the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Language&lt;/strong&gt;: Allows you to know which language is used in the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Primary Setting&lt;/strong&gt;: Allows to know if the currency displayed in priority is Fiat or Crypto.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Network&lt;/strong&gt;: Allows to know if the wallet is connected to mainnet, testnet or to a local node whose endpoint is recorded in the following information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Network Endpoint&lt;/strong&gt;: Allows to know the address of the local node.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current Theme&lt;/strong&gt;: Allows to know which theme is used in the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock&lt;/strong&gt;: Allows to know if it is necessary to authenticate at the launching of the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock Timeout&lt;/strong&gt;: Allows to know after how long the application requires authentication at its launch if the user has left the application open to browse for another one for example.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin Pad Shuffle&lt;/strong&gt;: Allows you to determine whether the PIN code keyboard should be shuffled when entering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show Balances&lt;/strong&gt;: Allows you to determine if the financial information should be displayed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show Blog&lt;/strong&gt;: Allows you to know which blog articles should be displayed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show Price Chart&lt;/strong&gt;: Allows you to determine whether the graph and indicators of the UCO price chart should be displayed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active Vibrations&lt;/strong&gt;: Allows to know if at each action, a small vibration is emitted on the mobiles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active Notifications&lt;/strong&gt;: Allows to know if the notifications of reception of UCO are active or not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language Seed&lt;/strong&gt;: Allows to know if the seed phrase is composed of French or English words.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second group of information represents the sensitive elements related to security:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Seed&lt;/strong&gt;: Allows to store the wallet seed needed to perform transactions on the Archethic blockchain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PIN&lt;/strong&gt;: Allows to store the PIN code in case this authentication method has been chosen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password&lt;/strong&gt;: Allows to keep the password in case this authentication method has been chosen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Yubicloud ID and API Key&lt;/strong&gt;: Allows to keep the authentication information for the management of the OTP with the YubiKey in case this authentication method has been chosen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This information is stored securely.&lt;/p&gt;

&lt;p&gt;And finally, a &lt;strong&gt;secure 256-bit (32 bytes) encryption key&lt;/strong&gt; to secure data on the disk.&lt;br&gt;
⚠️ &lt;strong&gt;Remember that Archethic will never pass on your data to a third party or use your data in any other way than that offered by the application.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The privacy policy is available on &lt;a href="https://www.archethic.net/aewallet-privacy.html" rel="noopener noreferrer"&gt;our website&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  The developer's perspective 👨🏻‍💻
&lt;/h2&gt;

&lt;p&gt;In the case of user preference data, we made the choice to store it in a local database &lt;a href="https://pub.dev/packages/hive" rel="noopener noreferrer"&gt;Hive&lt;/a&gt; rather than the Flutter object &lt;a href="https://pub.dev/packages/shared_preferences" rel="noopener noreferrer"&gt;SharedPreferences&lt;/a&gt; for performance reasons. All the information is available in this &lt;a href="https://medium.com/flutter-community/using-hive-instead-of-sharedpreferences-for-storing-preferences-2d98c9db930f" rel="noopener noreferrer"&gt;medium article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These data are stored in clear text because they are not sensitive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On the other hand, the information related to security management must be protected.&lt;/strong&gt; Here again, Hive is used but the stored values are encrypted. Hive provides a helper function to generate a secure encryption key using the &lt;a href="https://en.wikipedia.org/wiki/Fortuna_%28PRNG%29" rel="noopener noreferrer"&gt;Fortuna&lt;/a&gt; random number generator.&lt;br&gt;
The key is stored base 64 encoded in a secure space via the &lt;a href="https://pub.dev/packages/flutter_secure_storage" rel="noopener noreferrer"&gt;FlutterSecureStorage&lt;/a&gt; library.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static Future&amp;lt;Vault&amp;gt; getInstance() async {
    try {
      const FlutterSecureStorage secureStorage = FlutterSecureStorage();
      final Uint8List encryptionKey;
      String? secureKey =
          await secureStorage.read(key: 'archethic_wallet_secure_key');
      if (secureKey == null || secureKey.isEmpty) {
        final List&amp;lt;int&amp;gt; key = Hive.generateSecureKey();
        encryptionKey = Uint8List.fromList(key);
        secureKey = base64UrlEncode(key);
        await secureStorage.write(
            key: 'archethic_wallet_secure_key', value: secureKey);
      } else {
        encryptionKey = base64Url.decode(secureKey);
      }
      final Box&amp;lt;dynamic&amp;gt; encryptedBox = await Hive.openBox&amp;lt;dynamic&amp;gt;(_vaultBox,
          encryptionCipher: HiveAesCipher(encryptionKey));
      return Vault._(encryptedBox);
    } catch (e) {
      throw Exception();
    }
  }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  How does the wallet interact with the Archethic blockchain?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6oue4kbkb3sduymraxb1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6oue4kbkb3sduymraxb1.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The developer's perspective 👩‍💻
&lt;/h2&gt;

&lt;p&gt;Based on the Archethic JS SDK, a &lt;strong&gt;SDK has been developed in dart&lt;/strong&gt; and is maintained by the Archethic teams in order to offer internal or community-developed Flutter DApps to interact with the Archethic Blockchain.&lt;/p&gt;

&lt;p&gt;This open-source SDK "&lt;a href="https://pub.dev/packages/archethic_lib_dart" rel="noopener noreferrer"&gt;archethic_lib_dart&lt;/a&gt;", available on &lt;a href="https://github.com/archethic-foundation/libdart" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, can be added as dependencies in Dart or Flutter projects via the Flutter libraries and packages sharing site &lt;a href="https://pub.dev/" rel="noopener noreferrer"&gt;Pub.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The available functions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cryptographic functions,&lt;/li&gt;
&lt;li&gt;Transaction building,&lt;/li&gt;
&lt;li&gt;Remote endpoint calls,&lt;/li&gt;
&lt;li&gt;Keychain / Wallet management,&lt;/li&gt;
&lt;li&gt;CoinGecko functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the documentation is available in the &lt;a href="https://pub.dev/packages/archethic_lib_dart" rel="noopener noreferrer"&gt;readme of the library.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Wallet timeline
&lt;/h1&gt;

&lt;p&gt;Some elements of the SDK and wallet history are shown here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70305aekrk6vycb8r3dv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70305aekrk6vycb8r3dv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The author's perspective 👷
&lt;/h1&gt;

&lt;p&gt;Until now, the Archethic community has always been involved in the development of the wallet to improve both the technical aspects and the user experience. The wallet has the vocation to be accessible to all to simplify and secure the uses.&lt;/p&gt;

&lt;p&gt;You can follow or contribute to the development of the application via &lt;a href="https://github.com/archethic-foundation/archethic-wallet" rel="noopener noreferrer"&gt;the dedicated repository on GitHub&lt;/a&gt; or via the &lt;a href="https://www.archethic.net/aewallet.html" rel="noopener noreferrer"&gt;official page of the application&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: Sylvain Séramy, Head of Front-End Department at Archethic Technologies&lt;/em&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>webdev</category>
      <category>programming</category>
      <category>flutter</category>
    </item>
    <item>
      <title>Self Healing Blockchains</title>
      <dc:creator>Margarita Manzanera</dc:creator>
      <pubDate>Mon, 19 Sep 2022 19:39:50 +0000</pubDate>
      <link>https://dev.to/archethic/self-healing-blockchains-24ce</link>
      <guid>https://dev.to/archethic/self-healing-blockchains-24ce</guid>
      <description>&lt;p&gt;The world is eagerly waiting for a next-generation, high-performance, permission-less blockchain and this blockchain should be able to industrially scale all decentralized applications. So far, the world/crypto community has witnessed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;P2P blockchain networks that use all the peers to validate transactions, do computation and storage. For example, Bitcoin, Ethereum … (Traditional Blockchains)&lt;/li&gt;
&lt;li&gt;P2P blockchain networks that shard transactions, computation, and storage. For example, Ethereum 2.0, Zilliqa … (Sharding Blockchains)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The sharding mechanism in blockchain gives hope for an unlimited and sustainable scalability of blockchains. But many people in the blockchain space strongly believe that the scalability of the blockchain networks or the sharding mechanism has reached a tipping point. Not true! How?&lt;br&gt;
In this article, we will discuss the problems that plague sharding mechanisms in permission-less blockchain. And, how the self-healing mechanism is the only solution to this.&lt;/p&gt;




&lt;h1&gt;
  
  
  In the blockchain world, why do we need sharding?
&lt;/h1&gt;

&lt;p&gt;Currently, the internet is used in Payments, IoT, smart city, robotics, web search, streaming videos, e-commerce, autonomous vehicles, etc. Hence, the internet generates&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;over billion transactions per second (Transaction)&lt;/li&gt;
&lt;li&gt;over sextillion calculations per second (Computation)&lt;/li&gt;
&lt;li&gt;over 2.5 quintillion bytes of data per second (Storage)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This work needs to be harmoniously split among all the peers in a P2P network. This splitting of work is called the Sharding Technology. Sharding can be applied to transaction, computation, and storage.&lt;/p&gt;




&lt;h1&gt;
  
  
  Problems that plague Sharding Mechanism
&lt;/h1&gt;

&lt;p&gt;A permission-less P2P network is unpredictable and to compensate for this unpredictability, various blockchain protocols fix the number of validations and the number of storage copies to a constant that is derived from a mathematical computation based on certain assumptions. This limits the scalability of blockchains since the system will either over-compensate and limit scale or under-compensate and risk security/integrity.&lt;/p&gt;

&lt;p&gt;What if the P2P network can be predicted? Can the number of validation and number of storage peers be flexible depending on the chaoticity of the P2P network? That is to say, if the P2P network behaves ideally then only 1 validation and storage copy is needed and if the peers in the P2P network behave maliciously or deviate from the ideal nature, then the number of validation and storage copies will increase proportionally.&lt;/p&gt;

&lt;p&gt;Problems faced by peers/shard in the P2P network:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internet connection problems, electricity cuts, data loss, many more …&lt;/li&gt;
&lt;li&gt;Joining and leaving the network all the time throughout the globe.&lt;/li&gt;
&lt;li&gt;Data availability and data consistency problems&lt;/li&gt;
&lt;li&gt;If a peer/shard goes offline, the data belonging to that shard is lost forever.&lt;/li&gt;
&lt;li&gt;Peers/shard can turn malicious anytime&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The culprit here is the unpredictability of the P2P network! This unpredictability of P2P network decreases the performance of validation, computation, and storage. &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Self-Healing Blockchain
&lt;/h1&gt;

&lt;p&gt;Due to the uncertainty in the P2P network, the self-healing mechanism is introduced!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 1:&lt;/strong&gt; (Traditional Blockchains) where all the N nodes in the network validate/compute/store all the transactions in the network. (N)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 2:&lt;/strong&gt; (Ideal P2P) Consider an ideal P2P blockchain network where all the peers in the network are available 24×7, with good internet, bandwidth, electricity supply, etc. and are good peers (not malicious). Then any transaction/computation/storage that arrives to the network can be validated/computed/stored by 1 peer. (1)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 3:&lt;/strong&gt;(Sharded Blockchains) But the real P2P blockchain network is not so and hence a mathematical formula is derived based on the maximum possible deviation from the ideal P2P blockchain network and certain assumptions to set a fixed number like 22–600 peers to validate/compute/store depending on the blockchain protocol. (N/x)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 4:&lt;/strong&gt; (Self-Healing Blockchains) Cases 1, 2 and 3 are extreme scenarios as shown in the graph! The number of transactions/computation/storage should depend on the amount of deviation from the ideal state (with adequate safety margin). (N/x(c)) where c stands for chaoticity of the network.&lt;/p&gt;

&lt;p&gt;Chaoticity © of the network is a function of (internet bandwidth, electricity, data availability, data consistency, no of nodes joining or leaving). Any change in the function compared to the ideal state (whether positive or negative), the counter measures are deployed accordingly by the P2P network.&lt;/p&gt;

&lt;p&gt;Hence the network automatically heals if there is any stress in the network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ppNq8ynv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p34b5xgvytkba7haqpvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ppNq8ynv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p34b5xgvytkba7haqpvd.png" alt="Image description" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Analogy to self-healing blockchains
&lt;/h1&gt;

&lt;p&gt;Let us take the example of Paris metro, where depending on the traffic of people, the metro trains change the timings, frequency, the number of compartments, and speed!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traditional: There will be a maximum number of metro trains, with maximum frequency, with maximum number of compartments and with maximum speed of the metro train all the time. (Lot of energy is wasted)&lt;/li&gt;
&lt;li&gt;Ideal: There will be a minimum number of metro trains, with minimum frequency, with minimum number of compartments and with minimum speed of the metro train all the time. (Takes a lot of time for people to commute)&lt;/li&gt;
&lt;li&gt;Sharded: The number of metro train, the frequency, number of compartments, speed of the metro train will be less than the maximum, but the numbers are fixed no matter the number of people who want to use the metro.&lt;/li&gt;
&lt;li&gt;Self-Healing: Depending on the no of people, peak hours from 7AM - 9AM and 4PM - 7PM, number of metros available, etc. … The number of metro trains, the frequency, number of compartments, speed of the metro train change accordingly and are flexible for a harmonious output.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  To Conclude
&lt;/h1&gt;

&lt;p&gt;Self-healing blockchains are designed in such a way that they can survive for decades, if not centuries. The scalability achieved by these types of blockchains are close to centralized systems yet maintaining true decentralization. Since there is high scalability, any centralized application can be built on the self-healing blockchains.&lt;/p&gt;

&lt;p&gt;Applying artificial intelligence to the time series (internet bandwidth, electricity, data availability, data consistency, data loss, number of nodes joining/leaving, etc.) could further improve the self-healing blockchains making them faster and able to predict an event before it happens and hence deploying countermeasures to handle any event before even happening!&lt;/p&gt;

&lt;p&gt;There are multiple blockchain protocols leading the self-healing blockchain space, one of them is Archethic, a blockchain startup based in Paris, France with multiple patents registered on this.&lt;/p&gt;

&lt;h1&gt;
  
  
  "Self-healing blockchains are the only way that can lead to a true decentralized world within a decade"
&lt;/h1&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: Akshay Reddy, Chief Product Officer at Uniris&lt;/em&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
