<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blockchain on HecMisio's Blog</title><link>https://blog.hecmisio.com/tags/blockchain/</link><description>Recent content in Blockchain on HecMisio's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 27 Mar 2025 16:28:27 +0800</lastBuildDate><atom:link href="https://blog.hecmisio.com/tags/blockchain/index.xml" rel="self" type="application/rss+xml"/><item><title>Exploring Foundry Cheatcodes</title><link>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_3/</link><pubDate>Thu, 27 Mar 2025 16:28:27 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_3/</guid><description>&lt;p&gt;Foundry is a powerful tool for Ethereum smart contract developers, and its Cheatcodes feature provides great convenience for development and testing. Whether it&amp;rsquo;s simulating the blockchain environment, manipulating contract states, or quickly debugging complex logic, Cheatcodes can help developers achieve twice the result with half the effort. In this article, we will explore the various Cheatcodes provided by Foundry, explaining their uses and usage methods one by one, to help you write and debug Solidity smart contracts more efficiently.&lt;/p&gt;</description></item><item><title>Exploring Chainlink</title><link>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_2/</link><pubDate>Wed, 26 Mar 2025 10:24:07 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_2/</guid><description>&lt;p&gt;In the world of blockchain, smart contracts are a powerful tool that can be automatically executed when certain conditions are met. However, blockchain itself is a closed system and cannot directly access off-chain data, such as prices in financial markets, weather information, or random numbers. This limitation restricts the application scope of smart contracts.&lt;/p&gt;&#10;&lt;h2 id="what-is-an-oracle"&gt;What is an Oracle?&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Oracles&lt;/strong&gt; are the key to solving this problem. Oracles act as a bridge between the blockchain and the outside world, capable of introducing off-chain data onto the blockchain or transmitting on-chain events to off-chain systems. However, building an oracle system is no easy task, as it must ensure that it does not undermine the decentralization and data security of the chain. How can the source of data be guaranteed to be decentralized? How can the authenticity and reliability of the data be ensured? How can the high availability of the service be guaranteed?&lt;/p&gt;</description></item><item><title>Solidity Basics</title><link>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_1/</link><pubDate>Fri, 21 Mar 2025 13:15:41 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/ethereum/solidity/chapter_1/</guid><description>&lt;h2 id="data-types"&gt;Data Types&lt;/h2&gt;&#10;&lt;p&gt;Solidity offers a variety of data types to meet the different needs of smart contract development. The following are some common data types:&lt;/p&gt;&#10;&lt;table&gt;&#10;&lt;tr&gt;&#10; &lt;th&gt;Category&lt;/th&gt;&#10; &lt;th&gt;Data Type&lt;/th&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td&gt;Value Type&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;bool&lt;/code&gt;, &lt;code&gt;int[8-256]&lt;/code&gt;, &lt;code&gt;uint[8-256]&lt;/code&gt;, &lt;code&gt;address&lt;/code&gt;, &lt;code&gt;bytes[1-32]&lt;/code&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td&gt;Reference Type&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;string&lt;/code&gt;, &lt;code&gt;bytes&lt;/code&gt;, &lt;code&gt;array&lt;/code&gt;, &lt;code&gt;mapping&lt;/code&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;tr&gt;&#10; &lt;td&gt;Special Type&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;enum&lt;/code&gt;, &lt;code&gt;struct&lt;/code&gt;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;&lt;strong&gt;bytes[1-32], bytes and string&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;bytes[1-32]&lt;/code&gt; is a fixed-length byte array with a length range of 1 to 32 bytes. &lt;code&gt;bytes&lt;/code&gt; is a dynamic byte array, while &lt;code&gt;string&lt;/code&gt;, although essentially also a dynamic byte array, stores UTF-8 encoded character sequences and involves implicit UTF-8 encoding conversion operations. Therefore, if you need to store fixed-length byte data, such as hash values or identifiers, you can use &lt;code&gt;bytes[1-32]&lt;/code&gt;. For dynamic-sized byte data, such as file content or binary data, use &lt;code&gt;bytes&lt;/code&gt;. If it is text content, such as names or descriptions, use &lt;code&gt;string&lt;/code&gt;. Additionally, only &lt;code&gt;bytes&lt;/code&gt; has a &lt;code&gt;length&lt;/code&gt; attribute; to obtain the length of a &lt;code&gt;string&lt;/code&gt;, it needs to be converted to &lt;code&gt;bytes&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>A Brief Overview of All Common Consensus Algorithms</title><link>https://blog.hecmisio.com/posts/blockchain/chapter_2/</link><pubDate>Wed, 12 Mar 2025 13:15:05 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/chapter_2/</guid><description>&lt;h2 id="whats-a-consensus-algorithm"&gt;What&amp;rsquo;s A Consensus Algorithm?&lt;/h2&gt;&#10;&lt;p&gt;A consensus algorithm is a rule and protocol in a distributed system by which all nodes reach an agreement on a certain data state or transaction sequence.&lt;/p&gt;&#10;&lt;p&gt;In 1982, Leslie Lamport proposed the &amp;ldquo;&lt;a href="https://en.wikipedia.org/wiki/Byzantine_fault"&gt;Byzantine Generals Problem&lt;/a&gt;&amp;rdquo;, which studies how distributed systems can tolerate faults. The problem is set against the backdrop of a group of generals communicating through messengers to vote on whether to attack or retreat. Due to the possibility of traitors among the generals who may vote maliciously or impersonate other generals, or because messages may be lost or tampered with during transmission, the army ultimately fails to coordinate its actions.&lt;/p&gt;</description></item><item><title>Understand All Common Security Algorithms in One Article</title><link>https://blog.hecmisio.com/posts/blockchain/chapter_1/</link><pubDate>Sun, 09 Mar 2025 14:54:27 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/chapter_1/</guid><description>&lt;h2 id="information-security-issues"&gt;Information Security Issues&lt;/h2&gt;&#10;&lt;p&gt;When data is exchanged over the network, it passes through various network environments and devices. During the transmission process, it may pass through the devices of some malicious users, which could lead to the theft of the content. When transmitting data over the network, four main issues are usually considered.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Eavesdropping: Messages are eavesdropped on during transmission.&lt;/li&gt;&#10;&lt;li&gt;Impersonation: Falsely claiming to be the sender or recipient of a message.&lt;/li&gt;&#10;&lt;li&gt;Tampering: The message was tampered with during transmission.&lt;/li&gt;&#10;&lt;li&gt;Denial: The act of a message sender denying their own act of sending the message afterwards.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="content-image"&gt;&#10;&lt;img src="https://blog.hecmisio.com/posts/blockchain/images/chapter_1-main-problems.jpg" width="100%"&gt;&#10;&lt;p&gt;Main Problems&lt;/p&gt;&#10;&lt;/div&gt;</description></item><item><title>The Technical Principles and Development Status of Bitcoin</title><link>https://blog.hecmisio.com/posts/blockchain/bitcoin/chapter_1/</link><pubDate>Wed, 05 Mar 2025 14:25:18 +0800</pubDate><guid>https://blog.hecmisio.com/posts/blockchain/bitcoin/chapter_1/</guid><description>&lt;h2 id="monetary-systems-rely-on-trust"&gt;Monetary Systems Rely on Trust&lt;/h2&gt;&#10;&lt;p&gt;When we conduct cash transactions, we usually exchange money for goods directly. The currency is issued by the state and backed by the state&amp;rsquo;s credit, so everyone recognizes its value. There are also various anti-counterfeiting mechanisms to check the authenticity of the currency, which also ensures the security of the transaction. From this, it can be seen that the recognition of the currency&amp;rsquo;s value and its security in transactions are the basic elements for the currency to be used in transactions.&lt;/p&gt;</description></item></channel></rss>