<?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: NOWNodes</title>
    <description>The latest articles on DEV Community by NOWNodes (@nownodes).</description>
    <link>https://dev.to/nownodes</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%2Fuser%2Fprofile_image%2F401140%2F111edf15-be27-44a2-b72b-5149b1d2ba77.png</url>
      <title>DEV Community: NOWNodes</title>
      <link>https://dev.to/nownodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nownodes"/>
    <language>en</language>
    <item>
      <title>Monero: Recent Fork and Beyond</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Thu, 05 Nov 2020 17:09:09 +0000</pubDate>
      <link>https://dev.to/nownodes/monero-recent-fork-and-beyond-7bh</link>
      <guid>https://dev.to/nownodes/monero-recent-fork-and-beyond-7bh</guid>
      <description>&lt;p&gt;Originally published in the &lt;a href="https://nownodes.io/blog/recent-monero-fork-and-further-development-all-that-you-need-to-know"&gt;NOWNodes blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Monero went through its latest fork on October 17th, 2020. Fork, or hard fork as it was in this case, implies a major network upgrade for the privacy coin. In Monero, these hard forks or network upgrades improve the base protocol and are non-contentious. It means that there will be no splitting and no new creation of a coin. &lt;/p&gt;

&lt;p&gt;To be more specific, in this fork, Monero aimed to introduce some new features such as new ring signature construction CLSAG. How this feature would be helpful in the Monero community’s future is something that we will discuss in some time. But, before that, let’s have a look at what this hard fork means for the users at the level of usage and functionality of the platform.&lt;/p&gt;

&lt;h1&gt;
  
  
  What does it mean for the end-user?
&lt;/h1&gt;

&lt;p&gt;• For the end-user, the hard fork is nothing to worry about. It is a simple software update. Any user who uses the app after 17th October would have to update their software. &lt;br&gt;
• The developers posted detailed instructions on how to carry out the update. For the holders of wallets or nodes, the process was to simply replace the previous version of the software, be it Monerod, Monero-wallet-cli, or Monero-wallet-gui with the new versions.&lt;br&gt;
• It is no different for users who have their coins on a paper wallet. Whenever the user decides to move his/her coins, he/she would have to use an updated version of the software. That’s it.&lt;br&gt;
• The hard fork didn’t mean any change for the mining community as well. The PoW consensus-building mechanism was not affected in any way in the update. Therefore, the miners could carry on with their work even without updating their software.&lt;/p&gt;

&lt;h1&gt;
  
  
  What the hard fork tried to achieve?
&lt;/h1&gt;

&lt;p&gt;As mentioned already, the purpose of the Monero fork was to introduce a new feature known as a new ring signature construction CLSAG. We will discuss this in the next segment.&lt;/p&gt;

&lt;h2&gt;
  
  
  From MLSAG to CLSAG
&lt;/h2&gt;

&lt;p&gt;• Monero uses a transaction protocol that is signer-ambiguous. It included many cryptographic components. One of these components was MLSAG which was a type of ring signature construction. Whenever a Monero user initiated a transaction, the system generated one or more MLSAG signatures to obfuscate the signers and the amount involved in the transaction.&lt;/p&gt;

&lt;p&gt;• The latest introduction of CLSAG was aimed at replacing MLSAG. Its purpose was to improve efficiency. Monero Research Lab used some simpler but efficient algorithms by the virtue of which the CLSAG signatures could achieve the same functionality as MLSAG. But, where CLSAG raced ahead of its predecessor was that it could do the same at a much lesser size more quickly. To improve speed, the research lab optimized the underlying cryptography. &lt;/p&gt;

&lt;h2&gt;
  
  
  Enhanced Security
&lt;/h2&gt;

&lt;p&gt;The transition from MLSAG to CLSAG also improved the security of Monero. The transition was preseeded with good cryptographic construction. And the construction was done keeping a formal security model in mind. &lt;/p&gt;

&lt;p&gt;It would be relevant to mention here that security models are important in protecting the system from hackers and attackers. A security model conceives of hypothetical attackers. After that, it formalizes the capabilities of these hackers or attackers. Once the formalization has been done, it proves that these attackers can not break into particular security protocols of the network.&lt;/p&gt;

&lt;p&gt;While implementing CLSAG, the developers created a scenario where hypothetical attackers could allure honest users of the platform to obtain their keys. They were also hypothesized of being able to convince the users to carry out transactions of their wish. The security enhancement proved effective against such scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Improvement in Numbers
&lt;/h2&gt;

&lt;p&gt;The fork on 17th October changed the signature protocol from MLSAG to CLSAG. The users, however, only had to update their software. For users of hardware wallets, the fork meant an update in their firmware, the latest firmware that could support the update.&lt;/p&gt;

&lt;p&gt;Since a transition from MLSAG to CLSAG implies an improvement in the transaction size, let’s have a look at what transaction size means in Monero.&lt;/p&gt;

&lt;p&gt;The size of transactions in Monero depends on two factors. The first one is the number of the previous transaction outputs one spends. The second one is the number of new transactions the user generates. On average, most of the transactions spend two previous outputs and generate two new outputs as well. With MLSAG in place, these transactions occupied approximately 2.5 kilobytes of space on the blockchain. With the implementation of CLSAG, it came down to 1.9 kilobytes. It was a significant improvement of 25% compared to the MLSAG standards.&lt;/p&gt;

&lt;p&gt;With every new transaction happening, the Monero software verifies the signatures of these transactions. It is the standard protocol to verify that the transactions are valid. For individual transactions, the time taken to verify the signature is almost negligible. It is usually in tens of milliseconds. However, the users generally have to wait for confirmation till the entire block, which includes that transaction, is verified. This takes time. Although the time is a function of the efficiency of the computer, under CLSAG it would take far less than it used to take under MLSAG.&lt;/p&gt;

&lt;p&gt;Testings under the CLSAG protocol show that the time taken to verify signatures have undergone an improvement of nearly 20%. The transaction-wise overall improvement was 10%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Third-Party Audit
&lt;/h2&gt;

&lt;p&gt;Before deploying the code, Monero had commissioned an audit of the proposed changes. The audit looked into both aspects of CLSAG cryptography and the veracity of the implementation code. The aspect of CLSAG cryptography included the algorithms, the security models, and the proofs. &lt;/p&gt;

&lt;p&gt;For the audit, Monero employed two expert cryptographers: JP Aumasson and Antony Vennard. For support and coordination, there were Monero Audit Workgroup and the Opensource Technology Improvement Fund. Donations from the Monero community took care of the expenses of this exercise.&lt;/p&gt;

&lt;p&gt;The review process was divided into two segments. Examinations in the first segment took care looked into the security of the CLSAG. The reviewers could not find any issues in the algorithms. However, they made crucial recommendations to improve security proofs. Before going live, the network accommodated the modifications up to the reviewers’ satisfaction.  Apart from the security aspects, the reviewers also recommended some actions to improve the preprint. The recommendations were implemented. &lt;/p&gt;

