<?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 Rafael Zerbini on Medium]]></title>
        <description><![CDATA[Stories by Rafael Zerbini on Medium]]></description>
        <link>https://medium.com/@zerbinidamata?source=rss-949cd6fa68b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*30ArkkFRNaGwY3MtpahUDg.jpeg</url>
            <title>Stories by Rafael Zerbini on Medium</title>
            <link>https://medium.com/@zerbinidamata?source=rss-949cd6fa68b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:34:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zerbinidamata/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[Optimistic rollup: Optimistaclly scaling Ethereum]]></title>
            <link>https://medium.com/@zerbinidamata/optimistic-rollup-optimistaclly-scaling-ethereum-462ab1970d45?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/462ab1970d45</guid>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 12:49:42 GMT</pubDate>
            <atom:updated>2024-02-26T12:49:42.267Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have read my previous post on<a href="https://medium.com/@zerbinidamata/ever-experienced-that-moment-when-you-take-a-brief-break-from-keeping-up-with-the-latest-8e684618ecb4"> “ZkEVMs: The Future of Ethereum Scalability,”</a> you may have come across<a href="https://ethereum.org/developers/docs/scaling/zk-rollups"> Zero Knowledge Rollups (ZK-rollups)</a>. ZK-rollups are layer 2 scaling solutions that enhance throughput on the Ethereum Mainnet by moving computation and state storage off-chain. They can process thousands of transactions in a batch and then only post some minimal summary data to the Mainnet. However, ZK-Rollups are not the only rollup solutions in Ethereum; we also have Optimistic Rollups, which we will discuss in this post.</p><h3>Embracing Optimism: The Essence of Optimistic Rollups</h3><p>In optimistic rollups, transactions are initially processed off-chain by validators. Once validated, a cryptographic proof is submitted to the mainnet, where it undergoes a challenge period. If no challenges are raised, transactions are confirmed on-chain. “The ‘optimistic’ label refers to a distinctive feature of optimistic rollups: they publish minimal information about transactions on-chain and automatically assume that all transactions are valid.</p><p>Optimistic rollups use smart contracts deployed on Ethereum to manage the interaction between the L2 chain and the L1 blockchain (Ethereum). Rollup users must deposit funds into one of these smart contracts before getting an equivalent amount unlocked on the rollup.</p><h4>The architecture of an optimistic rollup</h4><p>The Optimistic Rollup is composed of a few important pieces:</p><ol><li><strong>Rollup Chain</strong>: The core component of an optimistic rollup is the rollup chain, which operates as a separate blockchain layer. This chain is responsible for processing and validating transactions off-chain.</li><li><strong>Bridge Contract (ETH chain)</strong>: Receives transactions from users and manages the interaction between the Ethereum mainnet and the rollup chain.</li><li><strong>Sequence Queue Contract (ETH chain)</strong>: Manages the sequencing of transactions. It holds the pending transactions submitted by users until they are processed by the sequencer.</li><li><strong>Validators (Sequencers)</strong>: Validators, also known as sequencers, play a crucial role in the optimistic rollup architecture. They are responsible for processing transactions off-chain, bundling them into batches, and generating cryptographic proofs of their validity.</li><li><strong>Fraud Proofs</strong>: Once transactions are processed off-chain, a cryptographic proof, known as a fraud-proof, is generated to attest to the validity of the transactions. This proof is submitted to the Ethereum mainnet and serves as evidence of the correct execution of transactions.</li><li><strong>Mainnet Contracts</strong>: On the Ethereum mainnet, there are specific smart contracts that handle the verification and execution of fraud proofs. These contracts verify the validity of the submitted proofs and finalize the transactions if no disputes are raised.</li></ol><p>The flow to create a transaction is represented in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*qjevnbZcuUlCS0NF5EW8TQ.png" /></figure><p>Users initiate transactions by sending them to the bridge contract deployed on the Ethereum mainnet. This bridge contract handles the locking of assets from users on the Ethereum mainnet and facilitates their transfer to the rollup chain. Upon receiving transactions, the bridge contract adds them to the sequence queue contract, which manages the sequencing of transactions. The sequencer, responsible for processing transactions off-chain, retrieves transactions from the sequence queue contract, builds batches, and ensures they adhere to the rules of the rollup chain. After processing a batch of transactions off-chain, the sequencer generates a fraud proof attesting to the batch’s correctness. These fraud proofs are then submitted to specific contracts on the Ethereum mainnet for verification.</p><p>Once verified, the transactions are finalized, and the state of the rollup chain is updated accordingly. Throughout this process, the bridge contract on the Ethereum mainnet primarily serves as a conduit for asset movement between the Ethereum mainnet and the rollup chain, while the sequencer manages the processing and verification of transactions within the rollup chain. This description effectively illustrates the interaction between different components within an Optimistic Rollup solution and highlights the decentralized and secure nature of the transaction process.</p><p>Let’s dive a bit into fraud proofs now.</p><h3>What is a Fraud Proof?</h3><p>A <a href="https://ethereum.org/developers/docs/scaling/optimistic-rollups#fraud-proof-benefits">fraud proof</a> is a cryptographic mechanism used in Layer 2 scaling solutions, such as optimistic rollups, to ensure the integrity and validity of transactions processed off-chain. It provides evidence that transactions were executed correctly according to the rules of the system, guarding against potential fraud or misbehavior by validators. Essentially, a fraud proof demonstrates the consistency between the expected state transition resulting from the execution of transactions and the actual state transition observed during off-chain processing. This cryptographic proof serves as a guarantee that transactions conducted within the Layer 2 environment adhere to the consensus rules and are accurately reflected on the Ethereum mainnet.</p><p>If a fraud proof is submitted to the Ethereum mainnet, it undergoes a challenge period during which anyone can dispute its validity by submitting a valid challenge. This challenge mechanism provides an additional layer of security and ensures that fraudulent behavior is detected and penalized. If a valid challenge is raised and proven, the fraudulent transactions are reverted, and the challenger may receive a reward. By allowing participants to scrutinize and challenge the validity of transactions, the challenge process helps maintain the integrity and trustworthiness of the Layer 2 environment, reinforcing the security guarantees provided by fraud proofs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YeJ5ROAQ2BBQaMQMqpG-PQ.png" /><figcaption>Source: <a href="https://ethereum.org/en/developers/docs/scaling/optimistic-rollups/#disputing-transactions">https://ethereum.org/en/developers/docs/scaling/optimistic-rollups/#disputing-transactions</a></figcaption></figure><h4>How a Fraud Proof is created?</h4><p>To create a fraud proof, validators first process transactions off-chain within the rollup chain, resulting in a state transition from the current state to the new state after executing the transactions. Validators meticulously verify the correctness of this state transition by comparing it to the expected state transition based on the executed transactions. Following this, validators calculate the state root of the new state, which serves as a compact representation of the entire state of the rollup chain after processing the transactions.</p><p>After calculating the state root, validators construct a Merkle tree of the transaction data and the resulting state transition. The Merkle tree organizes the transaction data and state transition into a hierarchical structure, with the state root as the root of the tree. This enables efficient verification of individual transactions and the state transition. Utilizing the calculated state root and Merkle tree, validators then generate a fraud proof. This proof includes cryptographic data, such as Merkle proofs, that link the executed transactions to the resulting state transition and the state root. This cryptographic data serves as evidence that the transactions were executed correctly and that the resulting state is valid. Finally, the fraud proof is submitted to specific contracts on the Ethereum mainnet for verification. These contracts validate the integrity of the fraud proof by checking the consistency between the expected state transition and the actual state transition recorded on the rollup chain. If the fraud proof is deemed valid, the transactions are considered finalized, and the state of the rollup chain is updated accordingly. This intricate process ensures the integrity and trustworthiness of transactions processed off-chain in optimistic rollup solutions, providing scalability and security for transaction processing on the Ethereum mainnet.</p><h3>Conclusion</h3><p>In summary, Optimistic Rollup emerges as a promising Layer 2 scaling solution for Ethereum, offering notable enhancements in transaction throughput and cost efficiency. By adopting an optimistic approach to transaction verification and leveraging off-chain processing with subsequent cryptographic proofs on the Ethereum mainnet, Optimistic Rollup achieves scalability while upholding security and decentralization.</p><p>With its innovative methodology for scalability and transaction validation, Optimistic Rollup is positioned to address Ethereum’s scalability hurdles and unlock fresh opportunities for decentralized applications and DeFi protocols. As Ethereum’s ecosystem evolves, Optimistic Rollup is anticipated to drive wider adoption and usability, heralding a new chapter in decentralized finance and blockchain innovation.</p><h3>Want to learn more about Optimistic Rollups?</h3><ol><li><a href="https://ethereum.org/developers/docs/scaling/optimistic-rollups">https://ethereum.org/developers/docs/scaling/optimistic-rollups</a></li><li><a href="https://www.youtube.com/watch?time_continue=366&amp;v=7pWxCklcNsU&amp;embeds_referring_euri=https%3A%2F%2Fethereum.org%2F">https://www.youtube.com/watch?time_continue=366&amp;v=7pWxCklcNsU&amp;embeds_referring_euri=https%3A%2F%2Fethereum.org%2F</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=462ab1970d45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ZkEVMs: The Future of Ethereum Scalability]]></title>
            <link>https://medium.com/@zerbinidamata/ever-experienced-that-moment-when-you-take-a-brief-break-from-keeping-up-with-the-latest-8e684618ecb4?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e684618ecb4</guid>
            <category><![CDATA[polygon]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[zkevm]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 11:33:00 GMT</pubDate>
            <atom:updated>2024-02-11T20:43:07.588Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever experienced that moment when you take a brief break from keeping up with the latest technology trends, only to return and find that it’s hard to keep it up again? If you had that moment recently in the blockchain space, you might have stumbled upon zkEVMs. If you’re curious about zkEVMs stick around and you will know more about it by the end of this post.</p><h3>What is ZkEVM?</h3><h3>Deciphering “Zk” — Zero-Knowledge Proofs Explained</h3><p>Zero-Knowledge Proofs (ZKPs) are a cryptographic concept that enables information verification without revealing the underlying data. In simple terms, Zero-Knowledge Proofs allow one party (the prover) to prove to another party (the verifier) that they possess specific knowledge without disclosing that knowledge directly.</p><p>Think of Zero-Knowledge Proofs as a secure shipping service for iPhones that utilizes smart packaging. This packaging has a cryptographic label (ZKP) that ensures all iPhones are indeed inside and are valid and legitimate, without requiring anyone to open and inspect each package.</p><h4>Introducing Zk-Rollups</h4><p>If the labels represent ZKPs, we can consider the shipping service itself as a concept known as Zk-Rollup, a technology that streamlines transactions by bundling multiple transactions into a single package, rather than sending them one by one.</p><p>As a result, the shipping process becomes more efficient and cost-effective since the company doesn’t need to individually verify each transaction.</p><p>In the world of cryptocurrencies, transactions can replace packages.</p><p>Now, let’s dive deeper to understand what an Ethereum Virtual Machine (EVM) is and make the explanation of Zk more tangible in the context of blockchains.</p><h3>Zero-Knowledge Proofs and Ethereum Virtual Machine: The Innovation of ZkEVM</h3><p>The Ethereum Virtual Machine (EVM) is the central component of the Ethereum network responsible for processing and executing transactions. The EVM operates in an isolated and secure environment to protect the network from attacks and failures.</p><p>The innovation of ZkEVM lies in the fusion of Zero-Knowledge Proofs with the EVM to enhance Ethereum’s scalability and privacy. Implementing ZKPs within the EVM makes it possible to process and verify transactions more efficiently without compromising the network’s security.</p><p>The ZkEVM leverages ZKPs and Zk-Rollups to condense multiple transactions into a single Zero-Knowledge Proof (the cryptographic label in our earlier example), which is then verified and validated.</p><p>This process is akin to placing thousands of iPhones into a small, lightweight package, complete with a cryptographic label to prove they are indeed inside. This significantly reduces the amount of data needed to store and process each transaction on the network, resulting in lower resource consumption and increased processing capacity.</p><p>Furthermore, the use of ZKPs in ZkEVM ensures enhanced privacy, as transaction details remain concealed during verification. This is particularly valuable for applications that require increased confidentiality, such as voting systems or financial services.</p><h3>ZkEVM and Polygon</h3><p>Polygon is a scalability solution platform designed to enhance transaction processing capacity and reduce fees on the Ethereum network. Through its infrastructure, Polygon creates a blockchain network that runs in parallel with Ethereum, enabling transaction processing outside the main network.</p><p>This approach alleviates the burden on Ethereum, improving transaction speed and reducing associated costs.</p><p>Polygon’s native cryptocurrency, MATIC, plays a significant role in this ecosystem.</p><p>Polygon has pioneered the implementation of ZkEVM on Ethereum, ensuring that users and developers can access ZkEVM technology through its infrastructure. Imagine Polygon as the shipping service provider, and Ethereum as the recipient.</p><p>Developers can now harness the benefits of Zero-Knowledge Proofs to create even more efficient and secure solutions, thereby increasing the value of both Polygon and Ethereum networks.</p><h3>Benefits of ZkEVM, Polygon, and Their Impact on Ethereum</h3><p>The technology of ZkEVM and Polygon offers substantial benefits to the Ethereum ecosystem:</p><ol><li><strong>Enhanced Scalability</strong>: ZkEVM, in conjunction with Polygon’s infrastructure, enables higher transactions per second (TPS), reducing the load on the Ethereum network.</li><li><strong>Reduced Transaction Fees</strong>: Transaction processing optimization provided by ZkEVM within Polygon results in significantly lower transaction fees, making Ethereum more accessible and appealing.</li><li><strong>Heightened Privacy</strong>: The implementation of Zero-Knowledge Proofs within ZkEVM adds an extra layer of privacy for users, ensuring that sensitive information remains confidential during transaction verification.</li><li><strong>Innovation and Development</strong>: ZkEVM encourages innovation and the creation of new solutions within the Ethereum ecosystem, expanding possibilities and attracting more developers and users to the platform.</li></ol><p>With the implementation of these technologies, Ethereum has the potential to become a leading blockchain platform, capable of addressing the challenges posed by increasing demand and a rapidly digitizing world.</p><p>ZkEVM and Polygon MATIC represent a significant leap forward in the evolution of Ethereum and blockchain technology. By amalgamating the capabilities of Ethereum’s smart contracts with the privacy and scalability offered by Zero-Knowledge Proofs, these technologies have the potential to reshape industries, enhance security, and democratize blockchain technology. As these technologies continue to advance, it is essential to closely monitor their developments and consider their potential impact on the blockchain ecosystem and your investments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e684618ecb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Level Up Your App Security with Authzed: A Fun and Effortless Adventure!” — Part 1]]></title>
            <link>https://medium.com/@zerbinidamata/level-up-your-app-security-with-authzed-a-fun-and-effortless-adventure-part-1-66bdcfabe22c?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/66bdcfabe22c</guid>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 16:51:49 GMT</pubDate>
            <atom:updated>2023-08-17T11:44:31.451Z</atom:updated>
            <content:encoded><![CDATA[<h3>“Level Up Your App Security with Authzed: A Fun and Effortless Adventure!” — Part 1</h3><p><strong>Abstract:</strong> <a href="https://authzed.com/">Authzed</a> is an Authorization-as-a-Service built on top of <a href="https://github.com/authzed/spicedb">SpiceDB</a>, an open-source, Google Zanzibar-inspired database system for creating and managing security-critical application permissions. It enables the construction of systems with granular authorization permissions, making the process of building authorization systems remarkably effortless. In this post, I will delve into the significance of having granular permissions, the challenges associated with implementing them directly into systems, and explore the advantages of using Authzed and its basic structure. In Part 2, I will get into a more hands-on approach and develop a proof of concept application, <a href="https://zerbinidamata.com/blogMailList?blogName=level-up-your-app-security-with-authzed:-a-fun-and-effortless-adventure-part-2">stay tuned for Part 2</a>.</p><p><em>You can also read this post on </em><a href="https://zerbinidamata.substack.com/p/level-up-your-app-security-with-authzed-a-fun-and-effortless-adventure-part-1-66bdcfabe22c"><em>my Substack.</em></a></p><h4>Some context</h4><p>Not a long time ago I was working as a Software Engineer in a Security Team, focusing on Application Security. We had many issues in the security realm of our microservices, but one that always came up and proved to be a real pain was dealing with <em>granular permissions</em>. Like most places I’ve worked, we had a DIY solution, which became a real headache whenever we had to make changes, whether it was introducing new roles or adding permissions through the application. Speaking of scenarios with fine-grained permissions, as you might know, during the development phase, we developers often tend to overlook permissions and only focus on building high-level authorization.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F14892391&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fsecurity-biztonsag-pat-down-gif-14892391&amp;image=https%3A%2F%2Fmedia.tenor.com%2FwYRSGvDd5sYAAAAM%2Fsecurity-biztonsag.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bdfdb111c167c06bc7f6accbe90049d/href">https://medium.com/media/8bdfdb111c167c06bc7f6accbe90049d/href</a></iframe><p>For example, let’s consider a document management application as an example. At first glance, it may seem sufficient to have broad permissions such as “view documents,” “edit documents,” and “delete documents” for users. However, overlooking the importance of granular permissions can lead to potential security risks and compromised data integrity, as it becomes really hard to manage once new requirements are added to the application.</p><p>By incorporating granular permissions, the application can define more precise access controls. For example, instead of a blanket “<em>edit documents</em>” permission, it becomes possible to differentiate between “<em>edit own documents</em>,” “<em>edit shared documents,</em>” or even specific permissions like “<em>edit document metadata</em>” and “edit document content.” This level of granularity ensures that users have appropriate access levels based on their roles and responsibilities within the document management system.</p><p>Additionally, granular permissions can address easily overlooked scenarios that hold critical importance. For instance, permissions like “view<em> document history</em>,” “<em>share documents with external collaborators</em>,” or “<em>grant/revoke document access to others</em>” may seem minor, but they play a vital role in maintaining data confidentiality, traceability, and collaboration control within the application.</p><p>AuthZed is an advanced authorization and access control system designed to enhance security and flexibility within applications. At its core, AuthZed utilizes a permissions graph, a powerful data structure that represents relationships between users, resources, and permissions. This graph-based approach enables a more nuanced and fine-grained control over access privileges, allowing administrators to define highly specific permissions for different user roles.</p><p>Okay, you might look at what I just said and say, but why do I need Authzed or SpiceDB for it? Can’t I use existing solutions or build my own solution in my service’s context?</p><h3>The Challenges of DIY Implementation</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F20067270&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Ftapemeasure-diy-gif-20067270&amp;image=https%3A%2F%2Fmedia.tenor.com%2FH8oEoVN6GrgAAAAC%2Ftapemeasure-diy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d49dbc73382c7d054efbe648de272706/href">https://medium.com/media/d49dbc73382c7d054efbe648de272706/href</a></iframe><p>If you’ve ever attempted to implement granular permissions yourself, you might have explored various solutions. In a monolithic architecture, things can be a bit more straightforward. You might have come across ready-to-go solutions like the CanCanCan Ruby gem (side note: I used to like the name CanCan, but CanCanCan is too much for me lmao). These solutions are easier to implement and manage within a monolithic environment but require extensive code integration.</p><p>However, as your application grows and new features are introduced, tying them to specific roles or permissions within the monolith can lead to code changes in multiple places. This complexity makes it challenging to maintain, especially for larger, older, or legacy applications. Another potential issue to consider is the resource allocation for authorization checks. If the user is not authorized, it could impact the performance of the platform for other users.</p><p>Cool, so for monoliths, we can say that things are <em>not so bad</em>, it might be difficult to manage at some point and it might have some performance implications but nothing that should affect your app too much, but otherwise, it can work nicely. And what about a microservices environment?</p><p>So for microservices, there are a few possible approaches. Let’s talk a little about options. Some that come to mind are: API Gateway level authorization, JWT level, and an authorization server. Let’s explore each one a bit.</p><h4>API Gateway Authorization</h4><p>API Gateway is so cooool! It can do so many things, and one of them is, of course, authorization checks for the API route you are trying to access. I will cut it short and talk about the pros and cons of API Gateway Authorization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzwzQF8IaCOhtewYt2r7Pg.png" /></figure><p>Upsides:</p><ol><li><strong>Centralized Access Control</strong>: The API Gateway acts as a centralized point for handling authorization, making it easier to manage and enforce access control policies consistently across all microservices. This centralized approach simplifies authorization management, as changes can be applied at the gateway level rather than in each individual microservice.</li><li><strong>Granular Permissions(what we are instered really)</strong>: API Gateway authorization allows for granular permissions at the API endpoint level. It can enforce fine-grained access control based on user <strong>roles, scopes, or attributes.</strong></li><li><strong>Simplified Microservices</strong>: By offloading the responsibility of authorization to the API Gateway, <em>individual microservices can focus solely on their core business logic(this might be a downside in some scenarios)</em>.</li></ol><p>Downsides:</p><ol><li><strong>Increased Latency:</strong> Introducing an API Gateway can add an extra network hop for requests, which may result in increased latency compared to direct communication between microservices. Complex Configuration: Configuring and managing authorization policies at the API Gateway can be complex, especially as the number of microservices and access rules increases. Careful planning and robust tooling are essential to manage this complexity effectively.</li><li><strong>Maintaining Consistency</strong>: Ensuring consistency between authorization policies in the API Gateway and individual microservices can be challenging. Changes to policies must be synchronized across the entire system to avoid discrepancies.</li></ol><p><strong>JWT Authorization directly on the service</strong></p><p>If you have ever worked with JWT, you know that it can carry a wide range of data, although it might not be suitable for storing everything. However, it allows you to include permissions, and that’s a significant advantage. For instance, you can store role permissions or even granular permissions within the JWT and conveniently check them whenever needed. This approach enables you to perform access checks directly within the microservice itself. It simplifies the process and streamlines the authorization workflow for your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNYvHyfeG0sNOcOyc8Wstw.png" /></figure><p>Upsides:</p><ol><li><strong>Stateless</strong>: JWTs are stateless tokens, meaning they contain all the necessary information to verify the user’s identity and permissions within the token itself. This eliminates the need for server-side sessions and reduces the burden on the server, making it easier to scale.</li><li><strong>Decentralized Authorization:</strong> With JWTs, authorization information is carried within the token itself, allowing each microservice to independently verify permissions without the need for a centralized authorization server.</li><li><strong>Granular Permissions(what we are interested in):</strong> JWTs can carry user-specific claims and attributes, such as roles or scopes, providing granular control over what actions and resources the user is authorized to access. This fine-grained authorization enhances security and access control.</li></ol><p>Downsides:</p><ol><li><strong>Token Size(the biggest issue for granular permissions):</strong> While JWTs are generally compact if they carry a large number of claims or user attributes, the token size can become a concern. Larger tokens may increase network overhead and impact API performance.</li><li><strong>Revocation:</strong> JWTs are stateless, which means they cannot be invalidated or revoked before their expiry time. If a user’s permissions change or their access needs to be revoked, the existing JWT remains valid until it expires.</li><li><strong>Sensitive Data:</strong> Since JWTs are encoded, not encrypted, sensitive information should not be included in the token. While the token content is not visible, it can be decoded by anyone, which means sensitive data should be stored securely on the server side.</li></ol><h4>DIY Authorization Server</h4><p>Let’s say you decided to build your authorization server after diving into other options and realizing they might not be appropriate to your use case. Let’s look into the upsides and downsides of this approach.</p><p>Upsides:</p><ol><li><strong>Tailored to Specific Needs(if your team has the expertise, it can be great):</strong> A custom authorization server allows you to design and implement authorization logic that precisely fits the requirements of your application. You have full control over defining and managing user roles, permissions, and access rules.</li><li><strong>Flexibility:</strong> With a custom authorization server, you can adapt and modify the authorization process as your application evolves. It allows you to extend functionality and implement complex authorization mechanisms tailored to your unique use cases.</li><li><strong>Centralized Management(might be a downside depending on the aspect you are analyzing, but in general, it is a good thing):</strong> A custom authorization server centralizes the control of access to various resources and APIs within your system. This makes it easier to manage authorization policies, permissions, and user roles from a single point.</li></ol><p>Downsides:</p><ol><li><strong>Development and Maintenance Effort:</strong> Building and maintaining a custom authorization server requires significant development effort and ongoing maintenance. This can add to the overall complexity and cost of your application.</li><li><strong>Security Risks(attention!!):</strong> Building your authorization server demands a thorough understanding of security best practices. Any vulnerabilities or mistakes in implementation could lead to serious security risks, such as unauthorized access or data breaches.</li><li><strong>Expertise Requirement:</strong> Developing a custom authorization server requires expertise in security, authentication, and authorization. If your team lacks the necessary knowledge or experience, it can be challenging to implement a secure and reliable solution.</li><li><strong>Lack of Standardization(it can quickly become a maze):</strong> A custom authorization server may not benefit from the broad community scrutiny and testing that standardized solutions receive. This might lead to issues that are not well-addressed or could have been avoided with standardized implementations.</li><li><strong>Interoperability(it can be really hard to integrate with existing solutions, been there):</strong> Custom authorization servers might require more effort to integrate with other third-party services or applications. This could be a concern if your application needs to interact with external systems that rely on standard authorization protocols like OAuth.</li></ol><p>After exploring these flaws, you might be wondering, “Can Authzed address these issues? Is it that powerful?” The truth is, while Authzed offers many benefits, it isn’t a flawless solution. In the upcoming section, we’ll take a closer look at how Authzed operates and examine both its advantages and disadvantages.</p><h3>AuthZed to the rescue?!</h3><p>We explored a bit poof possible solutions for granular permissions, their advantages, and their challenges. And explored a bit about AuthZed as an Authorization As A Service solution. The way I see it, you can integrate AuthZed in different ways, but the most usual one is direct integration with the microservices. Side note: this doesn’t necessarily mean it needs to be directly embedded in the code; you can have an authorization handler running in a sidecar container within the same Pod as your microservice, for instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FcrnQMsmU-Je7UWQ1qOdnA.png" /></figure><p>Let’s take the downsides of the solutions we talked about before and see if Authzed has a different view.</p><ol><li><strong>[API Gateway]</strong> <strong>Increased Latency: </strong>That will not change so much on AuthZed, by using AuthZed we introduce a network call to check the authorization and compare both, AuthZed is probably hard to cache since you would need to develop the cache mechanism yourself. Point<strong> to API Gateway.</strong></li><li><strong>[API Gateway] Maintaining Consistency: </strong>Each microservice or even each route might need different permissions, which can be handled by API Gateway, but it can easily become hard to manage. Maintaining consistency between the check on API Gateway and implementation in the actual service can be challenging and add a new level of complexity to the development lifecycle. As AuthZed permissions and relationships are centralized and permission checks are managed closer to the service, it’s easier to visualize the permission graph and maintain consistency. <strong>Point to Authzed.</strong></li><li><strong>[JWT]</strong> <strong>Token Size and Revocation: </strong>AuthZed eliminates the token size issue since there is no actual token, but it introduces one additional network call. However, the revocation issue is a significant one. Let’s say you alter some permissions when using the JWT approach; the permissions will only take effect when a new JWT is generated, which will happen only when the current JWT expires. This is not ideal, and it doesn’t occur with AuthZed. <strong>The point goes to AuthZed.</strong></li><li><strong>[JWT] Sensitive Data: </strong>As JWTs are only encoded, not encrypted, any application with access can verify the data stored within them. This can add a few risks, and it’s not an important feature in authorization checks. The application is not interested in the contract that allows a user to access a specific feature; it’s interested only in whether it can access it or not. <strong>Point to AuthZed.</strong></li><li><strong>[DIY Authorization Server] Lack of Standardization: </strong>When building a new application is always difficult to predict all the requirements that the future may hold and possible interactions. When adding new permissions and relations to those permissions, things can start to become a maze if not well implemented. As this is hard to do, especially in big teams, it’s a <strong>point to AuthZed.</strong></li><li><strong>[DIY Authorization Server] Interoperability: </strong>Let’s consider that for some reason you have to integrate your authorization server with some external system, if there isn’t a strong standard on how things work, it can be really hard to do, as you will need to make various contracts for each use case. As AuthZed already enforces a standard, <strong>point to AuthZed.</strong></li><li><strong>[DIY Authorization Server] Development, Maintenance Effort, and Security Risks: </strong>Probably the easiest one to vouch for AuthZed. Building custom solutions it’s hard, takes time, and maintaining those can be as costly as paying for something ready to go. And also, whenever we talk about Authorization implementations, it might be easy to forget some small detail and leave breaches open. Without much need for argumentation, <strong>point to AuthZed.</strong></li></ol><p>Cool, now let’s make a quick upside and downside from Authzed (I hope you like this kind of list, if not you might be hating this post, that is if you are still here).</p><h4>AuthZed pros</h4><ol><li><strong>Centralized Authorization Management:</strong> Authzed acts as a centralized authorization service, storing and managing fine-grained access control policies. Instead of maintaining separate policies in both the API Gateway and microservices, you define and manage the policies within Authzed.</li><li><strong>Single Source of Truth: </strong>By using Authzed as the single source of truth for authorization policies, you eliminate the need to synchronize policy changes across multiple components. Any updates or modifications to the policies are made within Authzed, ensuring that all microservices and the API Gateway refer to the same authoritative set of policies.</li><li><strong>Decoupling from Microservices:</strong> With Authzed handling authorization, the microservices can focus on their core functionalities without the need to implement complex authorization logic. This decoupling improves maintainability and reduces the risk of inconsistencies in authorization rules.</li><li><strong>Granular Permissions:</strong> Authzed’s support for granular permissions enables precise control over user access to resources. This fine-grained approach allows you to tailor permissions to specific use cases, promoting a consistent and secure access control model.</li></ol><h4><strong>Cons</strong></h4><ol><li><strong>External Dependency:</strong> Relying on an external service like Authzed introduces a dependency that may affect the availability and performance of the application. It’s important to consider the impact of this external dependency on your system’s reliability.</li><li><strong>Latency:</strong> Authzed is an external service, and any network latency between your microservices and Authzed could impact overall response times. While Authzed is designed for scalability, latency can still be a concern depending on your system architecture and network setup.</li></ol><h4>AuthZed basic structure</h4><p>We spent some time talking about AuthZed benefits and prós and cons when compared to other approaches. Now we will take a quick look at how AuthZed manages permissions.</p><p>The first step in AuthZed is to define a <a href="https://authzed.com/docs/guides/schema">schema</a>, it defines the types of objects found, how those objects relate to one another, and the permissions that can be computed off of those relations. To begin defining the schema, the first step is to create one or more object definitions that specify the types of objects that your permissions system will support. These object definitions can be likened to classes in an object-oriented programming language (excluding inheritance) or tables in a relational database.</p><pre>/** user represents a user of the app*/<br>definition user {}<br><br>/** document represents a document with access control */<br>definition document {}</pre><p>The next step is to definethe relations that are going to specify how our objects, and definitions, relate to each other. Let’s start with a Role Based Access Control. Let’s start with the reader and writer roles. Here is our updated schema.</p><pre>/** user represents a user of the app*/<br>definition user {}<br><br>/** document represents a document with access control */<br>definition document {<br>  /** reader indicates that the user is a reader on the document */<br>  relation reader: user<br>  /** writer indicates that the user is a writer on the document */<br>  relation writer: user<br>}</pre><p>Okay, so now how do we check this permission? We want to ask a question like “<em>Can this specific user read the specific document?” </em>In AuthZed, this is done through a <a href="https://buf.build/authzed/api/docs/main:authzed.api.v1#CheckPermission">CheckPermission </a>call. We can consider something like this:</p><pre>document:somedocument#reader@user:someuser</pre><p>Which can be translated into a CheckPermission API call as follows:</p><pre>CheckPermissionRequest {<br>    resource: ObjectReference {<br>        object_type: &#39;document&#39;<br>        object_id: &#39;somedocument&#39;<br>    }<br>    permission: &#39;view&#39;<br>    subject: SubjectReference{<br>        object: ObjectReference {<br>            object_type: &#39;user&#39;<br>            object_id: &#39;someuser&#39;<br>        }<br>    }<br>}</pre><p>Cool, so how do we check for permissions that involve multiple roles? For instance, let&#39;s say that the user can view the document if they are the writer or a reader. We can achieve this using permissions. Permission is computed from an expression using the relations. For example, the view permission below is computed based on whether a user is a reader or a writer. If the user is either of those, they can view the document.</p><pre>/** user represents a user of the app*/<br>definition user {}<br><br>/** document represents a document with access control */<br>definition document {<br>  /** reader indicates that the user is a reader on the document */<br>  relation reader: user<br>  /** writer indicates that the user is a writer on the document */<br>  relation writer: user<br><br>  //** view indicates that a user can see the document if he has a reader or writer role */<br>  permission view = reader + writer<br>}</pre><p>So far, so good! But now we can consider what if we want to extend this permission to different definitions? For instance, an organization administrator should be able to see all documents in the organization. Let’s dive into this. First, let’s create an organization definition.</p><pre>/** user represents a registered user&#39;s account in our application */<br>definition user {}<br><br>/** organization represents an organization that contains documents */<br>definition organization {<br>  /** administrator indicates that the user is an admin of the org */<br>  relation administrator: user<br>}<br><br>/** document represents a document with access control */<br>definition document {<br>  /** reader indicates that the user is a reader on the document */<br>  relation reader: user<br><br>  /** writer indicates that the user is a writer on the document */<br>  relation writer: user<br><br>  /** view indicates whether the user can view the document */<br>  permission view = reader + writer<br>}</pre><p>Cool! So we have an organization and an administrator role for that organization. How do we connect documents to an organization now? We need to indicate that a document is part of an organization. And this can be easily done by defining a new relationship between a document and an organization.</p><pre>/** user represents a registered user&#39;s account in our application */<br>definition user {}<br><br>/** organization represents an organization that contains documents */<br>definition organization {<br>  /** administrator indicates that the user is an admin of the org */<br>  relation administrator: user<br>}<br><br>/** document represents a document with access control */<br>definition document {<br>  /** docorg indicates that the organization owns this document */<br>  relation docorg: organization<br><br>  /** reader indicates that the user is a reader on the document */<br>  relation reader: user<br><br>  /** writer indicates that the user is a writer on the document */<br>  relation writer: user<br><br>  /** view indicates whether the user can view the document */<br>  permission view = reader + writer<br>}</pre><p>So now we have the relation that a document belongs to an organization. But how can we add the permission we talked about earlier, where an organization admin can viewall documents? First of all, we need to create a view_all_documents permission on the organization and assign it to an administrator. So far, so good. But how do we make this accessible to the document definition? AuthZed has an operator just for that! The arrow operator (-&gt;), allows for referencing permissions <em>across</em> another relation or permission, so we have a schema like this:</p><pre>/** user represents a registered user&#39;s account in our application */<br>definition user {}<br><br>/** organization represents an organization that contains documents */<br>definition organization {<br>  /** administrator indicates that the user is an admin of the org */<br>  relation administrator: user<br><br>  /** view_all_documents indicates whether a user can view all documents in the org */<br>  permission view_all_documents = administrator<br>}<br><br>/** document represents a document with access control */<br>definition document {<br>  /** docorg indicates that the organization owns this document */<br>  relation docorg: organization<br><br>  /** reader indicates that the user is a reader on the document */<br>  relation reader: user<br><br>  /** writer indicates that the user is a writer on the document */<br>  relation writer: user<br><br>  /** view indicates whether the user can view the document */<br>  permission view = reader + writer + docorg-&gt;view_all_documents<br>}</pre><p>We did it!</p><h3>Overview</h3><p>Cool! Thanks for making it this far. The idea of this post was to explore a bit about granular permissions, the reasons behind them, and possible solutions, and delve into why AuthZed is a good go-to tool and how we can use it. As I mentioned earlier, I’m looking to write a part two with more hands-on experience, designing an architecture, and integrating AuthZed into a real application. <a href="https://zerbinidamata.com/blogMailList?blogName=level-up-your-app-security-with-authzed:-a-fun-and-effortless-adventure-part-2">Stay tuned</a> for that and turn on the notification bell for my blog posts! I hope you enjoyed this post. If you want to talk, you can reach me on <a href="https://www.zerbinidamata.com/">my website.</a></p><h4>Addendum — 07/28/2023</h4><p>Greetings, esteemed readers! I have an exciting update to share with you all. AuthZed has reached out to me with some valuable additional material about their services. They kindly provided references 5 and 6, which I found to be insightful and definitely worth a read. Additionally, I’d like to highlight some essential information they shared about their SLO (Service Level Objective). Here’s a direct quote for you:</p><p>AuthZed internal SLO for SpiceDB itself is &lt;25ms P95 for CheckPermission though we’ve been closer to 15ms, P50 is much lower. Our main product SpiceDB Dedicated is also deployed adjacent to our customer’s workloads and connected privately, which only adds 1 ms or so of network latency</p><h3>References</h3><ol><li>AuthZed Getting Started — <a href="https://authzed.com/docs/guides/schema">https://authzed.com/docs/guides/schema</a></li><li>CheckPermission reference — <a href="https://buf.build/authzed/api/docs/main:authzed.api.v1#CheckPermission">https://buf.build/authzed/api/docs/main:authzed.api.v1#CheckPermission</a></li><li>Check it out: How permissions are answered in SpiceDB and Authzed — <a href="https://authzed.com/blog/check-it-out">https://authzed.com/blog/check-it-out</a></li><li>Google Zanzibar Paper — <a href="https://authzed.com/zanzibar">https://authzed.com/zanzibar</a></li><li>What is Google Zanzibar? (<a href="https://authzed.com/blog/what-is-google-zanzibar">https://authzed.com/blog/what-is-google-zanzibar</a>)</li><li>Pitfalls of JWT Authorization (<a href="https://authzed.com/blog/pitfalls-of-jwt-authorization">https://authzed.com/blog/pitfalls-of-jwt-authorization</a>)</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66bdcfabe22c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Como o Blockchain pode auxiliar a gestão de cadeia de logística?]]></title>
            <link>https://medium.com/@zerbinidamata/como-o-blockchain-pode-auxiliar-a-gest%C3%A3o-de-cadeia-de-log%C3%ADstica-e97ed096a434?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e97ed096a434</guid>
            <category><![CDATA[tecnologia]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[português]]></category>
            <category><![CDATA[logistica]]></category>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Tue, 31 Jul 2018 14:49:35 GMT</pubDate>
            <atom:updated>2018-07-31T14:49:35.682Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*5-0i_TPbgXz9tJkG4WAijQ.png" /></figure><p>Muito se fala atualmente sobre as criptomoedas, principalmente Bitcoin, que seria o predecessor de milhares de criptomoedas existentes hoje. Porém, a tecnologia por trás do Bitcoin, conhecida como Blockchain, permite muito mais do que apenas troca de valor na rede.</p><p><strong>O que é Blockchain?</strong></p><p>Blockchain é um banco de dados distribuído que mantém registro de dados ou eventos digitais, de uma forma muito resistente às violações. A segurança da estrutura é oferecida pelo consenso entre os nós que fazem parte daquela blockchain, para se mudar ou deletar algum registro na blockchain, é necessário alterar a estrutura em, pelo menos, metade mais um dos sistemas que possuem a estrutura, para que então todos os computadores entrem em consenso que aquela é a versão correta da blockchain.</p><p>Pense da seguinte forma: se o blockchain inteiro fosse o histórico das transações de um banco, um extrato bancário individual seria uma única transação dentro de um “bloco” na cadeia, onde cada bloco armazena várias transações. Diferentemente dos sistemas bancários, não existe uma organização que regule essas transações, por isso é necessário um consenso entre a maioria dos participantes. Em resumo, podemos dizer que a blockchain é um mecanismo de manuntenção de registro que age entre diferentes entidade sem a necessidade de um regulador.</p><p><strong>Como a tecnologia blockchain afeta a cadeia de logística?</strong></p><p>Cada vez que um produto muda de mãos, a transação pode ser documentada, de forma automática utilizando contratos inteligentes ou inserção manual, criando assim um histórico permanente da manufatura à venda. Isso pode diminuir drasticamente atrasos, custos e erro humano.</p><p>Atrasos envolvendo clima, dispustas trabalhista e erro são inevitáveis. Com o processo rodando sobre a blockchain, pode-se avaliar medidas para resolver problemas assim que for detectado, por exemplo, sabendo que uma entrega está incompleta ou em risco pode recorrer imediamente a ações de remediação, como substituição do suprimento ou queda de preço, antes que uma crise ocorra.</p><p>Com a documentação de um produto na blockchain que referencie seu fluxo geográfico e como foi tratado, pode ser feita um exame das fontes, investigar certificados de indústrias, rastrear componentes especificos, descobrir anomalias no armazenamento, entre outros.</p><p>Roubos de carga são mais comuns do que deveriam ser, isso ocorre pela chegada de pessoas maliciosas nas entregas de carga com documentos falsos. O uso da blockchain poderia ajudar a evitar esses tipos de roubos, fornecendo maior segurança ao vendedor e ao cliente.</p><p><strong>Já existem empresas usando blockchain com este intuito?</strong></p><p>Provenance, uma startup britânica, utiliza blockchain para verificar autencidade da comida. A empresa pega informações através de sensores ou RFID tags e armazena na blockchain, para rastrear todo o caminho da comida.</p><p>Uma organização chamada Kouvula Innovation tem uma visão mais audaciosa. Produtos com RFID tags comunicariam a necessidade de irem do ponto A para o ponto B, dentro de um certo período de tempo. As aplicações de “mineração” da transportadora ofereceriam o direito de mover essa carga. A RFID tag atribui o serviço a transportadora que melhor atende o cliente, considerando custo e tempo. Após isso, toda a viagem é armazenada na blockchain.</p><p>Apesar do uso de blockchain não ser muito difundido ainda em gestão de cadeia logística, a tecnologia pode solucionar vários problemas e reduzir custos, portanto é extremamente provável que o futuro seja a implementação da blockchain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e97ed096a434" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tangle: evolução da Blockchain?]]></title>
            <link>https://medium.com/@zerbinidamata/tangle-evolu%C3%A7%C3%A3o-da-blockchain-df998fb61293?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/df998fb61293</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[tangle]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[iota]]></category>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Fri, 22 Dec 2017 15:44:06 GMT</pubDate>
            <atom:updated>2023-08-17T11:46:45.044Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Blockchain </em>e <em>Tangle </em>são duas tecnologias que funcionam como o livro-razão de criptmoedas, garantindo também sua segurança, sendo que a blockchain se popularizou com a criação do <em>Bitcoin</em><a href="https://bitcoin.org/bitcoin.pdf"> [Nakamoto, 2008]</a> e <em>o Tangle </em>com a <em>Iota</em><a href="https://iota.org/IOTA_Whitepaper.pdf"> [Popov, 2017]</a>.</p><p><em>Você também pode ler esse post no </em><a href="https://zerbinidamata.substack.com/p/tangle-evolucao-da-blockchain-df998fb61293"><em>meu Substack.</em></a></p><p>Diferentemente da blockchain, que é uma lista encadeada de <strong>blocos de transações</strong>, o Tangle é um Grafo Acíclico Direcionado onde<strong> cada nó é uma transação.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*LBiR5EkXVMEXMkz1yKw3PA.jpeg" /><figcaption>Blockchain</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*DQaaC8M5XlhgkHC34XTd-w.jpeg" /><figcaption>Tangle</figcaption></figure><h4>Taxas</h4><p>Na blockchain existe o processo de mineração, que é o processo matemático que precisa ser realizado para a adição do bloco a blockchain. Esse processo é realizado por um <em>peer, </em>chamado de <em>minerador, </em>ou um grupo de <em>peers, </em>denominado <em>mining pool.</em></p><p>Quando o minerador resolve tal processo matemático ele é recompensado com um pagamento, pelo esforço computacional realizado. No tangle, não existe mineração, no sentido de se receber uma recompensa por resolver o processo matemático. Tal recompensa é obtida através das taxas necessárias para se realizar uma transação.</p><p>O que acontece no tangle é que para um usuário poder transmitir sua transação, é necessário que ele valide duas transações preexistentes na rede, “minerando-as”, ou seja, resolvendo o processo matemático. Assim não há a existência de um recompensa e, portanto, não existem taxas para se realizar transações, possibilitando os <em>micropagamentos, </em>que são pagamentos de pequenas quantias.</p><p>O fato de não haver a necessidade de se pagar taxas é um avanço quando falamos dessas tecnologias em criptomoedas. A necessidade de se pagar taxas na blockchain torna algumas compras inviáveis, por exemplo, suponha que você vá comprar um café com Bitcoin, provavelmente você pagará mais pelas taxas do que pelo café, o que é inconcebível. Por isso a inexistência de taxas é extremamente importante para o avanço das criptomoedas.</p><p>Outro grande alvo dessas tecnologias é o campo de <em>Internet das Coisas (IoT), </em>uma aplicação dessas tecnologias em dispositivos IoT é a de contratos inteligentes (do inglês, <em>smart contracts). </em>Por exemplo, uma operação de crédito pode ser realizada entre dois dispositivos e ser regulada através de um contrato inteligente, onde todos os dispositivos possuem uma versão deste contrato, um dispositivo pode solicitar uma alteração no contrato, por exemplo, para atribuir crédito pela prestação de algum serviço. Os nós são informados da atualização no recebimento do novo estado do contrato, então o dispositivo destinatário verifica que possui e crédito e libera o serviço. Neste cenário de é <strong>essencial </strong>que não existam taxas, ou que sejam muito pequenas, já que estamos falando de micropagamentos.</p><h4>Escalabilidade</h4><p>Escalabilidade de um sistema é sua capacidade de melhorar com a inserção de recursos adicionais.</p><p>A blockchain não é escalável, ou seja, o aumento do número de blocos não melhora o sistema. É interessante observar que, por não ser escalável, a blockchain sempre está sujeita ao <a href="https://learncryptography.com/cryptocurrency/51-attack">ataque de 51%</a>, independente do tamanho da cadeia.</p><p>Já o tangle é altamente escalável, como para emitir transações é necessário validar duas transações preexistentes, com o aumento do número de transações, a rede vai se tornando mais rápida e segura.</p><h3>Conclusão</h3><p>Podemos observar que o tangle resolve grandes questões existentes em relação a blockchain, como taxas e escalabilidade. Além disso o tangle promete ser segura contra computadores quânticos, diferentemente da implementação clássica da blockchain. Portanto, podemos afirmar que, nestes aspectos, o tangle se torna mais atrativa que a blockchain.</p><h3>Referências</h3><p>Esse post também foi escrito no Steemit, podendo ser acessado <a href="https://steemit.com/blockchain/@rafaelzerbini/tangle-evolucao-da-blockchain">aqui</a></p><p>Satoshi Nakamoto (2008). “ Bitcoin: A Peer-to-Peer Electronic Cash System”. Disponível em: <a href="https://bitcoin.org/bitcoin.pdf">https://bitcoin.org/bitcoin.pdf</a>. Acessado em: 22/12/2017.</p><p>Serguei Popov (2017). “The Tangle”. Disponível em: <a href="https://iota.org/IOTA_Whitepaper.pdf">https://iota.org/IOTA_Whitepaper.pdf</a>. Acessado em: 22/12/2017.</p><p>Kaspersky, (2017). “Blockchain é uma tecnologia ruim?” Disponível em: <a href="https://www.kaspersky.com.br/blog/good-good-blockchain/9830/">https://www.kaspersky.com.br/blog/good-good-blockchain/9830/</a>. Acessado em: 22/12/2017.</p><p>Learn Cryptography. “51% Attack” Disponível em: <a href="https://learncryptography.com/cryptocurrency/51-attack">https://learncryptography.com/cryptocurrency/51-attack</a>. Acessado em: 22/12/2017.</p><p>IOTA Brasil, “ A Criptomoeda para a Internet of Things”. Disponível em: <a href="http://www.iotabrasil.com/2016/11/iota-criptomoeda-para-iot.html">http://www.iotabrasil.com/2016/11/iota-criptomoeda-para-iot.html</a>. Acessado em: 22/12/2017.</p><p>Antonopoulos, M. (2017). Mastering Bitcoin: Programming the Open Blockchain. 2nd Edition. Sebastopol, California: O ́Reilly Media.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df998fb61293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My vision about zero fees in Iota]]></title>
            <link>https://medium.com/@zerbinidamata/my-vision-about-zero-fees-in-iota-69fc0388ce08?source=rss-949cd6fa68b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/69fc0388ce08</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[micropayments]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[iota]]></category>
            <dc:creator><![CDATA[Rafael Zerbini]]></dc:creator>
            <pubDate>Sat, 25 Nov 2017 13:21:36 GMT</pubDate>
            <atom:updated>2017-11-25T13:24:41.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hY9nRJIaL0nrRqrHyLXU8Q.png" /></figure><p>Iota is the first cryptocurrency to get zero fees on transfers. And why is that so important ? When we talk about cryptocurrencys we immediately think about decentralized way of transfering money, without any middle intervation. So should we pay a fee for a decentralized way to transfer money? Of course when using blockchain you need to pay a fee so the miners have an incentive to use their <em>hashpower </em>to make a transaction possible. But what if you could tranfer without fees? Wouldn’t it be really decentralized? There is nothing taxing you for keeping you to make any kind of transactions, it being a large amount or a small amount. That is what Iota brings to cryptocurrencys.</p><p>Besides transfering money between people or enterpises, Iota possibilites transactions between IoT devices. That’s is such an amazin thing. Suppose that you want your IoT device requisite a service from another device and so you need to pay for the data from that device. This payments are of a small amount, such that we call them <em>micropayments. </em>When you think in a high quantity of transactions in this kind you really don’t want to pay a fee for each transaction, so using Iota there is no fees!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*pgnWD3qVm5uJ2Wqw9SdXOg.png" /></figure><p>This zero fees transactions is a great accomplishment in cryptocurrencys and it change a lot in the way we look at them. Hope to see Iota growing a lot. Keep following Iota news. Thanks for your time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69fc0388ce08" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>