<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jan Bernatik on Medium]]></title>
        <description><![CDATA[Stories by Jan Bernatik on Medium]]></description>
        <link>https://medium.com/@jan-bernatik?source=rss-677255cca6b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dC2-cOEhGLeotys_VEotgw.jpeg</url>
            <title>Stories by Jan Bernatik on Medium</title>
            <link>https://medium.com/@jan-bernatik?source=rss-677255cca6b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:46:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jan-bernatik/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to Flow Blockchain — part 4]]></title>
            <link>https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-4-f818b85a328f?source=rss-677255cca6b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f818b85a328f</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[flow-blockchain]]></category>
            <dc:creator><![CDATA[Jan Bernatik]]></dc:creator>
            <pubDate>Tue, 03 May 2022 01:23:26 GMT</pubDate>
            <atom:updated>2022-05-03T01:23:26.166Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Flow Blockchain — part 4</h3><p><a href="https://medium.com/@jan-bernatik/introduction-to-flow-blockchain-part-3-94484e57e5c4">Part 3 of this series</a> explains blockchain forks and the concept of block finalization. In this post we will finally look at block sealing, which is the last step in the block lifecycle. Before we go into block sealing, we need to explain data storage in Flow because it is the key to understanding what the block seal is good for and why it matters.</p><h3>Data Storage in Flow</h3><p>There are 2 data stores in which flow network stores data.</p><p>The <strong>Protocol State</strong> is the main blockchain itself, which stores data about the state of the network such as who is allowed to participate in the protocol, Collection Guarantees, Execution receipts, Result Approvals, and more.</p><p>The <strong>Execution State</strong> is a data structure called <a href="https://github.com/onflow/flow-go/tree/master/ledger">Memory-trie</a> (MTrie), containing all data that is manipulated via Cadence smart contracts (account token balances, NFTs, smart contracts deployed …). Whenever a collection is executed an updated MTrie is generated. The new state of the MTrie data can be referenced via single hash (root-node hash). This hash is the Execution Result that the execution node commits to (Execution commitment) which gets added to a block by the consensus leader so that it can be validated.</p><blockquote>💡 Flow is not informationally self-contained, which means that account information isn’t stored on the chain, but rather in the execution state.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnze8rOWVi66bVgWL27MHg.png" /></figure><h3>Block Sealing</h3><p>Block sealing is the last step in the block lifecycle. For the client that submitted a transaction, block seal is a guarantee that the execution result (state of their account after the execution) has been successfully verified. Note that the block containing the seal still needs to be finalized before it can be considered as committed to the chain.</p><p>Block Seal is added to the blockchain when sufficient Result Approvals has been collected for executed block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BJV2Jr6kX7ULgf9N3B0bg.png" /></figure><p>Let’s go through this final diagram.</p><ol><li>In View 1 Consensus leader A proposes block 0 (B0) to the network.</li><li>Execution nodes receive and execute B0 and sent Execution Receipts to the network.</li><li>In ideal scenario, Consensus Leader C receives an execution receipt to add the B0 execution result to block 2 (B2). This means that the Consensus leader C incorporated the execution result into B2, effectively committing the result of the execution of B0 (MTrie root hash) to the blockchain.</li><li>When block 3 (B3) is proposed by Consensus leader D, verification nodes can determine their chunk assignments using the source of randomness added to B3. Then the VNs request transactions for their chunks from collection nodes and start the verification of their assigned chunks. Note that the verification nodes wait until B3 is finalized, to avoid doing unnecessary work in the case when the chain forks and B3 ends up on a branch that will be discarded.</li><li>Verification nodes send their result approvals to the network when they are done with verifying their assigned chunks. Assuming consensus Leader H receives sufficient result approvals in view 8 it will create seal for B0 and add it to block 7 (B7).</li><li>Once B7 is finalized in block 10 (B10), block B0 is sealed and the seal is finalized.</li></ol><p>At this point, the user that submitted the transaction which was added to a collection included in block B0 can be certain that their transaction was executed and the result of the transaction execution is committed to the chain.</p><p>Simply said, this means that the result of the transaction will not change. If you were transferring the ownership of your car to a new owner, you can now hand them the keys, the car is theirs!</p><p>This is the end of the series, I hope this was fun!</p><p>If you have any questions, you can <a href="http://discordapp.com/users/Jan.#6550">ask me on Discord</a> or <a href="https://twitter.com/janbernatik">DM me on Twitter</a>.</p><p>There are also <a href="https://forum.onflow.org/">Flow forums</a> and <a href="https://onflow.org/discord">Discord channels</a>, which are great way to get in touch with the community, ask question and learn more about Flow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f818b85a328f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Flow blockchain — part 3]]></title>
            <link>https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-3-94484e57e5c4?source=rss-677255cca6b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/94484e57e5c4</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Jan Bernatik]]></dc:creator>
            <pubDate>Thu, 07 Apr 2022 00:54:17 GMT</pubDate>
            <atom:updated>2022-05-03T01:24:30.162Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Flow blockchain — part 3</h3><p>In the <a href="https://medium.com/@jan-bernatik/introduction-to-flow-blockchain-part-2-ce78ed244c9e">previous post</a> we examined the process of creating blocks. In this post we will continue to build on what we learned and expand our understanding of the block lifecycle.</p><h3>Blockchain Forks</h3><p>We need to understand why and how can the blockchain fork, to understand why block finalization is important.</p><p>The flow protocol blockchain can fork in 3 scenarios.</p><p><strong>1) Consensus leader did not receive latest block.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpmzaM1GCRdXifrJM13Bqg.png" /></figure><blockquote>💡 <strong>?</strong> in the diagram represents a decision consensus node needs to make when it sees a fork in the blockchain, called fork-choice rule. HotStuff algorithm provides some level of freedom here, in Flow we choose the “newest fork” (i.e. the fork whose QC has the largest view).</blockquote><p><strong>2) Consensus leader does not receive votes with sufficient weight to create a Quorum Certificate (QC)</strong>. Same as the diagram above, but instead of not receiving block B2a, the consensus leader D does not receive sufficient votes to form QC for block B2a. In this case the consensus leader D will propose a block based on the last block for which a QC is committed to the chain.</p><p><strong>3) Malicious consensus leader builds a block from a parent block which isn’t the latest.</strong> The malicious node might do this for multiple reasons, for example to exclude transactions it does not want to be executed.</p><p>Now that we understand the blockchain forking, we can look at the block finalization.</p><h3>Block Finalization</h3><p>Finalization is an important concept in building the Flow blockchain — it means that the consensus has committed to this block and it is guaranteed to remain on the chain.</p><p>For the client that submitted a transaction that is included in a finalized block, it is a guarantee that the transaction is committed to the chain and will be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nc69aDHeUtAJNCw_5wm6MA.png" /></figure><p>The finalization of a block is important for the nodes that participate in the network, because when a block is finalized it means that they can throw away any fork that does not contain the finalized block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5wdU3BvN2vviwXRdB5sog.png" /></figure><p>This post completes the majority of the block and transaction lifecycle. To talk about the final step — block sealing, we need to look at data storage first. Stay tuned for the next post!</p><p><a href="https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-4-f818b85a328f"><strong>part 4</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94484e57e5c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Flow blockchain — part 2]]></title>
            <link>https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-2-ce78ed244c9e?source=rss-677255cca6b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce78ed244c9e</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Jan Bernatik]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 00:14:53 GMT</pubDate>
            <atom:updated>2022-04-07T00:55:26.653Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Flow blockchain — part 2</h3><p>In part 2 of the series we will build on the foundation from the <a href="https://jan-bernatik.medium.com/introduction-to-flow-blockchain-7532977c8af8">first post</a>. We’ll look at the protocol timing and start exploring the block creation.</p><h3>Protocol Timing</h3><p>To really understand how the protocol works, we need to understand timing of different parts of the protocol.</p><p>There are things that happen predictably on a strictly timed schedule (deterministic and synchronous) and things that are driven by events and their timing is unpredictable (non-deterministic and asynchronous).</p><p>The non-deterministic, asynchronous part of the protocol is execution and verification, because the transactions in the collections vary in their demands on the computation.</p><p>The deterministic, synchronous part of the protocol is the collection and block creation, which happens on a schedule driven by views.</p><p>To simplify things, let’s think of a view as a period of time for which one of the consensus nodes is predetermined to be a leader (this node is often called ‘primary’).</p><blockquote>💡 Note that in reality a consensus node decides on the length of the view, because it is doing it’s best to be in sync with other nodes — we can’t rely on centralized time server in decentralized network, so the nodes use an algorithm called “pacemaker” to stay in sync.</blockquote><p>The consensus leader for a view builds the block from the asynchronous events that have accumulated since the last block was built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mszFYi7Z4VwqPnQRCAzXXA.png" /></figure><p>Now that we understand how the data which flows through the network makes it to a block, we can start exploring how a block is formed and what determines if it will be accepted by the consensus committee.</p><h3>Block creation</h3><p>Let’s start with explaining what is a Quorum Certificate (QC) and what role it plays in the process.</p><p><strong>Quorum Certificate</strong> is a proof that consensus nodes with sufficient “voting power” (weight) voted on the proposed block — they agree that the block is valid and should be added to the chain.</p><p>Take a look at the diagram below — here are few rules which help to understand what is happening there:</p><ol><li>Each view has a pre-determined consensus node which is the consensus leader.</li><li>Block is always proposed by the consensus leader.</li><li>Consensus leader can only propose a block based on a parent block for which a Quorum Certificate exists.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*InXAeZ_2gfXqeXzyJze-_w.png" /></figure><p>Let’s walk through the diagram.</p><ol><li>Consensus leader A takes the messages that it received (messages accumulated in its “mempool”) and proposes block 0 (B0).</li><li>Consensus nodes receive B0, verify it is a valid block and send their vote to the consensus leader of the next view. The verification of the proposed block is complex topic beyond the scope of this post, but at high-level it includes:<br>- Checking that the block satisfies consensus rules, such as: It comes from an authorized consensus node, the consensus node is a leader for the respective view, block contains valid QC.<br>- Checking that the block payload satisfies the protocol rules, such as: no duplicate collection guarantees or execution results exist in the block and it’s preceding blocks, the collection guarantees are signed by supermajority of the respective collection cluster, execution results are sent by authorized execution nodes.</li><li>Assuming it received votes with sufficient weights from the consensus committee, consensus leader B builds the QC for B0 and adds it to proposed block 1 (B1).</li></ol><p>As this process repeats in each view, the blockchain grows, the transactions in each block get executed and the user accounts holding different resources (tokens, NFTs, …) get updated.</p><p>I hope the block formation is clear now, in the next post we will look into blockchain forks and explain the concept of block finalization.</p><p><a href="https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-3-94484e57e5c4"><strong>part 3</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce78ed244c9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Flow blockchain]]></title>
            <link>https://jan-bernatik.medium.com/introduction-to-flow-blockchain-7532977c8af8?source=rss-677255cca6b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7532977c8af8</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jan Bernatik]]></dc:creator>
            <pubDate>Mon, 14 Mar 2022 21:39:02 GMT</pubDate>
            <atom:updated>2022-03-24T00:16:17.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>About me</h3><p>Hi! I am Jan (pronounced Yan). I am an Engineering Manager working on the core <a href="https://www.onflow.org/">Flow</a> protocol team. You may know <a href="https://www.onflow.org/">Flow</a> as it was created by the team that pioneered NFTs — who are famously known for breaking Ethereum with Crypto Kitties. Flow is the blockchain making decentralized applications easy to build and use by anyone.</p><p>This blog is for anyone who is interested in understanding blockchain technology. Welcome to Web3.</p><p>I have been in the tech industry for 15+ years and worked for Cisco and Amazon/AWS among other companies. When I joined Dapper Labs in the fall of 2021, I was fascinated by developments in Web3 but knew little about the tech. In this series of posts I hope to explain what I learned in a way that assumes little prior knowledge. In order to do this I will in some cases simplify things, otherwise this would turn into a white paper. I will call those simplifications out as much as possible.</p><h3>Flow introduction</h3><p>When Dapper Labs built Crypto Kitties we learned a lot. Most importantly, we realized that the technology at the time was not ready for this kind of application. Being the visionaries we are, we set to build a better tech for what we plan to do. We set to build what is now <a href="https://www.onflow.org/">Flow blockchain</a>.</p><p>One of the most significant hurdles in blockchain architecture is how to process the most amount of transactions in the least amount of time, a metric referred to as throughput. Most blockchains try to improve this by increasing the efficiency of their single node types that are used to run the network. Flow introduces a more novel and fundamental improvement for increasing the throughput by splitting the work traditionally assigned to cryptocurrency miners into different roles, where selection and ordering of transactions (consensus) are performed independently from their execution.</p><h3>Node types &amp; data flow</h3><p>There are multiple entities called nodes, which contribute to the flow protocol operation and are part of the protocol network. This is a brief introduction to the 5 node types.</p><p><strong>👀 Access Node (AN)</strong><br>Access Nodes provide external clients with access to recent blocks and submit transactions from clients to the collection node cluster. They determine which collection cluster to send a transaction to (collection clusters are mapped to a range of transaction hashes).</p><p><strong>🍇 Collection Node (LN)</strong><br>Collection nodes are organized into collection clusters. Collection nodes in a cluster work together to bundle transactions into a collection. A collection node cluster decides (via a mini-consensus algorithm) which collection will be sent to the network in a form of Collection Guarantee (more on Collection Guarantees later). The Collection Guarantee can be used to get the full content of the collection and its transactions.</p><p><strong>🤝 Consensus Node (SN)</strong><br>Consensus nodes form and propose blocks based on collection information sent from collection nodes.</p><p><strong>⛓️ Execution Node (EN)</strong><br>Execution nodes execute the transactions and as a result of this update the data that is manipulated via the transactions (for example account balance when the transaction transfers tokens). Execution nodes send Execution Receipts to the network. An Execution Receipt contains an execution result, which is a hash of the data at the point in time when the execution was completed.</p><p><strong>🔍 Verification Node (VN)</strong><br>Verification nodes evaluate the correctness of the work done by execution nodes. Verification node submits a Result Approval to the network. Result Approvals are matched with Execution Results by Consensus nodes to check validity of execution.</p><p>This is how the data flow in the network looks like at a very high level:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXAWBMemgaBaHvO-oXDrEA.png" /></figure><blockquote>💡 The Consensus Committee uses HotStuff consensus protocol to achieve consensus for a proposed block. A detailed protocol description can be found in the <a href="https://arxiv.org/abs/1803.05069">HotStuff protocol white paper</a>.</blockquote><p>Why so many different node types, you may ask ? Let me explain. Our goal is to build a blockchain that delivers high performance and is easy to develop for, unlike layer-2/sharded solutions which achieve the performance at the cost of increased complexity for application developers. We achieve this goal by splitting the traditional role of a blockchain node into multiple roles, which gives us more flexibility in scaling the network (separation of concerns). We have split the selection and ordering of the transactions, transaction execution, block formation (consensus) and transaction execution verification to separate roles. This enabled us to build a network with uncompromised security and decentralization guarantees while at the same time concentrating the computationally expensive operations to a small group of high-performance nodes.</p><p>Let’s take a closer look at the data and the role different components play in achieving the high efficiency of the network.</p><p>The transaction throughput of the overall system depends on the efficiency of the consensus algorithm, which is run by consensus nodes, one of the four main node types. We often refer to consensus nodes as the consensus committee. After the collection nodes have formed incoming transactions from users into collections, they send them to the consensus committee. The nodes in the committee must quickly come to a consensus on the order of collections in blocks. As you could imagine, the speed of this is very sensitive to the block size, because the block needs to be distributed to all the nodes in the consensus committee. Flow protocol achieves high efficiency by not including the content of the transactions in the block. Instead, the block only contains commitments by the collection nodes that the collection will be accessible by the network, called a Collection Guarantee, which is basically a collection identifier. Collection guarantees are added to a block by the consensus leader. Since they are mostly just simple identifiers instead of large transactions, the nodes can process an order them much faster.</p><p>Once the block is proposed by the consensus leader, it can be processed by the Execution nodes. Execution nodes monitor the activity on the p2p network and look for newly proposed blocks to be executed that are provided by the consensus committee. An Execution node will use the collection guarantees in the block to request collection content from the collection nodes to execute the transactions in the collection. Block execution needs to be done sequentially to ensure correctness of the result (changing the order of transactions would produce different results and parallel execution of transactions brings another set of challenges that are beyond the scope of this post). For this reason, the speed of execution is essential to the transaction throughput. Execution nodes are required to be data-centre sized machines with a lot of compute power and memory.</p><p>When the block is executed, each Execution node publishes an execution result, which needs to be verified by Verification nodes to ensure the execution was done correctly. Verification means executing the transaction and comparing the result with the execution result published by the execution node. As opposed to block execution, block verification can be parallelized, because each transaction execution result can be verified independently. This means that verification is easy to scale horizontally (multiple verification nodes verifying different transactions in parallel). The parallelization of the verification process is done by splitting a block into chunks. A verification node determines the chunk assignment from an execution result contained in a block and requests the chunk data pack from the execution node. Verification nodes send their result approvals to the network, consensus nodes use the result approvals to verify the block execution and finally seal the block (we will go through this process in much more detail in future posts).</p><blockquote>💡 In the Flow protocol implementation as of March 2022, chunks are identical to Collections (1 to 1 mapping). Collection is to be executed, Chunk is a collection that has been executed.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZSbQbO8fKxkNgfYx7daYw.png" /></figure><p>Hopefully by now the high-level data flow is clear. In the following posts we will look in more detail at the different stages of the block and transaction lifecycle and also at data storage. Before we do that, we will go through the protocol timing, because that is something that was a bit of revelation for me when I was exploring the protocol and I think it is critical in understanding the other concepts.</p><h3>Useful links</h3><p>Flow technical papers: <a href="https://www.onflow.org/technical-paper">https://www.onflow.org/technical-paper</a></p><p><a href="https://jan-bernatik.medium.com/introduction-to-flow-blockchain-part-2-ce78ed244c9e"><strong>Part 2</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7532977c8af8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>