&lt;p&gt;The reviewers found the implementation codes to be well written. They also concluded the implementation to be secure. According to them, the code was a correct implementation of the algorithm devised for CLSAG. Although the committee made some suggestions relating to the code, none of them pertained to any security aspect.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;The success of the review stood testimony to the fact that the MLSAG to CLSAG transition was carried out efficiently. Like software upgrades, blockchains also need to go through performance improvements at frequent intervals. Blockchain is an emerging technology with new people joining the bandwagon each day that translates to increased attention and opportunities. But, what these changes also bring with them are the possibilities of congestion and reduced efficiency, and increased hacks and attacks.&lt;/p&gt;

&lt;p&gt;The Monero fork, which improved speed and reduced requirements of space per transaction, indicated that the platform is on its toes when it comes to matching up with improving technology. Moreover, it also proved that the platform does not compromise security as a trade-off for improved performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nownodes.io"&gt;NOWNodes&lt;/a&gt; — Blockchain APIs for developers.&lt;/p&gt;

</description>
      <category>monero</category>
      <category>cpp</category>
    </item>
    <item>
      <title>NEO Flamingo DeFi — The New Frontier</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Mon, 02 Nov 2020 16:26:27 +0000</pubDate>
      <link>https://dev.to/nownodes/neo-flamingo-defi-the-new-frontier-inl</link>
      <guid>https://dev.to/nownodes/neo-flamingo-defi-the-new-frontier-inl</guid>
      <description>&lt;p&gt;Originally published in the &lt;a href="https://nownodes.io/blog/neo-flamingo-defi-the-new-frontier"&gt;NOWNodes blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;NEO is one of the popular blockchain networks that has come out of China. It is well-known for its community-driven approach. NEO is an open blockchain that is aimed at a smarter economy.&lt;/p&gt;

&lt;p&gt;Are you wondering why I am talking about Neo in the beginning? It’s because Neo has come out with Flamingo Finance, a DeFi protocol. It was launched on September 20, 2020. We will tell you all about Flamingo Finance in this article. Let’s dive straight into it.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Flamingo Finance?
&lt;/h1&gt;

&lt;p&gt;Neo blockchain-powered Flamingo is a full-featured DeFi protocol, and it’s also cross-compatible. There are five key components of Flamingo, and these are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Wrapper&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Swap Exchange&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flamingo Vault&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Perp Exchange&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DAO&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Flamingo Finance has been incubated by the executive arm of the Neo Foundation, Neo Global Development (NGD). The Neo team believes that Flamingo Finance will accelerate the adoption of DeFi. They say that Flamingo is like a missing piece that is required to increase the DeFi adoption.&lt;/p&gt;

&lt;p&gt;Each of these components of Flamingo Finance will play an important role in the growth of DeFi space. It will fulfill the need for a cross-chain asset gateway, an on-chain liquidity provider that is based on an automatic market maker mechanism, and a collateralized stablecoin that is based on an algorithm.&lt;/p&gt;

&lt;p&gt;A governance token is also in plans, and it will be known as the FLM NEP-5 governance token. The governance token of Flamingo Finance will be based on Neo. The distribution of the FLM NEP-5 governance tokens will be done through community-based participation.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Role of Flamingo Finance’s Components
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Wrapper
&lt;/h2&gt;

&lt;p&gt;Wrapper is an asset gateway based on multiple blockchain networks and has cross-chain capabilities. It is based on Cosmos-SDK, Ethereum, Ontology Network, and Bitcoin.&lt;/p&gt;

&lt;p&gt;There’s one interesting feature of the wrapper – What’s that? It allows users to convert any digital assets into NEP-5 tokens. Do you want to wrap ETH to NEth? Check! How about wrapping ONT to nOnt? Check! How about wrapping NEO to nNeo? Check! This all is possible because of the wrapper component of Flamingo Finance.&lt;/p&gt;

&lt;p&gt;Are you wondering – What to do when you want your original tokens back? Well, you can return your wrapped NEP-5 tokens and redeem your tokens. Wrapper was the first component of Flamingo Finance that was made available for public use. It has been available to users since the launch of Flamingo Finance – September 23.&lt;/p&gt;

&lt;h2&gt;
  
  
  Swap Exchange
&lt;/h2&gt;

&lt;p&gt;We know that the automatic market maker mechanism is pretty popular among the DeFi protocols. The swap exchange component of Flamingo Finance also leverages the automated market maker mechanism like many other DeFi protocols. Swap exchange will act as an on-chain liquidity pool.&lt;/p&gt;

&lt;p&gt;The supported tokens of Swap exchange are the native tokens of Flamingo exchange, known as FLM tokens, along with wrapped assets and other NEP-5 tokens. It is quite similar to Uniswap when it comes to its use of Constant Product Market Maker mode (CPMM). So, what role does CPMM play? Well, it ensures that there is constant liquidity on the platform.&lt;/p&gt;

&lt;p&gt;There are two NEP-5 tokens in the Flamingo liquidity process. The process is quite simple – A liquidity provider deposits assets to the liquidity pool, and in return, he will receive an LP token proportionate to the assets deposited by him.&lt;/p&gt;

&lt;p&gt;You can view the LP tokens as an assurance that they will have a right to repurchase their assets. Additionally, the liquidity providers also earn passive income from Flamingo Finance through the trading commissions. The trading commission is currently set at 0.3%, and the traders are allowed to swap any pairs.&lt;/p&gt;

&lt;p&gt;The Neo team has already announced that the total trading commissions that Flamingo Finance will earn, would be distributed among the liquidity providers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Perpetual Exchange
&lt;/h2&gt;

&lt;p&gt;The perpetual exchange component of Flamingo Finance will play an important role. It is an unlimited liquidity provider that leverages the AMM mechanism. It enables every trader to use the constant product market maker model to trade perpetual contracts.&lt;/p&gt;

&lt;p&gt;An interesting thing about it is that the traders can go 10x long or short here. Here, FUSD will be used as a fixed margin by the traders. They will again receive FLM in return. Flamingo oracle will feed the pricing information to the perpetual exchange, and it will launch on November 25.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flamingo Vault
&lt;/h2&gt;

&lt;p&gt;The Flamingo Vault component of the Flamingo Finance will be a universal asset manager. It has combined two interesting features: Staking/Mining with the issuance of secured stablecoins. The vault enables users to stake wrapped assets. As soon as the users stake their wrapped assets, the Mint Rush process will begin.&lt;/p&gt;

&lt;p&gt;So, what is Mint Rush? Let’s take a look. The Neo team has designed Mint Rush with an aim for it to act as an incentive to increase community participation in the Flamingo ecosystem. A total of 50,000,000 FLM tokens have been released under this phase, and users are allowed to stake their cross-chain assets to earn FLM tokens.&lt;/p&gt;

