<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>yektin.eth</title>
        <link>https://paragraph.com/@yektin</link>
        <description>undefined</description>
        <lastBuildDate>Thu, 18 Jun 2026 09:22:31 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Validium]]></title>
            <link>https://paragraph.com/@yektin/validium</link>
            <guid>5Yw0YN9NLA6rZcHxsW9A</guid>
            <pubDate>Mon, 06 May 2024 15:02:44 GMT</pubDate>
            <description><![CDATA[Blockchains have to be created around a thing called blockchain trilemma. The point that they approach, the closer 2 will be the more powerful and the 3rd will be the least powerful specialty for them.Blockchain TrilemmaEthereum technology chooses security and decentralization besides scalability in the blockchain trilemma. So, there are some developments around Ethereum to solve the scalability issues of the network. We’ll talk about a scalability solution, Validium’s in this essay. Ethereum...]]></description>
            <content:encoded><![CDATA[<figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/93c37d224dd169b64a411848f47063b094521c142877d70119f2d355287ed54d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Blockchains have to be created around a thing called blockchain trilemma. The point that they approach, the closer 2 will be the more powerful and the 3rd will be the least powerful specialty for them.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d962c683b7e81cfbd07f5b70aa8d1ec9dc908efaecf2dcabd7ea3f1d65a5be92.png" alt="Blockchain Trilemma" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Blockchain Trilemma</figcaption></figure><p>Ethereum technology chooses security and decentralization besides scalability in the blockchain trilemma. So, there are some developments around Ethereum to solve the scalability issues of the network. We’ll talk about a scalability solution, Validium’s in this essay.</p><p>Ethereum’s current roadmap is based on a scalability solution called Rollups. Validiums are likely in several ways to Rollups however, they have a different approach for scalability.</p><p>We can say that Validium’s exists until Rollup’s become affordable. Why?</p><p>Like Rollups, Validiums tries to work with a slight amount of Ethereum mainnet usage but besides Rollups, data execution and data availability parts are done off-chain. Transactions proofs used zero-knowledge proofs, like how Zero-Knowledge Rollup does, and after executing the proofs they verify the proofs on Ethereum mainnet. In favor of Ethereum’s security infrastructure, verifying proofs on Ethereum mainnet makes security conditions better.</p><p>We said that Validium’s likelihood with ZK-Rollup’s execution and verification methods. That proof type is called Validity Proof.</p><p><strong>Validity Proof</strong></p><p>Validity Proof or Zero Knowledge Proof is a proof type for verifying transactions with standing between the verifier and prover. In the proving process, none of the proving data will be exported out of the system. With polynomial equations, they provide encryption and verification. Generally, they use 3 major polynomial hash schema:</p><p><strong>1- KZG (Kate-Zaverucha-Groth) Polynomial Commitments:</strong> The Prover puts up a polynomial, provides the proof, and commits the result. The verifier tests polynomials by sending a random value to the prover.</p><p>In this case, the prover knows the equation of the polynomial and the verifier knows the output value of the point from the polynomial equation that he/she gave. So, how the proof unknown can be known?</p><p>Proof unknown stands as a polynomial equation too. We’re trying to create a relation between this proof equation and the polynomial equation at the beginning. In this point, we’ll work like how we find the roots of a polynomial equation, we find the point that makes the polynomial equation zero. Division of this point and multiplication of this point with the polynomial equation at the beginning will give us the point that the polynomial equation equals zero.</p><p>As a result, we’ll get this equation:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4096c936cf9d9ec1e9614520af500bc0a5ef5ad1d1e777afbedd3920a6b54305.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Here, the q(s) value is our proof. If you want to learn more about this topic and see what happens in the further work you can work with <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.subspace.network/kzg-polynomial-commitments-cd64af8ec868">Elliptic Curve Pairing</a>.</p><p><strong>2- Bulletproof:</strong> Bulletproof, is a zero-knowledge argument that proves the interval of knowledge. This can be used; to convince the verifier that a number exists in an interval without providing any information about the encoded data itself.</p><p>This idea was created in 2017 by a group of cryptographical researchers at Stanford. Bulletproof, works with a discrete logarithm problem and Fiat-Shamir conversion to achieve the goal of itself.</p><p>The discrete logarithm problem makes the calculation of the input impossible with a one-way execution. And Fiat-Shamir conversion creates a digital signature with the achieved proof.</p><p>Unlike the KZG schema, there is no need for a relation between the prover and the verifier.</p><p><code>Small like a bullet but provides security like bullet-proof. - Shashank Agrawal</code></p><p><strong>3- FRI (Fast Reed-Solomon Interactive Oracle Proofs of Proximity):</strong> According to the small degree polynomial’s degree, makes us calculate the function’s value in a certain orbit.</p><p>We can create validity proof by using this schema. Generally, the KZG schema is in use.</p><p>Validium users’ assets are controlled by a smart contract that is deployed on the Ethereum network. Users can take their assets from Validiums using Merkle proofs. Data accessibility management can choose not to provide users with off-chain transaction data, freezing their assets or preventing them from withdrawing them.</p><p>The main difference between ZK-Rollups and Validiums is the data availability issue that we talked about here. Rollups and ZK-Rollups store the data on-chain but Validiums stores the data off-chain.</p><p><strong>How Validiums Interact with Ethereum?</strong></p><p>Validium works with the smart contracts deployed on the Ethereum mainnet.</p><p><strong>1- Verifier Smart Contract:</strong> Verifies the validity proofs of the transactions with state updates via Validium operators. This verification includes the transaction that is held off-chain and matching the data availability proofs with the off-chain transactions data.</p><p><strong>2- Main Smart Contract:</strong> Executes the committed states (Merkle proofs) via block producers. Besides this, this smart contract updates the Validium’s state after the validity proofs are proved on-chain.</p><p><strong>Commitment to Ethereum</strong></p><p>Because of is a scalability solution for Ethereum, Validium is connected to the Ethereum network at several points.</p><p>The transactions on Validium are not valid until verified at the mainnet. In Validiums, the inability to reverse or modify transactions made off-chain is evaluated as a result of on-chain approval, and the settlement is secured by the Ethereum chains’s settlement layer. Besides this, for verification of these transactions on-chain, the Ethereum chain needs to know of the Validiums’ states.</p><p><strong>How a Validium Works?</strong></p><p>In Validiums, the users&apos; transactions using the consensus mechanism PoS (Proof-of-Stake, a consensus mechanism that leans to the asset locking to the network) the transactions stored off-chain.</p><p>Validium chains’ operators, make the whole transactions on the chain to a chunk and accept these as input. As an output, they create valid proof for verifying that the transactions are valid or not.</p><p>Validium state hashed and stored with Merkle tree roots in the smart contract that deployed on Ethereum mainnet. Merkle trees are used to represent the current state of the Validiums. For a state update, operators create a new root and deploy it to the smart contract. After the validation of the validity proof provided, this root is accepted as a new state root.</p><p>If users want to send their assets to Validium from the Ethereum network, they will send their assets to the smart contracts. They will show this transaction to the off-chain data and the sent assets show up on the users’ portfolio in the Validium network. If the request is sending the asset on the Validium chain to the Ethereum chain, the user does a transaction to take the assets back and sends this transaction to the operator. The operator executes the transaction here and adds to a chunk. In this sending process, if a validity proof can be provided the users’ assets on the Validium chain are erased and the assets that are sent can be seen on the Ethereum mainnet. Also, the Validium structure can remove the bond with the operator and can make users directly interact with the Validium smart contract with Merkle proof.</p><p>The operator sends the chunk, that is filled with these transactions, to the verifier smart contract with validity proof and then proposes to create a new root to the main smart contract. If the proof is valid, the main smart contract updates the state of Validium and finalizes the transactions that are inside the chunk.</p><p>As a difference from ZK-Rollups, block producers won’t share the data inside the transaction chunk in Validium chains. They just share the header of the blocks.</p><p><strong>Data Availability and Validiums</strong></p><p>Storing the data off-chain may cause some issues about the control of the assets of users in Validiums. Several Validium protocol aims to solve this issue by making the state data storing decentralized. Blok producers send the data to the managers chosen for the data availability and these managers are responsible for storing these data off-chain and at the same time making these data available for users&apos; wants.</p><p><strong>Data Availability Committee (DAC):</strong> Several Validium protocols choose a trust-based system for the issue of stored data availability on off-chain data storage. This group is responsible for storing the states of data and a copy of the proofs for the data availability.</p><p><strong>Bonded Data Availability:</strong> As a data availability solution used in Validium’s. It requires participants who provide assistance for data accessibility to lock tokens into a smart contract to store off-chain data. This method is more sensible and decentralized rather than creating a trust-based committee.</p><p><strong>Volitions and Validiums</strong></p><p>Validiums should be chosen wisely for more valuable areas. So that Volition’s are created.</p><p>Volitions are a structure that combination of ZK-Rollups’ and Validiums’ chains. Users can choose between these scalability solution chains. More freedom can be provided by using the different benefits of ZK-Rollups and Validiums. Especially the usage of the Volition structure in decentralized exchange platforms makes more sense in scalability, privacy, security, and non-trust-based systems.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/edfecb595fbd91d04a94edfaa5a4c25b9d75fcef5ace9078da9704892f09c7db.png" alt="Source: StarkEx" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: StarkEx</figcaption></figure><p><strong>Validiums and EVM Equivalency</strong></p><p>The problem of not working with smart contracts on ZK-Rollups that was talked about in <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=ppq35e-NPWU">Ethereum’s current roadmap live stream in ITU Blockchain</a> exists in Validiums too. Execution of smart contracts and implementation of them is hard work under the Validium structure.</p><p>To overcome this problem, some Validium protocols aim to create custom bytecodes on top of smart contract languages that are already EVM-compatible (e.g. Solidity, Viper) to provide an efficient processing structure. However, this would require developers to work in a completely new development environment, which is not preferred.</p><p>In this topic, the zkEVM (Zero-Knowledge EVM) structure’s development is a living idea. The goal with it is producing and verifying zero-knowledge proofs with EVM-compatible machines. With a zero-knowledge compatible EVM, we can work with smart contracts on zero-knowledge proof used protocols (ZK-Rollups and Validiums).</p><p><strong>How Validiums Participate in Scaling Ethereum?</strong></p><p><strong>1- Storing Data Off-Chain:</strong> As from the Rollups’ structure, the scalability level relies on Ethereum mainnet’s data network bandwidth. In the other way, Validiums stores the transactions’ data off-chain and just sends the committed states and validity proofs to the Ethereum mainnet. In this way, they can contribute to scaling by performing minimal transactions on the Ethereum mainnet.</p><p><strong>2- Recursive Proof:</strong> This proof type is a validity proof and verifies the other proofs. We can say it is like the proof of the proofs. They can contribute to the scaling in a way that increases the amount of executable transactions on the blockchain.</p><p><code>Validity proofs can make a risky situation because of the needed special hardware.</code></p><p><code>Because Validiums creating a new structure on the development part, they can have some issues about onboarding developers to their ecosystem.</code></p><p>The main projects using the Validium structure are StarkEx by StarkWare and zkPorter by Matter Labs.</p><p><strong>StarkEx</strong></p><p>StarkEx is a Layer-2 scaling solution that relies on validity proofs. As ZK-Rollup and Validium at the same time, it includes different types of data availability methods.</p><p><strong>ZK-Rollup &amp; StarkEx:</strong> This architecture is used for StarkEx futures and StarkEx spot tradings. The data is stored on-chain. The benefit of a non-trust setup is used as an advantage. However because of creating a proof for every update, there is an existing fee for each transaction.</p><p><strong>Validium &amp; StarkEx:</strong> This architecture is used for StarkEx futures and StarkEx spot tradings. The data is stored off-chain and a Data Availability Committee is preferred. Because of the data stored off-chain, the fee on the chain is pretty low. If we want to change the on-chain state, then we need to pay some fees. Storing the data off-chain provides some commitment about privacy but don’t forget that in this setup this work is done by a trusted setup.</p><p><strong>Volition &amp; StarkEx:</strong> This architecture is used for StarkEx spot tradings. This architecture is a combination of two other scaling solutions so if there is a need for something we can change the method whatever we want to.</p><p>The name of Validium is proposed by StarkWare:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/VitalikButerin/status/1267455602764251138">https://twitter.com/VitalikButerin/status/1267455602764251138</a></p><ul><li><p>StarkEx provides some developments in privacy areas:</p><p><strong>OND (Rollup):</strong> Storing the encoded data on-chain.</p><p><strong>OFFD (Validium):</strong> Confidentiality can be ensured by ensuring that the data availability committee does not act contrary to its responsibilities.</p></li><li><p>StarkEx developed two different development designs as a data availability solution:</p><p><strong>Minimally Viable Rollback (MVR):</strong> What if the data is inaccessible beyond OFFD solutions? Let&apos;s think that both the operator and data availability committee have an issue. In this type of case, this design aims to ensure continuity by returning to a state where data is accessible instead of a state where data is inaccessible.</p><p>Trustless Off-chain Data Availability (TODA): In this solution, users can choose to be Power Users (PU). Users who choose to become Power Users are authorized to sign for every piece of evidence and can verify their own transaction with this signature.</p></li></ul><p><strong>zkPorter</strong></p><p>zkPorter is a Layer-2 solution that develops a hybrid approach to data availability using zkRollup and sharding ideas. zkPorter is thought of as more secure than the Ethereum mainnet (a.k.a. Layer 1). In the worst case, even if 2/3 of locked assets on the network got hacked the execution of this data stopped and the state froze for taking assets back.</p><p><strong>Polygon zkEVM Validium</strong></p><p>Polygon develops two different solutions: Polygon zkEVM (a Rollup solution) and Polygon zkEVM Validium (old Polygon PoS). They plan to make this solution work with the power of Polygon CDK.</p><p>Polygon says that: “Let&apos;s become Rollup and Validium at the same time. If this both structure uses the same validators and the same liquidity pool, this could be good.”</p><p><strong>Manta Network</strong></p><p>Manta Network aims to work as a Validium using Polygon zkEVM as zkEVM and Celestia as a data availability solution.</p><p><strong>Celo</strong></p><p>Celo, originally known as a mobile blockchain (Celo aimed to send crypto assets via phone numbers instead of crypto addresses), is evaluating becoming an Ethereum layer 2 solution as Validium using Polygon CDK, a proposal recently opened by Polygon Labs.</p><p>Nowadays, they are thinking about the OP Stack to integrate.</p><p><strong>Immutable X</strong></p><p>Immutable is an NFT-centric blockchain. They are aiming to become a Volition with Validium and ZK-Rollup at the same time.</p><p>Also, Immutable works on a zkEVM structure beyond Polygon CDK.</p>]]></content:encoded>
            <author>yektin@newsletter.paragraph.com (yektin.eth)</author>
        </item>
        <item>
            <title><![CDATA[Oracle Issue]]></title>
            <link>https://paragraph.com/@yektin/oracle-issue</link>
            <guid>MNl7lo5ZiEafM5FMexdt</guid>
            <pubDate>Sat, 27 Apr 2024 00:39:45 GMT</pubDate>
            <description><![CDATA[Since Ethereum was born, different algorithms and structures have been developed to provide smart contracts with the necessary data from off-chain resources. These products are generally named as Oracle’s (data providers). Little Information about Smart Contracts Before deep diving into the Oracles, let’s talk about the code structures that blockchains need. If you read something as a starter that is related to blockchains or smart contracts, probably the first thing that you will see is the ...]]></description>
            <content:encoded><![CDATA[<p>Since Ethereum was born, different algorithms and structures have been developed to provide smart contracts with the necessary data from off-chain resources. These products are generally named as Oracle’s (data providers).</p><p><strong>Little Information about Smart Contracts</strong></p><p>Before deep diving into the Oracles, let’s talk about the code structures that blockchains need.</p><p>If you read something as a starter that is related to blockchains or smart contracts, probably the first thing that you will see is the vending machine example.</p><p>Smart contracts work exactly like vending machines. Like a closed system, your wanted process will be happening by contacting the users via code structures.</p><p>As an example, you can see a basic storing smart contract written for Ethereum in Solidity language:</p><pre data-type="codeBlock" text="// SPDX-License-Identifier: MIT
pragma solidity &gt;= 0.8.2 &lt; 0.9.0;

contract Storage {
  uint256 number;

  function store(uint256 num) public {
    number = num;
  }

  function retrieve() public view returns (uint256) {
    return number;
  }
}
"><code><span class="hljs-comment">// SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> >= 0.8.2 &#x3C; 0.9.0;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Storage</span> </span>{
  <span class="hljs-keyword">uint256</span> number;

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">store</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> num</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
    number <span class="hljs-operator">=</span> num;
  }

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">retrieve</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
    <span class="hljs-keyword">return</span> number;
  }
}
</code></pre><p>This smart contract does the following:</p><ul><li><p>The first line declares the license type of the smart contract. Although most of the projects are open-sourced, this doesn’t mean you can copy all of the code and create a clone. This license type, declared with “MIT” means everyone can use this code but not all of them are represented as MIT declared. Later we will talk about Uniswap. Uniswap’s codes’ were copied by someone who created a clone named Sushiswap. After this happened, Uniswap changed their license type but they are still open-sourced.</p></li><li><p>In the second line, we declared the version of Solidity language that we’re using in this smart contract. It is something like declaring the library in other coding languages.</p></li><li><p>In the fourth line, with a curly bracket, we say that we’ll be beginning the smart contract.</p></li><li><p>In the fifth line, we define a variable for storing.</p></li><li><p>In the seventh line, in the “store” function, we’re doing the storing process with the variable we defined before.</p></li><li><p>In the ninth and last line, the “retrieve” function exports the variable that we stored out of the smart contract.</p></li></ul><p><strong>What are these Oracles?</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bbfa79bb565176ab4f7646e26603493c61f68e7ad1d0f1bad3176c7848112d71.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Oracles’ are the data providing services for the smart contracts to the need of the data’ from the outside world. We already talked about smart contracts working themselves and blockchains are isolated, generally. So, why do we need Oracles’?</p><ul><li><p>Price Info: Let’s do an explanation with a DEX (Decentralized Exchange Platform). If an user wants to exchange their crypto asset for another crypto asset, we need to provide both of the assets’ prices to the smart contracts. The exchange between the assets is processed by smart contracts and we’ll have the price information of the assets via Oracle.</p></li><li><p>Security: Besides providing the data, criticism of integrity and security is important. Even with the type of Oracle, there is a security vulnerability called arbitrage that could happen. Let’s do a composition between different DEXs that use different types of Oracles. Let’s say the first type provides data within 1 minute, and the second one provides within 5 minutes. What happens if the second type of Oracle provides data and the asset’s value is downs %90? After the DEX that uses the first type of Oracle, this DEX will list the asset %90 down rather than the second DEX. This gap is called arbitrage and it causes a security vulnerability. As you can see from this example, Oracle’s and Oracle’s type should chosen wisely to secure the protocols.</p></li><li><p>Randomization: If there is a need for randomization, we need to use Oracle because of the isolated structure of blockchains and smart contracts. At least in a gambling game, we need to provide the randomization of shuffling cards or the value of dice with Oracle’s.</p></li></ul><p><strong>Oracle Issue and Mastering Ethereum</strong></p><p>Mastering Ethereum is a book written by Ethereum’s creator that includes Ethereum and EVM (Ethereum Virtual Machine).</p><p>In Mastering Ethereum Oracle explained: “Oracles are the systems that provide external data to Ethereum smart contracts. Ideally, Oracle systems work like, not trusting another party and securing the idea of decentralization. EVM is a decentralized system that, works with consensus rules of the chain on the nodes for execution of smart contracts.”</p><p>“With working with consensus rules, EVM works as complete deterministic and only uses the Ethereum’s information itself and the information inside of the transactions.”</p><p>“In this situation, two things came up:</p><ul><li><p>Randomization in smart contracts,</p></li><li><p>Increasing the fee per transaction cause of storing external information in the system.”</p></li></ul><p>“Oracles are the bridges that connect smart contracts and off-chain products. In case of trust needed situations, like identity information’, although it is wrong on so many levels when considering the idea of Oracle’s, we’re using Oracle’s as a bridge in this situations too.”</p><p>“As a basis Oracle is are designed for doing three things:</p><ul><li><p>Obtain data from off-chain resources,</p></li><li><p>Transfer the obtained data with the transactions in the chain,</p></li><li><p>Storing the data inside the smart contracts storage for making it accessible for smart contracts.”</p></li></ul><p>“After making the off-chain data accessible via smart contracts storage parts, we can use this data from Oracle’s smart contracts with the “retrieve” function (look up the storage smart contract). Also, Ethereum nodes or clients that are directly connected to Ethereum can reach the accessible data stored in Oracles’ smart contracts.”</p><p>For more information, you can access the book from this <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereumbook/ethereumbook">link</a>.</p><p><strong>Oracle Types</strong></p><p>We’re dividing Oracle types like the diagram below:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/cead9cdd27876ae74919577a712cc96d26e42eb7ff1c86b890021ced38f97df4.png" alt="Diagram: Oracle Types" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Diagram: Oracle Types</figcaption></figure><p><strong>TWAP Algorithm and Oracle’s</strong></p><p>TWAP (Time Weighted Average Price) Oracle works with the same named algorithm. Working as taking data from the block in a specified time interval.</p><p>They provide the average price feed in a certain time interval. As an example, if an Oracle user chooses a 7-day time interval the user will get the average price of the asset(s) in the 7-day time interval.</p><p>This Oracle type was an alternative Oracle type for VWAP Oracle’s for avoiding the on-chain price manipulations.</p><p>Weighted average actually means that data from a pre-defined data set are multiplied by a pre-defined “weight” and then summing each of them. Generally, it gives more sharp results than our arithmetic average finding method.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/478c0105fde55286ee95202749d7d1d413ca3cc4fe0abf410c81a0ef57796074.png" alt="Formula: Arithmetic Average" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Formula: Arithmetic Average</figcaption></figure><p>Let’s explain this Oracle’s formula with an example:</p><p>Looking for the Ether’s (Ethereum network’s native token) average price in a 250-second time interval (T= Time Interval, P = Unit Price, C = Cumulative Value).</p><p>In the first case, while T= 0 second and P = $1200, C = 0 because:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f0bf213f2f5968d45762897f87a1b64a52eeafc8357c3b1696be1c00ce10274b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>In the second case, while T = 200 second and P = $1300, C = 240000 because:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7acdd8f4d86a0893d6136385d5b5cb17f6d425591b90ea020280e02773c38f1d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>In the third case, while T = 250 second and P = $1250, C = 305000 because:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1866b74e2f5fc38f6472fb3b62db668e43dd1e1fb4b6cb6104b2e969e1949c97.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>So in this conditions, our average price value in 250 seconds will be:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fb332506b13eeef543a022c8dbf9ee5b396cb1477c45deb69fa4a3ab92949c6c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The thing that you should be aware of here is, that TWAP Oracle uses the previous block’s data as price data. So, in any case of price manipulation try the security will be better.</p><p>In case of an attack, an attacker can try to get the last transaction under control and manipulate the prices but the attacker can’t predict which block is the next one. The attacker needs to control two or more blocks to make a successful attack.</p><p><strong>Uniswap and TWAP</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/50d7717a07fac595e1e5868eda4d739f2a39d67931dff4e7ca37f7e96eda4316.png" alt="Uniswap Logo" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Uniswap Logo</figcaption></figure><p>The unicorn logo that we get used to see everywhere, Uniswap. Uniswap is a decentralized exchange platform (DEX). The TWAP Oracle, that we talked about previously, was an Oracle type that was developed by Uniswap and even developed further in the next Uniswap versions.</p><p>Uniswap V2 works as well as the algorithm that we talked about above but Uniswap V3 works a little bit differently:</p><p>In Uniswap V2 the latest price value (price value <em>* time) will be calculated around a period while in Uniswap V3 the total tick count (tick</em> * time) in a certain period.</p><p>Tick: As a concept, in every p-valued price tick price is the power of 1.0001.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/327dc0d6076b273d6223b2446fa824a4ba554866ae0823a0b242174cc15bbe66.png" alt="Formula: Tick calculation" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Formula: Tick calculation</figcaption></figure><p>In V3, the Oracle structure works as calculating the geometric average in a liquidity pool instead of 2 assets’ last price with an arithmetic average. With this work, Uniswap calculates the reference prices for on-chain assets.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/389c86e90b731f3d0d3b79363df32cb09ec3658010972d47495d2e84e9b674f6.png" alt="Formula: Geometric Average" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Formula: Geometric Average</figcaption></figure><p>Liquidity pools are structures that include some type of assets with some type of amount, working within locked/unlocked assets and providing the liquidity for protocols. With these pools, the attacks will be harder.</p><p>As an example, if an attacker wants to attack a liquidity pool he/she has to add a certain amount of valuable assets that can manage all the assets in the pool. In liquidity pools, like Uniswap’s, this value amount could be 100M$+.</p><p>If we look from the time perspective, a product that uses TWAP Oracle will use a period as a structure by definition. So, an attacker needs to peg the price in this period which causes too much cost. In V3, the Oracle structure works as calculating the geometric average in a liquidity pool instead of 2 assets’ last price with an arithmetic average. With this work, Uniswap calculates the reference prices for on-chain assets.</p><p><strong>Uniswap V3 &amp; Security</strong></p><p>We told that in V3 instead of the arithmetic average algorithm, we’re using a geometric average algorithm. Let’s consider these two on manipulation cost and actuality of the price. What will be the attack’s cost on the two common consensus mechanisms: PoW (Proof of Work) and PoS (Proof of Stake)?</p><p>PoW is a system in which a group of people (called miners) connects their hardware to the chain and by solving the puzzles takes a return. In this way, the progress of the chain and security will be provided.</p><p>PoS, is a system in which a group of people (called validators) locking their virtual assets to the chain. They will take a return for the locked assets and in this way, the progress of the chain and security will be provided.</p><p>The values below are the costs required to generate %30 price volatility for a TWAP Oracle running on Uniswap V3 at ETH/USDC parity within 30 minutes (144 blocks):</p><ul><li><p>PoW: $23.7 trillion</p></li><li><p>PoS (with continuously controlled 2 blocks): $23.7 trillion</p></li><li><p>PoS (with continuously controlled 3 blocks): $9.5 billion</p></li><li><p>PoS (with continuously controlled 5 blocks): $103 million</p></li></ul><p>What is the solution to decreasing the cost of price manipulation as the block in control increases?</p><p>Temporary solutions:</p><ul><li><p>Could choose a longer period</p></li><li><p>Could choose a bigger liquidity pool</p></li></ul><p>As a long-term solution, the V3 geometric average structure will be the key. In this structure, if an attacker approaches the protocol he/she needs to take control of 73 blocks in 144 block intervals. This makes the attacks almost impossible to do.</p><p><strong>Bigger Piece in the Cake: VWAP Oracle’s</strong></p><p>VWAP (Volume Weighted Average Price) Oracle’s work with the same-named algorithm. Weight is represented as a volume in a specific exchange volume.</p><p>This Oracle type works in a specific period with the value of the asset multiplied by the volume. These values will be summed up and divided into total exchange volume (V = Volume, P = Price, n = Total Volume).</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/99ea87e86e91e9ad16b58f0e823531d9dff1056c73e9c33ecea59a03bd731f6e.png" alt="Formula: VWAP Oracle Calculation" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Formula: VWAP Oracle Calculation</figcaption></figure><p>As an example:</p><p>In the first exchange of assets, 150 Ether sold for $1300.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f2d2e021c11474ac395f5ee9f5a917bbf6673631337db8fc40d499a75ba75ea7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>In the second exchange of assets, 200 Ether sold for $1200.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/27cd395a61336641861a61980c2fa1695d6f11157264684801321c649c9ac52a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>In the third exchange of assets, 100 Ether sold for $1250.</p><p>In this Oracle type, the total that comes from volume and price (560,000) will divided to volume (450) and that comes with $1244 as the Ether’s price value.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9898b5987887546b4c2b21f58ce380203368920838ec7555b17b50f634b02f6d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p><strong>Chainlink and VWAP</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/054931b84cd755197013db64d490e65d1c64d0410604563cd0239a005b2e7260.png" alt="Chainlink Logo" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Chainlink Logo</figcaption></figure><p>Chainlink is the biggest data provider that uses VWAP algorithms on their Oracles.</p><p>In the beginning, Chainlink was an Oracle but currently, Chainlink develops products like off-chain data providers, randomization solutions, etc. Some of the current Chainlink solutions are Data Feeds, Data Streams, Automation, VRF, Functions, and CCIP.</p><p>Data Feeds and Data Streams are the solutions that provide the assets’ values. Data Streams is newer than Data Feeds, the general differences are:</p><p>Data Streams works with Chainlink Decentralized Oracle Network (DON). While Data Feeds also uses the DON structure, the difference here is instead of signing the transactions and sending them to Chainlink Data Engine as a report, Data Streams sends the answers directly on-chain.</p><p>Automation, with composed triggers of a certain type, does the work of triggering smart contracts in certain situations.</p><p>VRF (Verifiable Random Function), is a solution that we talked about the randomization in the Oracle Issue and Mastering Ethereum part. With a structure of randomization, smart contracts have verifiable results on randomization.</p><p>Functions, provide smart contracts with a trust-minimized space, allowing them to retrieve data from APIs and run specific features. As an example, it allows smart contracts to use the data from AWS (Amazon Web Services) or Google Cloud Storage.</p><p>CCIP (Cross Chain Interoperability Protocol), is a product that allows exchanging assets beyond different chains. Because blockchains are isolated systems, we need bridges for blockchains to communicate with other blockchains. In this type of situation, CCIP likely products are the trend topic products.</p><p><strong>How does Chainlink Work?</strong></p><p>Chainlink is a combination of decentralized worker nodes. Chainlink nodes don’t listen to the other Chainlink nodes, instead, they listen to the blockchain nodes&apos; requests and push the results as a transaction.</p><p>For rewarding trusted node workers and taking fees from users, Chainlink uses their token LINK.</p><ul><li><p>1st step: The user runs a smart contract that needs off-chain data. This request will have an order number named “Job ID” and after adding the required parameters to the result of work, this request will be pushed to Oracle’s smart contract.</p></li><li><p>2nd step: Oracle contract takes an action with the flow of the “Job ID” request including parameter values and fee price value (as LINK token).</p></li><li><p>3rd step: All Chainlink nodes that are connected to a blockchain network will become aware of the action.</p></li><li><p>4th step: The Chainlink node that sees the “Job ID” in the action and the assigned “Job ID” to them is paired, and becomes active. Takes action including request’s content with “Job ID” and parameters.</p></li><li><p>5th step: The Chainlink node that took the requested data, sends the result with a transaction to the Oracle smart contract. The transaction includes the result of the action.</p></li><li><p>6th step: Oracle smart contract, finds the owner of the request by looking for the order number (Job ID). The owner of the request, re-executes the smart contract with the coming result from the Oracle.</p></li></ul><p><strong>Oracle Type’s Advantages and Disadvantages</strong></p><p>The type we defined firstly, TWAP Oracles, could calculate the price value of the assets with an easy algorithm and easy work; VWAP Oracles calculates with off-chain and on-chain parts that add more complexity.</p><p>Besides VWAP Oracles, TWAP Oracles are impractical for escaping from price manipulation attacks. The change in a certain time interval will cause a big problem.</p><p>TWAP Oracles calculates the price value after a change, and VWAP Oracles could work with several exchange data while calculating the price value. This means that the TWAP algorithm works with the mined blocks while VWAP works with the algorithms that are based on volumes.</p><p>Because our key topics are decentralization and trust issues, we have to talk about a certain point. Because TWAP Oracles are controlled with smart contracts, they don’t work with a trust system based on the node’s information like VWAP Oracles. VWAP Oracle could encounter the off-chain Oracle node&apos;s refusion on changing the price values. So, based on this issue, verifiable Oracles and more secure Oracle solutions with staking mechanisms based on the PoS system are in development.</p><p><strong>Collision Problem</strong></p><p>Chainlink tries to use the “staking” method to solve the attack tries for VWAP Oracle users. If a wrong price value is sent or the sending process is refused, the staked assets would be held on by data providers.</p><p>However, this idea builds a structure based on a trusted-system. Because if you want to find a malicious data provider, you need to trust the data that comes from other data providers. What happens if all of them or most of them are providing wrong information?</p><p>In this situation, the wrong data that came from data providers was sent tot Oracle and the system had a collision.</p><p>TWAP type of Oracle’s are directly taking the data on-chain so, collision possibility is on the minimum level.</p><p><strong>Centralized Oracle’s</strong></p><p>Although our goal is solving the blockchain trilemma (scalability, decentralization, and security) sharply, there may be institutions that don’t want or need to solve this trilemma. Like CEX’s (Centralized Exchange Platform). Centralized Oracles are structures that provide data from only one source and have some security conditions. Because the data is provided from only one source, in a traditional finance system only one mistake can cause all systems to fall.</p><p>The most shown-up one in this area is Coinbase Oracle.</p><p><strong>Coinbase Oracle</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/259c21e3a2bceeb41bf5954edc0dd6a5c4f705cea9ca4d2d4756292ef35aad8d.png" alt="Coinbase Oracle Logo" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Coinbase Oracle Logo</figcaption></figure><p>Although Coinbase Oracle is a centralized oracle, it does all the work that we can do with decentralized oracles with centralization. Currently, Coinbase Oracle works on APIs, Coinbase Pay, and Coinbase Wallet.</p>]]></content:encoded>
            <author>yektin@newsletter.paragraph.com (yektin.eth)</author>
        </item>
    </channel>
</rss>