&lt;p&gt;The liquidity providers holding whitelisted LP tokens can also mint FUSD tokens, a stablecoin. Every FUSD token is pegged to the US dollar.&lt;/p&gt;

&lt;h2&gt;
  
  
  DAO
&lt;/h2&gt;

&lt;p&gt;DAO will enable FLM holders to vote on various important issues – Swap fees, the distribution mechanism of FLM tokens, list of available assets, acceptable assets to collateralize for receiving stablecoins, among other things.&lt;/p&gt;

&lt;p&gt;Neo’s long-term plan is that the entire Flamingo project will go entirely to its community, and DAO is an integral part of this plan. This is planned under the Flamingo Configuration Change Proposal and Flamingo Improvement Proposal. As per the roadmap, the scheduled date for rolling out DAO is December 23, 2020.&lt;/p&gt;

&lt;h1&gt;
  
  
  NEO 3.0 vs ETH 2.0
&lt;/h1&gt;

&lt;p&gt;There is one interesting competition shaping up in the blockchain world. There have been rounds of discussion about which of the blockchain networks is best. One of the prominent competitions is between Neo blockchain and Ethereum blockchain.&lt;/p&gt;

&lt;p&gt;With the launch of both the Neo 3.0 and Eth 2.0 on the horizon, the discussion is taking an intense shape. So, which of these upcoming advanced blockchain networks will have an upper hand over the other? We will find it out here.&lt;/p&gt;

&lt;p&gt;Ethereum 2.0 will be a better version of Ethereum 1.0. It will help the Ethereum ecosystem to scale new heights and will consume a lot less energy. Ethereum 2.0 will improve the scalability and security problems of the Ethereum blockchain.&lt;/p&gt;

&lt;p&gt;On the other hand, NEO blockchain has a reputation for being comparatively better than Ethereum in terms of scalability. So, would Neo 3.0 help maintain the same edge over Ethereum 2.0? Yes! Neo 3.0 will make Neo blockchain even more scalable. It will also add many new enterprise functionalities that will suit the larger projects. With Neo 3.0, we expect Neo blockchain to become even more user friendly.&lt;/p&gt;

&lt;p&gt;Neo has many advantages over Ethereum and Neo 3.0 is well-positioned to keep Neo blockchain ahead in the race.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Future Ahead
&lt;/h1&gt;

&lt;p&gt;Neo believes that Flamingo will be a stepping stone for Neo’s DeFi ecosystem. It will accelerate its growth and adoption. The Flamingo project is still in infancy now, and many features are still to be rolled out. Its design is still being optimized.&lt;/p&gt;

&lt;p&gt;In time, there will be an increase in the number of users in the Flamingo community. Regardless of it still being in an infancy stage, we believe in the potential of DeFi and interesting DeFi projects such as Flamingo Finance.&lt;/p&gt;

&lt;p&gt;With an increase in participation from the Flamingo community, the Flamingo ecosystem will develop further. It will be interesting to see how Flamingo Finance will make a name for itself in the world of DeFi in the next few years.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Ethereum vs Polkadot: A Comparison</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Mon, 26 Oct 2020 14:48:07 +0000</pubDate>
      <link>https://dev.to/nownodes/ethereum-vs-polkadot-a-comparison-24gj</link>
      <guid>https://dev.to/nownodes/ethereum-vs-polkadot-a-comparison-24gj</guid>
      <description>&lt;p&gt;Originally published in the &lt;a href="https://nownodes.io/blog/ethereum-vs-polkadot-a-comparison"&gt;NOWNodes blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Polkadot.network was established in 2016 by its founders Gavin Wood and Peter Czaban. It is an open-source project funded by the Web3 Foundation. Web3 Foundation funds research and development projects that intend to build the foundation of the decentralized web. Five teams and over a hundred developers have been commissioned to build Polkadot.&lt;/p&gt;

&lt;p&gt;The objective behind developing Polkadot is to deliver the most robust platform for security, scalability, and invention. It is a sharded chain that offers scalability and also the first protocol to provide a secure environment for cross-chain composability.&lt;/p&gt;

&lt;h1&gt;
  
  
  Polkadot Explained
&lt;/h1&gt;

&lt;p&gt;The initial version of Polkadot was launched on 26th May 2020. However, Polkadot’s launch is a sequence of multiple rollouts happening one after another. Each phase has some specific aims and objectives to meet. Here’s the brief outline of each of these phases below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PoA or Proof of Authority Mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this mode, most of the users gained access to claim tokens from their Ethereum contracts. They could stake their tokens and declare their intent. They could either validate or nominate. Validators could set their session keys and the Web3 Foundation used the Sudo key to manage the chain along with activating more features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPoS or Nominated Proof of Stake Mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this phase, the network was run by a decentralized set of validators. Web3 used the Sudo key to increase the number of validators in this phase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Governance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although the Sudo key still had some roles in some operations, the governance system was activated to take most of the decisions on the chain. For example, the governance committee could elect the first council and the technical committee.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sudo Removed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Sudo module was removed. Only governance could dispatch root calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Activating Balance Transfer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the phase Polkadot.network is currently in. In it, the community voted on a runtime upgrade. The purpose of the runtime upgrade was to lift the restriction on balance transfers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enabling Core Functionality&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;This is the final phase. This phase is about activating the parachain auctions and XCMP. From this phase onwards, Polkadot.network will have a fully functional relay chain. With the core functionality deployed, the token holders will decide the future of the network.&lt;/p&gt;

&lt;h1&gt;
  
  
  Comparison Between Polkadot and Ethereum
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Polkadot Smart Contract&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Polkadot.network does not inherently support smart contracts. &lt;/p&gt;

&lt;p&gt;But, it has parachains that do support smart contracts. Parachains are parallel chains that contain their runtime logic. These parallel chains benefit from shared security and cross-chain messaging. These two facilities are provided to the parachains by the Polkadot relay chain.&lt;/p&gt;

&lt;p&gt;Systems involving parachains provide three options to deploy an application. First, it can be deployed as a smart contract on an existing parachain. Secondly, it can be deployed as the application’s parachain. Or, it can be deployed as a parathread. Each of these avenues of deploying an application has its own merits and demerits.&lt;/p&gt;

&lt;p&gt;One of the most notable advantages of smart contracts is that they exist on a single chain. Since they exist on a single chain they can be exchanged with other smart contracts on the same blockchain. Undoubtedly, this interoperability is a great quality possessed by smart contracts. But, at the same time, smart contracts are always dependant on the characteristics of the host chain. They can not go beyond the tenets of the host chain.&lt;/p&gt;

&lt;p&gt;Parachains are better in this aspect. They provide a significant amount of control over the design as well as over the features of the application.&lt;/p&gt;

&lt;p&gt;Features that can be developed on a parachain or a parathread include a custom fee structure, a custom monetary policy, treasury, and a governance mechanism. Custom monetary policies can be applied for both the native token and the local economy. The treasury is funded by the transitions in the state function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethereum Smart Contract&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Ethereum protocol, Smart contracts refer to codes. These codes run on Ethereum. Despite being codes, they are called contracts because through these codes valuable things are controlled. These valuable things can either be ETH tokens or other types of digital assets.&lt;/p&gt;

&lt;p&gt;The job of the Smart Contracts on Ethereum is to guarantee that the codes provide the same results to anyone who runs them. These contracts are deployed for a variety of purposes. One of them is to create a wide range of DApps or decentralized apps. These DApps include games, digital collectibles, online-voting systems, financial products, et al.&lt;/p&gt;

&lt;p&gt;Smart contracts on Ethereum are capable of holding the value. They are unlocked only when the conditions specified on the contracts are met.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Polkadot Programming Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Polkadot uses a wide variety of programming languages including Rust and JavaScript. At present, the leading implementation is built on Rust. It is complemented by the use of the substrate framework.&lt;/p&gt;

&lt;p&gt;It’s important to mention here that substrate bundles several core essentials together including the consensus layer, networking protocol, Wasm interpreter, and runtime modules. The runtime modules are also known as pellets.&lt;br&gt;
These core essentials help developers to build an entire blockchain from scratch with much ease. One of the other five teams deployed in the development of Polkadot, Parity technologies, is developing a language called Ink. Ink is a domain-specific language. It is built in Rust and is used to write Smart Contracts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethereum Programming Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developers often suffer from the misconception that one must write smart contracts to build on Ethereum. On the contrary, one may participate in the Ethereum protocol through a host of programming languages. These languages include Java, Python, Javascript, Go, Rust, .NET, and Delphi.&lt;/p&gt;

&lt;p&gt;The Ethereum community is open-source. In a wide variety of languages, one can implement APIs, development frameworks, testing tools, etc.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Community of Polkadot and Ethereum
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Polkadot: Companies Involved&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A host of teams are joining the Polkadot.network. These teams include Edgeware, Centrifuge, Acala, Polymath, ChainLink, Katal, ChainX, Laminar, Energy Web Foundation, Dock, Ocean Protocol, etc.&lt;/p&gt;

&lt;p&gt;It would be relevant to mention in this context that on October 15th, 2020 Interlay announced introducing Polkadot’s first trustless wrapped Bitcoin, PolkaBTC. However, the implementation will take place in early 2021 only.&lt;br&gt;
This introduction of bitcoin will be a very significant step towards interoperability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ethereum: Companies Involved&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ethereum is undoubtedly one of the best available blockchain protocols. Adoption, scalability, and support all these three features make Ethereum a lucrative option for enterprise business solutions.&lt;/p&gt;

&lt;p&gt;The number of cryptocurrencies available on the Ethereum blockchain is more than 2,000. More than 2,500 dApps have been built so far on the Ethereum blockchain. The Ethereum Enterprise Alliance has more than 450 members. These include some of the topmost global companies including Microsoft, JPMC, Santander, Accenture, ING, Intel, Cisco, et al.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ethereum 2.0
&lt;/h1&gt;

&lt;p&gt;Ethereum 2.0 is the Ethereum upgrade that everyone related to the world of crypto is eagerly waiting for. Ethereum 2.0 upgrade is expected to provide the scalability and the security that the protocol needs to serve on a much larger scale. The first phase of this upgrade is called Phase 0 and is expected to be ready by the end of this year.&lt;br&gt;
Ethereum 2.0 will be better in many ways. It will cut down on the consumption of energy. It will allow the network to process an increased number of transactions.&lt;br&gt;
With this upgrade, Ethereum will become a PoS blockchain. In other words, it will start following the Proof of Stake consensus mechanism. In Ethereum 2.0 shard chains will also be introduced.&lt;/p&gt;

&lt;p&gt;However, it is extremely important to remember that all these changes in the new upgrade are specific to Ethereum’s infrastructure. Those who hold ETH or those who use or develop dApps have nothing to be concerned about. The upgrade will be compatible with the main network that one uses at present.&lt;br&gt;
Currently, Phase 0 of the upgrade is in the testing stage. However, since it’s not a sequential process, multiple teams are working on several other phases simultaneously. Overall, the upgrade won’t be ready until 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nownodes.io"&gt;NOWNodes&lt;/a&gt; — Blockchain APIs for developers. Get your free API key NOW!&lt;/p&gt;

</description>
      <category>ethereum</category>
      <category>blockchain</category>
      <category>polkadot</category>
      <category>crypto</category>
    </item>
    <item>
      <title>How to make a Bitcoin transaction with Python</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Wed, 22 Jul 2020 11:08:50 +0000</pubDate>
      <link>https://dev.to/nownodes/how-to-make-a-bitcoin-transaction-with-python-54k4</link>
      <guid>https://dev.to/nownodes/how-to-make-a-bitcoin-transaction-with-python-54k4</guid>
      <description>&lt;p&gt;In the last article, we learned about &lt;a href="https://nownodes.io/blog/bitcoin-hierarchical-deterministic-wallet-in-python"&gt;creating Bitcoin HD wallets&lt;/a&gt;. Today, we will talk about how to create, sign, and broadcast a Bitcoin transaction using Python.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisite
&lt;/h1&gt;

&lt;p&gt;We will be using bit python library, one of the fastest and easiest libraries to develop Bitcoin related applications. To install bit use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install bit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating a Bitcoin wallet (Testnet)
&lt;/h1&gt;

&lt;p&gt;For this tutorial, we will create a Bitcoin testnet wallet. Because we will be creating transactions and sending bitcoins, so we don’t want you to lose your real bitcoins.&lt;/p&gt;

&lt;p&gt;Bitcoin Testnet is a network that simulates the original Bitcoin network but does not have any monetary value. Testnet has test bitcoins. Therefore, do not send you real bitcoins to testnet address, you will lose them.&lt;/p&gt;

&lt;p&gt;So, let’s create a simple testnet wallet. For this, create a simple python file transaction.py and copy and paste the code below.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from bit import PrivateKeyTestnet&lt;br&gt;
my_key = PrivateKeyTestnet()&lt;br&gt;
print(my_key.version)&lt;br&gt;
print(my_key.to_wif())&lt;br&gt;
print(my_key.address)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This code will create a simple wallet and print wif (&lt;a href="https://en.bitcoin.it/wiki/Wallet_import_format"&gt;Wallet Import Format&lt;/a&gt;). Using this wif we can get our wallet again.&lt;/p&gt;

&lt;p&gt;Otherwise my_key = PrivateKeyTestnet() will generate a new wallet every time.&lt;/p&gt;

&lt;p&gt;Therefore, replace my_key = PrivateKeyTestnet() with my_key = PrivateKeyTestnet(‘wif’) once you get wif . This way, every time we re-run the above code, we will be using the same wallet.&lt;/p&gt;

&lt;h1&gt;
  
  
  Get Test Bitcoins
&lt;/h1&gt;

&lt;p&gt;Now, we need to get some test bitcoins, so we can send it to another wallet.&lt;/p&gt;

&lt;p&gt;To get testnet bitcoins, use &lt;a href="https://testnet-faucet.mempool.co/"&gt;this link&lt;/a&gt;. Enter the address generated by the above wallet. You can check your testnet transaction &lt;a href="https://blockstream.info/testnet/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the transaction is confirmed, you can also check your balance using&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print(my_key.balance_as('usd'))&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Note: Testnet bitcoins do not have any monetary value.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating Transaction
&lt;/h1&gt;

&lt;p&gt;Now we are ready to create a transaction. But wait, we need a receiver address, otherwise, where will we send the transaction. You can create another wallet using the method mentioned above. However, for brevity, we will use the following testnet address.&lt;/p&gt;

&lt;p&gt;Note: The address below is a Bitcoin testnet address, do not send real bitcoin on this address.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkH41dfD4S8DEoSfcVSvEfpyZ9siogWWtr&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now, we have everything, so we are ready to create a Bitcoin transaction.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tx_hash = my_key.send([('mkH41dfD4S8DEoSfcVSvEfpyZ9siogWWtr', 1, 'usd')])&lt;br&gt;
print(tx_hash)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Yes, using bit we can create, sign, and broadcast transactions using just one command. In addition, &lt;a href="https://ofek.dev/bit/dev/api.html#bit.PrivateKey.send"&gt;send()&lt;/a&gt; method takes an array as a parameter. This means you can create and send multiple transactions in one go.&lt;/p&gt;

&lt;p&gt;The code above will print a transaction hash, which we can check on the &lt;a href="https://blockstream.info/testnet/"&gt;Bitcoin testnet block explorer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the transaction is confirmed you can recheck the balance of your wallet using.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print(my_key.get_balance())&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;For further reading, check out the &lt;a href="https://ofek.dev/bit/"&gt;bit documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>blockchain</category>
      <category>bitcoin</category>
    </item>
    <item>
      <title>Monero: How to Check Balance
</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Thu, 16 Jul 2020 13:19:11 +0000</pubDate>
      <link>https://dev.to/nownodes/monero-how-to-check-balance-p24</link>
      <guid>https://dev.to/nownodes/monero-how-to-check-balance-p24</guid>
      <description>&lt;p&gt;Monero is a privacy-by-design cryptocurrency made up using the CryptoNote protocol. This protocol was developed by Nicolas van Saberhagen, an anonymous author of whom nothing is known about.&lt;/p&gt;

&lt;h1&gt;
  
  
  A Top-Level View on Monero
&lt;/h1&gt;

&lt;p&gt;To stay privacy-centric, Monero makes use of various cryptographic primitives: ring signatures, stealth addresses, Pedersen commitments, and more. Working together, they empower the protocol with two distinctive features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Untraceability: for every incoming transaction, all possible senders are equally likely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unlinkability: for any two outgoing transactions, it is impossible to prove that they were sent to the same person.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Practically it means two things: transacting parties remain anonymous, and transaction details and wallet balances are concealed from the general public. Being an outstanding feature in the cryptocurrency world, it brings in some difficulties. One of them is connected with the idea of Monero Block Explorer, as transaction details are hidden for anyone looking on the block explorer with only the Monero address. &lt;/p&gt;

&lt;h1&gt;
  
  
  Two sets of keys
&lt;/h1&gt;

&lt;p&gt;The thins is that Monero has two sets of keys: view keys and spend keys.&lt;/p&gt;

&lt;p&gt;Public View and Public Spend keys&lt;/p&gt;

&lt;p&gt;These keys are generated in each Monero public address. They are public required to send and receive XMR on the Monero network.&lt;/p&gt;

&lt;p&gt;Private View and Private Spend keys&lt;/p&gt;

&lt;p&gt;Private Spend keys are like any other private key in cryptocurrency and should not be shared with anyone. These keys provide control of your funds and should be treated with maximum possible care.&lt;/p&gt;

&lt;p&gt;To be precise, Private View keys serve an additional function. Monero’s blockchain is to be private-by-design, but can optionally be transparent. This is where the Private View key plays a role, as sharing it along with your address can display all incoming transactions to this address.&lt;/p&gt;

&lt;h1&gt;
  
  
  Checking balance with NOWNodes
&lt;/h1&gt;

&lt;p&gt;Here is a step by step guide, that can be used right away in Postman.&lt;/p&gt;

&lt;p&gt;First, you need to execute xmr.nownodes.io/xmr/account&lt;/p&gt;

&lt;p&gt;The request body is:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
"API_key": "your_API_key",&lt;br&gt;
  "address": "your_address"&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Using ZwmbBjvevr4JeRgeATb7Y3Ad as API key (hereinafter), you get:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
    "id": "5efe03e5d56367002093e1a2",&lt;br&gt;
    "address": "your_address",&lt;br&gt;
    "isCreated": false,&lt;br&gt;
    "isResynced": false,&lt;br&gt;
    "createdAt": 1593705445,&lt;br&gt;
    "resyncedAt": 0&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Second, make a resynchronization xmr.nownodes.io/xmr/resync&lt;/p&gt;

&lt;p&gt;In case you use an old address, this endpoint help to look through the last 10,000 blocks.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
  "API_key": "your_API_key",&lt;br&gt;
  "address": "your_address",&lt;br&gt;
  "viewKey": "your_viewKey"&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And you get:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
    "request_fulfilled": true,&lt;br&gt;
    "status": "Updating account with for importing recent txs successeful."&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Third, check your balance xmr.nownodes.io/xmr/balance&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
  "API_key": "your_API_key",&lt;br&gt;
  "address": "your_address",&lt;br&gt;
  "viewKey": "your_viewKey"&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And you get:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
    "blockchain_height": 2133546,&lt;br&gt;
    "locked_funds": "0",&lt;br&gt;
    "new_address": false,&lt;br&gt;
    "scanned_block_height": 2133546,&lt;br&gt;
    "scanned_block_timestamp": 1593700334,&lt;br&gt;
    "scanned_height": 0,&lt;br&gt;
    "spent_outputs": [],&lt;br&gt;
    "start_height": 2133543,&lt;br&gt;
    "status": "success",&lt;br&gt;
    "total_received": "0",&lt;br&gt;
    "total_sent": "0"&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And so here you are. &lt;/p&gt;

&lt;p&gt;NOWNodes is a modern user-friendly platform from the creators of &lt;a href="https://changenow.io"&gt;ChangeNOW&lt;/a&gt; that offers secure access to full nodes of various cryptocurrencies, including Monero. Besides, we provide access to block explorers, including Monero explorer, and have a free plan for up to 20,000 requests per day — that makes us a unique and trusted partner. Let’s work together — &lt;a href="//mailto:partners@nownodes.io"&gt;just drop us a line&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>monero</category>
      <category>api</category>
      <category>wallet</category>
    </item>
    <item>
      <title>Bitcoin Wallet in Python</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Tue, 14 Jul 2020 15:40:46 +0000</pubDate>
      <link>https://dev.to/nownodes/bitcoin-wallet-in-python-1idb</link>
      <guid>https://dev.to/nownodes/bitcoin-wallet-in-python-1idb</guid>
      <description>&lt;p&gt;In this article, we will create a bitcoin HD (Hierarchical Deterministic) wallet using python language. To learn how HD wallet works, you can check &lt;a href="https://medium.com/@harshagoli/hd-wallets-explained-from-high-level-to-nuts-and-bolts-9a41545f5b0"&gt;this&lt;/a&gt; article.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisite
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Basic understanding of programming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Download and install python’s latest version from its &lt;a href="https://www.python.org/downloads/"&gt;official website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We need to install a python library called &lt;a href="https://pypi.org/project/bitcoinlib/#description"&gt;bitcoinlib&lt;/a&gt; to create and manage bitcoin wallets. To install the library run following command.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install bitcoinlib&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Bitcoin HD Wallet with Python
&lt;/h1&gt;

&lt;p&gt;Using HD wallets, we can generate a complete suite of crypto wallets for different cryptocurrency networks using just one seed. However, in today’s article, we will only focus on Bitcoin and how to create a simple HD wallet.&lt;/p&gt;

&lt;p&gt;So let’s create our first Bitcoin HD wallet.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from bitcoinlib.wallets import HDWallet&lt;br&gt;
wallet = HDWallet.create('Wallet1')&lt;br&gt;
key1 = wallet.new_key()&lt;br&gt;
print(key1.address)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;In the above script, we are performing the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Importing bitcoinlib library&lt;/li&gt;
&lt;li&gt;create a new wallet&lt;/li&gt;
&lt;li&gt;Generating a new HD Key.&lt;/li&gt;
&lt;li&gt;Create a new address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To run the above program, save it in a file with .py extension. (Ex- hd_wallet1.py). Then run that file using the command below.&lt;/p&gt;

&lt;h1&gt;
  
  
  Bitcoin HD Wallet with Mnemonics
&lt;/h1&gt;

&lt;p&gt;Mnemonics are very popular because they are easy to remember. Let’s see how to create a Bitcoin wallet using mnemonics.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;from bitcoinlib.wallets import HDWallet, wallet_delete&lt;br&gt;
from bitcoinlib.mnemonic import Mnemonic&lt;br&gt;
passphrase = Mnemonic().generate()&lt;br&gt;
print(passphrase)&lt;br&gt;
wallet = HDWallet.create("mWallet1", keys=passphrase, network='bitcoin')&lt;br&gt;
key1 = wallet.new_key()&lt;br&gt;
print(key1.address)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;In the above script, we are performing the following steps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Importing relevant classes from bitcoinlib&lt;/li&gt;
&lt;li&gt;Generating a random mnemonic, you can pass your own&lt;/li&gt;
&lt;li&gt;Creating a new wallet named mWallet1&lt;/li&gt;
&lt;li&gt;Generating keys&lt;/li&gt;
&lt;li&gt;Getting bitcoin public address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To run this program, save it in a file with .py extension. (Ex- hd_wallet2.py). Then run that file using the command below.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python hd_wallet2.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To learn more about the bitcoinlib library check out the &lt;a href="https://bitcoinlib.readthedocs.io/en/latest/"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note: Never post your keys or mnemonic publically.&lt;/p&gt;

</description>
      <category>bitcoin</category>
      <category>python</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>How Bitcoin Works</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Tue, 16 Jun 2020 11:12:28 +0000</pubDate>
      <link>https://dev.to/nownodes/how-bitcoin-works-5hm0</link>
      <guid>https://dev.to/nownodes/how-bitcoin-works-5hm0</guid>
      <description>&lt;p&gt;Due to the frequent questions about the inability to send payments “although there are assets on the balance”, we decided to describe the principle of operation of the Bitcoin network (and similar Litecoin, Dash, Dogecoin, etc.) in a clear way. Even if you already have an idea of “how it works”, we strongly recommend you to read this article and to “refresh” your knowledge. Perhaps you will learn something new for yourself or “sort out” what you have already known.&lt;/p&gt;

&lt;p&gt;First, some maths (simplified)… If you take any (generate) a very large number (let’s call it a “private key”), then, using a certain (publicly-known) algorithm, you can find a very large number corresponding to it (the”public key”). There is no reverse algorithm. You can’t get a private key from a public key! The private key must always be known only to the owner. The public key is shared with everyone. The peculiarity of this pair of numbers is that if the message (data set) is “signed” (calculate the signature) with a private key, then this signature can be easily verified. by the single public key. It proves that the message has been created by the owner of this key pair. The Bitcoin address (simplified) is the public key.&lt;/p&gt;

&lt;p&gt;Key point: as the owner of the address, you can sign messages “on behalf of the address”.&lt;/p&gt;

&lt;p&gt;When you create a new address in the app, a private key is actually generated for you, and the public key and address are generated from it. It is very unlikely (almost impossible) that you will come across a pair of keys that have already been issued to someone before. Deleting an app or damaging its files usually leads to the loss of the private key, which means that the assets which are located at this address are lost.&lt;/p&gt;

&lt;p&gt;Like any network, the Bitcoin blockchain network consists of connected devices running special software. Each such device (a part of the blockchain network) is usually called a “node”. All nodes are equal in rights. Very powerful nodes can “mine” (see below).&lt;/p&gt;

&lt;p&gt;Each node stores a copy of the network database (ledger). The ledger consists of entries. You can add new entries to this ledger only. You cannot edit or delete existing records. Each entry is data about “sending” and/or “receiving” assets from an address to an address.&lt;/p&gt;

&lt;p&gt;Key point: the ledger doesn’t store the address balance. The ledger stores all deposits (“outputs”) and all debits (“inputs”) addresses.&lt;/p&gt;

&lt;p&gt;For example: Address A: received X1, received X2, sent Y1, received X3, sent Y2..&lt;/p&gt;

&lt;p&gt;Key point: the current address balance is the sum of all outputs minus the sum of all inputs (see above).&lt;/p&gt;

&lt;p&gt;For example: x came to address A (for all the time), and y left. This means that the address balance is equal to X — Y.&lt;/p&gt;

&lt;p&gt;When you send assets, the app generates a message — “transaction”, which contains outputs in the format “address, output” for withdrawal (spending) and inputs in the format “address, amount” for receiving.&lt;/p&gt;

&lt;p&gt;Note that the transaction sum must not be more than or equal to the received sum. The difference between the withdrawn and the deposited is called ” transaction fee “and it goes to the” miners ” (see below). Theoretically, you can create a transaction with fee = 0, and this will not be an error. If the transaction fee is higher than the desired sum, the unspent (“change”) is taken back by adding an entry to the list of inputs. The transaction has a size. More items in the lists means more data and longer transactions.&lt;/p&gt;

&lt;p&gt;For example: Address A: exit X1 for the sum of “1”, exit X2 for the sum of”2″. Balance A = 1 + 2 = 3. You need to transfer the sum “2”to address B. Output X1 is not enough, we need the sum of output X2.&lt;/p&gt;

&lt;p&gt;Initially, the transaction looks like this: outputs: “Address A, X2″, inputs:”Address B, 2”. Debited “2”, deposited “2”. This transaction has a fee = “2–2” = “0”. Miners are not likely to appreciate this. Let’s add a fee = “0.001”. Output X2 is fully used, so we use another output X1.&lt;/p&gt;

&lt;p&gt;Initially, the transaction looks like this: outputs: “Address A, X2″, inputs:”Address B, 2”. Debited “3”, deposited “2”. This transaction has a fee = “3–2” = “1”. This is more than needed. Let’s return the change = “1–0.001” = “0.999”.&lt;/p&gt;

&lt;p&gt;Initially, the transaction looks like this: outputs: “Address A, X2″, inputs:”Address B, 2”. Debited “3”, deposited “2”. This transaction has a fee = “3–2.999” = “0.001”. Now that’s all right! Let’s note that, although the deposited sum is “2.999”, it includes our “0.999” change, which will be returned to us and will not be spent actually.&lt;br&gt;
Key point: transactions spend the entire output. You can not spend a part of the output, but you can return the “overspent” through the change.&lt;/p&gt;

&lt;p&gt;Key point: you cannot create more transactions than there are outputs. The maximum: one output = one transaction. But you can have one output = multiple inputs (recipients).&lt;/p&gt;

&lt;p&gt;Key point: the solution is any transfer (arrival) of assets, including the change.&lt;/p&gt;

&lt;p&gt;A transaction generated and signed with “private keys” can be sent via any node. The node checks whether the signature is valid, whether it is formed correctly, and whether outputs are available. Then, the transaction is placed in the ”mempool” — the storage of new (unprocessed) transactions. Transactions located in mempool are visible to all nodes. From this point on, all outputs used in this transaction are considered used or “spent” and cannot be used in other transactions.&lt;/p&gt;

&lt;p&gt;Adding new entries to the ledger occurs in batches (blocks) of several thousand at once. Blocks are formed by nodes — “miners”. Blocks have a size limit. You can’t create a block larger than the maximum size. A few (thousands) transactions from the mempool are combined into one unit, then the “mining” starts. Mining is the search for a specific block hash using a matching method. The first one to “mine” the block gives it to the other nodes for verification. Each node compares the block entries with previous entries in its ledger. They should not conflict. If the block passes verification, it is added entirely to the ledger of this node. Each node only works with its own ledger.&lt;/p&gt;

&lt;p&gt;Key point: each node works independently with its own ledger.&lt;/p&gt;

&lt;p&gt;If a block is not accepted on some nodes, then there is some discrepancy in ledgers or a “separate version of the blockchain”. In this case, the nodes are synchronised, and the most common version “wins”. Due to the possibility of desynchronisation, to make sure that the block and all transactions in it are included in the correct version of the blockchain, the final confirmation requires several more blocks after the current one&lt;/p&gt;

&lt;p&gt;Key point: transactions are confirmed when new blocks appear after their block.&lt;br&gt;
Key point: you can use the outputs from the confirmed transactions only.&lt;/p&gt;

&lt;p&gt;For the correct block, the miner receives a fixed fee, plus the sum of all fees for all transactions in this block. It makes sense that the most profitable way is to form a block of transactions with the maximum fee, so the reward will be bigger. But you also need to remember: the block size is fixed, so you also need to look at the transaction length. In fact, it is most profitable to include transactions in which the “density fee ” (fee per unit of information) is higher. This indicator was called “sat/B” (Satoshi per byte). It is equal to “fee in Satoshi “divided by “transaction length”.&lt;/p&gt;

&lt;p&gt;Key point: nobody knows how the miner selects transactions from the mempool. There is no way to force the miner to select your transaction. But for the miner it is more profitable to primarily take transactions that have a higher sat/B score.&lt;/p&gt;

&lt;p&gt;Key point: if you want your transactions to get into the block more quickly (i.e., be confirmed), set a fee that makes your transaction’s sat/B score higher than the average for the mempool.&lt;/p&gt;

&lt;p&gt;If everyone simultaneously wants their transactions to go faster (for example, because of a great rise in value), then everyone will increase the sat/b value. This means it may vary depending on the network load. This is a difficult choice between the speed and the transaction fee.&lt;/p&gt;

&lt;p&gt;The Best Example&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have the address A. There are no exits on it. Its balance = 0 BTC.&lt;/li&gt;
&lt;li&gt;1 BTC is sent to your address A (this means that the transaction for this sum is confirmed). Now it has one output per 1 BTC Its balance = 1 BTC.&lt;/li&gt;
&lt;li&gt;0.2 BTC is sent to your address A. Now it has outputs: 1 BTC and 0.2 BTC. Its balance = 1.2 BTC.&lt;/li&gt;
&lt;li&gt;You make a transfer from address A to address B in the sum of 0.3 BTC. To make it simple, the fee = 0.&lt;/li&gt;
&lt;li&gt;Understandably, the output of 0.2 BTC is not enough, so we use 1 BTC.&lt;/li&gt;
&lt;li&gt;This means that the transaction will have an output of “1 BTC” and inputs “address B, 0.3 BTC”, “address A(unspent), 0.7 BTC”.&lt;/li&gt;
&lt;li&gt;Immediately after sending and placing it in the mempool, only one output to 0.2 BTC will remain on your address, because the output to 1 BTC has been just used (spent) in the transaction. From now on, the “available” balance of your address = 0.2 BTC.&lt;/li&gt;
&lt;li&gt;The unspent of 0.7 will not be returned until the confirmation of the transaction. This means this sum cannot be used.&lt;/li&gt;
&lt;li&gt;In theory, you have 0.2 + 0.7 = 0.9 BTC, but in practice you can’t use these 0.7 BTC.&lt;/li&gt;
&lt;li&gt;This means that you will not be able to transfer even 0.20000001 BTC immediately after sending it.&lt;/li&gt;
&lt;li&gt;Your 0.7 BTC will be “frozen” before the confirmation of your transaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;General Conclusion&lt;/p&gt;

&lt;p&gt;How to make everything “run like clockwork” without problems?&lt;/p&gt;

&lt;p&gt;1) Have more outputs. This means you should either send multiple transactions to your address, or have more addresses.&lt;br&gt;
2) Use fewer outputs. This means you should make fewer transactions, but with more recipients in a single transaction.&lt;br&gt;
3) Make actions to get your exchange faster. In other words, set a fee so that the sat/B indicator will be currently competitive in the mempool.&lt;/p&gt;

</description>
      <category>bitcoin</category>
      <category>blockchain</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HOW to create Dogecoin Crypto Wallet</title>
      <dc:creator>NOWNodes</dc:creator>
      <pubDate>Wed, 03 Jun 2020 14:07:46 +0000</pubDate>
      <link>https://dev.to/nownodes/how-to-create-dogecoin-crypto-wallet-552b</link>
      <guid>https://dev.to/nownodes/how-to-create-dogecoin-crypto-wallet-552b</guid>
      <description>&lt;p&gt;Today I’m going to tell you about the steps and the issues I faced while creating the Dogecoin Crypto Wallet (hereinafter DOGE). Technically, it is necessary to develop a website where users can create wallets for themselves, receive, store, and send DOGE.&lt;/p&gt;

&lt;p&gt;The simplest and most relevant solution, as it seems, is to buy a dedicated server, run Dogecoin nodes (node) on it, and connect to it locally via RPC. But this option initially did not work out for 2 reasons.&lt;/p&gt;

&lt;p&gt;Firstly, due to the cost of the server, a server with the necessary parameters costs about $50 per month. This project was not originally intended to be commercial. It was designed to be free for users, so the cost of its maintenance should be minimal.&lt;/p&gt;

&lt;p&gt;Secondly, node support requires a qualified specialist in this field, and this is also an additional cost. We tried using our own resources to raise the Dogecoin node, but it was extremely unstable – it often hung up or appeared out of sync with the main network, and this, of course, frustrated us.&lt;/p&gt;

&lt;p&gt;To work with a foreign node there are three questions have to be answered:&lt;/p&gt;

&lt;p&gt;1) How to create addresses and where to store keys?&lt;/p&gt;

&lt;p&gt;2) How to receive new transactions?&lt;/p&gt;

&lt;p&gt;3) How to generate new transactions?&lt;/p&gt;

&lt;p&gt;The first question was not so simple. After reading tons of articles and checking megabytes of codes (not only in PHP), a set of libraries was compiled that made it possible to generate a key pair and an address.&lt;/p&gt;

&lt;p&gt;The second question was the simplest. To find out which transaction is confirmed, you need to look at the new blocks. How to receive new blocks? Using the “slowness” of the blockchain, you can interrogate a node with some periodicity (even once a minute). And if a new block appears, request its contents from the node. Even if the transaction is received 2 minutes later, no one will complain, and given the need for several confirmations, this will be generally imperceptible.&lt;/p&gt;

&lt;p&gt;The solution to the third question required a huge amount of time and effort. There was no ready-made solution. Transaction formation is described many times, but without examples. And those examples that existed- contained only the simplest options. It’s good that Dogecoin is built on the principle of Bitcoin. Most of the information was obtained from there, as it turned out, the formation of an optimal transaction is a complex process. To get a low commission, the transaction length should be as short as possible, so, we need an algorithm that selects from a dozen outputs those that will give the minimum “change”, and this change cannot be less than dust! Debugging and testing this algorithm took several months.&lt;/p&gt;

&lt;p&gt;Now back to the issue of connecting to the blockchain.&lt;/p&gt;

&lt;p&gt;The first implementation option is node rental. The search returned several options, but all of them are either non-Dogecoin or costing several hundred dollars a month.&lt;/p&gt;

&lt;p&gt;The second option is to connect via the API block explorer. A search on the “Dogecoin blockexplorer API” returned the following options:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sochain.com/DOGE:"&gt;https://www.sochain.com/DOGE:&lt;/a&gt; and &lt;a href="https://chain.so/DOGE/:"&gt;https://chain.so/DOGE/:&lt;/a&gt; – this is the same resource from Block.io, Inc., there is an API &lt;a href="https://sochain.com/api"&gt;https://sochain.com/api&lt;/a&gt; but it works only from the browser! Site protection does not miss calls from the script. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://blockchair.com/dogecoin:"&gt;https://blockchair.com/dogecoin:&lt;/a&gt; is a powerful resource. Cons – the difficulty of getting an API key for free and the high cost of a paid one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://doge.tokenview.com/:"&gt;https://doge.tokenview.com/:&lt;/a&gt; 500 Internal Server Error&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cryptoapis.io/:"&gt;https://cryptoapis.io/:&lt;/a&gt; Limit of 500 calls per day&lt;/p&gt;

&lt;p&gt;&lt;a href="https://live.blockcypher.com/doge/"&gt;https://live.blockcypher.com/doge/&lt;/a&gt; – a great resource! Original transaction signing technique. Cons: limits on the number of API calls per minute, node desync (transactions sent through them are not visible to other nodes). The initial study we did here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dogeblocks.com/:"&gt;https://dogeblocks.com/:&lt;/a&gt; Insight was originally here with its API – a great free resource! We used it for a long time. But then it “died” and did not work for several months. And now there is a Blockbook that can’t give UTXO to several addresses at once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dogechain.info/:"&gt;https://dogechain.info/:&lt;/a&gt;  – also a resource from Block.io, Inc. Free, but limited API &lt;a href="https://dogechain.info/api/blockchain_api:"&gt;https://dogechain.info/api/blockchain_api:&lt;/a&gt; there is no “get block transactions” and there is no “get UTXO at multiple addresses”. For a while, it was the only resource on the network through which we could “communicate” with Dogecoin. To get the block transactions, I even had to parse the HTML page.&lt;/p&gt;

&lt;p&gt;Everything was unstable, and so, once, one of the users advised the resource &lt;a href="http://nownodes.io/"&gt;http://nownodes.io/&lt;/a&gt;  This resource provides rental nodes. Most of them have the Blockbook API installed. We contacted representatives and were given a key. Since then we have been working with them.&lt;/p&gt;

&lt;p&gt;In a nutshell:&lt;/p&gt;

&lt;p&gt;To create a web wallet, the following APIs are minimally required:&lt;/p&gt;

&lt;p&gt;1) Get the last (maximum) block number in the network&lt;/p&gt;

&lt;p&gt;2) Get the content/data (not only txid) of all transactions of the block&lt;/p&gt;

&lt;p&gt;3) Get a balance of one address and several addresses (not available in Blockbook)&lt;/p&gt;

&lt;p&gt;4) Get a UTXO list of one address and several addresses (not available in Blockbook)&lt;/p&gt;

&lt;p&gt;5) Send the generated and signed transaction to the network&lt;/p&gt;

&lt;p&gt;P.S. As it turned out, just sending a transaction to the network is not enough! Even if the node returned a positive response (no error), this does NOT mean that the transaction has entered mempool. Some time after sending it is necessary to check “does the transaction exist?” Sometimes it just disappears! We still do not understand the reason behind this.&lt;/p&gt;

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