<?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 apronotti on Medium]]></title>
        <description><![CDATA[Stories by apronotti on Medium]]></description>
        <link>https://medium.com/@apronotti?source=rss-29c3b269da20------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*u_p8O-rF7ABVXs6MXFlWNg.jpeg</url>
            <title>Stories by apronotti on Medium</title>
            <link>https://medium.com/@apronotti?source=rss-29c3b269da20------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:52:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@apronotti/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[How to build a Telegram bot to show Chainlink price feeds]]></title>
            <link>https://medium.com/@apronotti/how-to-build-a-telegram-bot-to-show-chainlink-price-feeds-3e0b8453c5aa?source=rss-29c3b269da20------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e0b8453c5aa</guid>
            <category><![CDATA[chain-link]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[telegram-bot]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[apronotti]]></dc:creator>
            <pubDate>Fri, 18 Mar 2022 13:00:47 GMT</pubDate>
            <atom:updated>2022-03-23T13:38:18.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Chainlink Price Feeds" src="https://cdn-images-1.medium.com/max/686/1*VQ68qYQPh7GC20kuSntAuw.png" /><figcaption><a href="https://data.chain.link/">https://data.chain.link/</a></figcaption></figure><p>The main idea of this tutorial is to show an example of how to develop a <strong>Telegram bot</strong> that consumes <strong>Chainlink price feeds</strong> for BTC/USD and ETH/USD pair of assets from <strong>Ethereum, Polygon and Binance Smart Chain</strong> mainnets.<br>The progam language used is <strong>python</strong></p><h3>Useful documentation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*c6gCIyqVfiWbFQfqmgXukA.png" /></figure><p>Source code of <strong>python-telegram-bot</strong> <a href="https://github.com/python-telegram-bot/python-telegram-bot">https://github.com/python-telegram-bot/python-telegram-bot</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*LSKLmoT8bu_8ETq_ls56WA.png" /></figure><p><strong>Price feeds</strong> <a href="https://docs.chain.link/docs/reference-contracts/">https://docs.chain.link/docs/reference-contracts/</a></p><h3>Introduction to Telegram Bot API</h3><p>This library provides a pure Python, lightweight interface for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>. It’s compatible with Python versions 3.6.8+. PTB-Raw might also work on <a href="http://pypy.org/">PyPy</a>, though there have been a lot of issues before. Hence, PyPy is not officially supported.</p><p>python-telegram-bot-raw is part of the <a href="https://python-telegram-bot.org/">python-telegram-bot</a> ecosystem and provides the pure API functionality extracted from PTB. It therefore does not have independent release schedules, changelogs or documentation. Please consult the PTB resources.</p><h3>Screenshot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*smdtlrOV_jMATjPEa8SwhA.png" /></figure><h3>Install from github repo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFPHUXdGmKcRv8LmD359hA.png" /><figcaption><a href="https://github.com/apronotti/telegram-bot-to-show-chainlink-price-feeds">https://github.com/apronotti/telegram-bot-to-show-chainlink-price-feeds</a></figcaption></figure><pre>git clone https://github.com/apronotti/telegram-bot-to-show-chainlink-price-feeds.git<br>cd telegram-bot-to-show-chainlink-price-feeds<br>pip install -r requirements.txt</pre><h3>Generate your bot and Access Token</h3><p>To generate an <strong>Access Token</strong>, you have to talk to <a href="https://t.me/BotFather">@BotFather</a> and follow a few simple steps (described <a href="https://core.telegram.org/bots#6-botfather">here</a>).</p><h3>Config</h3><p>With the bot <strong>Access TOKEN</strong> obtained in the former step:</p><ol><li>Copy or rename the file <strong>config.json.example</strong> as <strong>config.json</strong></li><li>Edit config.json file and replace the word <strong>TOKEN</strong> for the current <strong>Telegram Access TOKEN value</strong></li><li>Obtain and replace the <em>project ids</em> in congig.json for the RPC providers (example: Infura, Alchemy) to access the Ethereum and Polygon networks</li></ol><h3>Runing the bot</h3><pre>python3 btc_eth_query_prices_n_blockchains.py</pre><h3>Installing the bot in your Telegram App</h3><p>Once the bot was generated in the former step titled <strong>“Generate your bot and Access Token”</strong>, in Telegram app click on <a href="https://t.me/%5BNAME_OF_THE_BOT%5D">https://t.me/[<strong>NAME_OF_THE_BOT</strong>]</a><br>(You need to replace <strong>NAME_OF_THE_BOT</strong> with your bot name)<br>or<br>if you want, you can try the example bot at <a href="https://t.me/btc_eth_cl_query_prices_bot">https://t.me/btc_eth_cl_query_prices_bot</a></p><h3>Using the bot</h3><ol><li>In the Telegram App message field type <strong>/start</strong>, this command is used only one time to initialize the bot</li><li>Each time you want to query prices type <strong>/pricefeeds</strong></li><li>Choose one of the options <strong>“BTC/USD price”</strong> or <strong>“ETH/USD price”</strong></li><li>And wait the results</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*R3fjh3bZs9rpNFsnvc3xxg.png" /></figure><h3>Aditional information on how it works</h3><h3>Step by step, how to query a Chainink price feed in python</h3><ol><li>Go to <a href="https://docs.chain.link/docs/reference-contracts/">https://docs.chain.link/docs/reference-contracts/</a></li><li>Click on the chosen chain for example Ethereum</li><li>Copy the ETH/USD Proxy contract address 0x9326BFA02ADD2366b30bacB125260Af641031331 and use it in the next example.</li></ol><p>This example uses Web3 module to retrieve feed data from the ETH / USD feed on the Ethereum network.<br>In a terminal execute the fololowing commands:</p><pre># pip install web3</pre><pre># python3<br>Python 3.8.10 (default, Nov 26 2021, 20:14:08) <br>[GCC 9.3.0] on linux<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>&gt;&gt;&gt; from web3 import Web3<br>&gt;&gt;&gt; web3 = Web3(Web3.HTTPProvider(&#39;https://kovan.infura.io/v3/&lt;infura_project_id&gt;&#39;))<br>&gt;&gt;&gt; abi = &#39;[{&quot;inputs&quot;:[],&quot;name&quot;:&quot;decimals&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint8&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint8&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;description&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;string&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;string&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;_roundId&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;name&quot;:&quot;getRoundData&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;roundId&quot;,&quot;type&quot;:&quot;uint80&quot;},{&quot;internalType&quot;:&quot;int256&quot;,&quot;name&quot;:&quot;answer&quot;,&quot;type&quot;:&quot;int256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;startedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;updatedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;answeredInRound&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;latestRoundData&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;roundId&quot;,&quot;type&quot;:&quot;uint80&quot;},{&quot;internalType&quot;:&quot;int256&quot;,&quot;name&quot;:&quot;answer&quot;,&quot;type&quot;:&quot;int256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;startedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;updatedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;answeredInRound&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;version&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;}]&#39;<br>&gt;&gt;&gt; addr = &#39;0x9326BFA02ADD2366b30bacB125260Af641031331&#39;<br>&gt;&gt;&gt; contract = web3.eth.contract(address=addr, abi=abi)<br>&gt;&gt;&gt; latest_data = contract.functions.latestRoundData().call()<br>&gt;&gt;&gt; print(int(round(latest_data[1] / 10 ** 8, 0)))<br>2952 </pre><h3>Chainlink price queries are implemented in the following part of the source code of the bot</h3><pre>...</pre><pre><strong># Interface of Chainlink Price Feed Proxy contract<br>ABI_CL_PRICE_FEED</strong>= &#39;[{&quot;inputs&quot;:[],&quot;name&quot;:&quot;decimals&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint8&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint8&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;description&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;string&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;string&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;_roundId&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;name&quot;:&quot;getRoundData&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;roundId&quot;,&quot;type&quot;:&quot;uint80&quot;},{&quot;internalType&quot;:&quot;int256&quot;,&quot;name&quot;:&quot;answer&quot;,&quot;type&quot;:&quot;int256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;startedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;updatedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;answeredInRound&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;latestRoundData&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;roundId&quot;,&quot;type&quot;:&quot;uint80&quot;},{&quot;internalType&quot;:&quot;int256&quot;,&quot;name&quot;:&quot;answer&quot;,&quot;type&quot;:&quot;int256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;startedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;updatedAt&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint80&quot;,&quot;name&quot;:&quot;answeredInRound&quot;,&quot;type&quot;:&quot;uint80&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;version&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;}]&#39;</pre><pre># Read configuration from config.json<br>config = Configuration.load_json(&#39;config.json&#39;)<br>web3_ethereum = Web3(Web3.HTTPProvider(config.ethereum.apiprovider))</pre><pre>...<br><br>def hours_from_timestamp(self, timestampValue) -&gt; str:<br>    # convert timestamp to string of datetime format<br>    date = str(dt.datetime.fromtimestamp(timestampValue))<br>    # extract hours without seconds<br>    hours = date[-8:][:-3]<br>    return hours<br><br><strong># Query the price of ETH/USD from Ethereum, Polygon and Bsc networks</strong><br>def get_eth(self) -&gt; str:<br>    <strong># Address of Chainlink Price Feed Proxy contract<br></strong>    <strong>addr = self.config.ethereum.cl_contract_address.etherusd</strong></pre><pre><strong>    contract = self.web3Ethereum.eth.contract(address=addr, abi=self.ABI_CL_PRICE_FEED)</strong></pre><pre>    <strong># ETH/USD price query from Ethereum mainnet</strong><br>    <strong>latest_data = contract.functions.latestRoundData().call()</strong><br>    ethereum_data = (<br>            &#39;Ethereum&#39;, latest_data[1], self.hours_from_timestamp(latest_data[2]))</pre><pre>...<br></pre><p>This development was intended as an example to learn how to get prices from Chainlink in a simple way. If someone has in mind to put this bot into production environment I suggest implementing the price requests in asynchronous calls, the simplified cache in this code could be replaced by REDIS as a better tunable cache and it’s a good practice to refactor get_eth and get_btc functions into another more generic function to cover more price feeds.</p><h3>About Chainlink</h3><h3>About Chainlink</h3><p>Chainlink is the industry standard for building, accessing, and selling oracle services needed to power hybrid smart contracts on any blockchain. Chainlink oracle networks provide smart contracts with a way to reliably connect to any external API and leverage secure off-chain computations for enabling feature-rich applications. Chainlink currently secures fifty-nine of billions dollars across DeFi, insurance, gaming, and other major industries, and offers global enterprises and leading data providers a universal gateway to all blockchains.</p><p>Learn more about Chainlink by visiting<a href="https://chain.link/"> chain.link</a> or read the documentation at <a href="http://docs.chain.link/">docs.chain.link</a>. To discuss an integration,<a href="https://chainlinkcommunity.typeform.com/to/OYQO67EF?page=announcement"> reach out to an expert</a>.</p><p><a href="https://chain.link/">Website</a> | <a href="https://twitter.com/chainlink">Twitter</a> |<a href="https://www.reddit.com/r/Chainlink/"> </a><a href="https://discordapp.com/invite/aSK4zew">Discord</a> | <a href="https://www.reddit.com/r/Chainlink/">Reddit</a> | <a href="https://www.youtube.com/channel/UCnjkrlqaWEBSnKZQ71gdyFA">YouTube</a> | <a href="https://t.me/chainlinkofficial">Telegram</a> | <a href="https://blog.chain.link/tag/events/">Events</a> | <a href="https://github.com/smartcontractkit/chainlink">GitHub</a> | <a href="https://feeds.chain.link/">Price Feeds</a> | <a href="https://defi.chain.link/">DeFi</a></p><h3>About me</h3><p>I’m an experienced and passionate Systems Engineer with a demostrated history in development of technology enterprise products . Skilled in backend and middleware development, Sr software engineer, agile practices and team working. Strong entrepreneurial mindset and self-management with good practices to facilitate collaborative development.</p><p>Blockchain knowledge: development of smart contracts in EVM compatible networks, Web3 middleware development for DApps, expert in Chainlink Oracles.</p><p>You can contact me by email to apronotti@gmail.com. Follow me on Twitter <a href="https://twitter.com/alepronotti">https://twitter.com/alepronotti</a> and social media for future updates:</p><p><a href="https://twitter.com/alepronotti">Twitter</a> | <a href="http://www.linkedin.com/in/alejandro-pronotti">LinkedIn</a> | <a href="https://github.com/apronotti">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e0b8453c5aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[¿ Qué es un Oráculo Blockchain ?]]></title>
            <link>https://medium.com/@apronotti/qu%C3%A9-es-un-or%C3%A1culo-blockchain-2e49254cae2d?source=rss-29c3b269da20------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e49254cae2d</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[apronotti]]></dc:creator>
            <pubDate>Thu, 10 Sep 2020 19:58:54 GMT</pubDate>
            <atom:updated>2020-09-11T02:51:34.325Z</atom:updated>
            <content:encoded><![CDATA[<h3>¿ Qué es un Oráculo Blockchain ?</h3><h4>Y ¿ cuál es el problema del oráculo ? ¿ Por qué las propias blockchains no pueden realizar llamadas a las API ? (*)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*ySA4bfsdVLBMtWdoAi6c5Q.png" /><figcaption>Original background image from ©peshkov via Canva.com</figcaption></figure><h3>1. ¿ Qué es un oráculo ?</h3><p>Un oráculo de blockchain (cadena de bloques) es cualquier dispositivo o entidad que conecta una blockchain determinista (no estocástico) con datos externos a la blockchain.</p><p>Hay mucho contenido por analizar en esta oración.</p><p>Para entender qué son los oráculos blockchain y por qué los necesitamos, tenemos que enfocarnos en una de las características principales de blockchain “la descentralización”</p><h3>El problema con las blockchains</h3><p>La naturaleza de la blockchain es que tiene un libro contable distribuido y cada nodo en la red tiene que llegar al mismo resultado final tomando el mismo valor de entrada. Si no fuese de esta manera, cuando un nodo busca validar una transacción que hace otro nodo, terminaría con un resultado diferente. Esta arquitectura es intencional y está intencionalmente diseñada para ser determinista.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*36i3G3NBDn0M97BO7q4nWA.png" /></figure><p>Podemos ver que cuando enviamos $ 5 de Bob a Alice, podemos agregar fácilmente $ 5 al saldo de Alice y restar $ 5 del de Bob. Todos los nodos de la red podrían reproducir esto fácilmente, obtener los mismos resultados y terminar en el mismo estado.</p><p>Pero, ¿y si este no fuera el caso? Imaginemos una blockchain imaginaria en la que utilizan API (en inglés, <em>application programming interface)</em> para validar las transacciones de los demás. Supongamos que queremos enviar una cantidad variable basada en el precio de ETH a Alice desde la cuenta de Bob. Haremos que nuestro contrato llame a una API para obtener el precio de ETH y luego enviar esa cantidad a Bob. Cuando todos los demás nodos van a verificar esto, también deben llamar a esta API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*eW1pbq9_eu9O3F9J1ZzBqw.png" /></figure><p>¿Pero qué pasa ahora? Si llaman a la API incluso un instante después, la API podría haber cambiado (depreciado, corrompido o varias otras razones) y todos los nodos obtendrían un resultado diferente. Esto significa que ninguno de los nodos podría ponerse de acuerdo sobre cuál es el estado real de la cadena de bloques.</p><p>Es por esta razón que la blockchain Ethereum y la mayoría de las blockchains están diseñadas para ser completamente deterministas. Eso significa que si tuviéramos que reproducir cada transacción, terminaríamos en el estado correcto. Si incluye llamadas a API u otras fuentes no deterministas en la infraestructura de blockchain, existe una buena posibilidad de que la fuente se deprecie, corrompa o incluso simplemente se rompa, y no podríamos validar las transacciones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*zaWqOhrT2Ep2TL6YTzzAYQ.png" /><figcaption>(Image source: Chainlink)</figcaption></figure><p>En blockchain, el mecanismo para acordar un valor de datos se llama consenso, y el determinismo es importante para que los nodos puedan llegar a un consenso. Es posible que haya oído hablar de algunos de ellos, como Prueba de trabajo (PoW) con Consenso de Nakamoto o Prueba de participación (PoS) con Consenso bizantino. El consenso es uno de los ingredientes clave que hacen que blockchain funcione en primer lugar.</p><p>Pero necesitamos que el mundo blockchain se conecte con el mundo real. Necesitamos incluir el precio de ETH y otras criptomonedas en un contrato para poder tener DeFi (Finanzas Descentralizadas). Necesitamos obtener los datos meteorológicos para poder tener un seguro descentralizado. Necesitamos datos para usar blockchain para uno de sus propósitos más importantes, los contratos inteligentes. Entonces, ¿cómo conectamos los mundos con esta restricción?</p><h3>Cómo resuelven esto los oráculos</h3><p>Un oráculo de blockchain es cualquier dispositivo o entidad que conecta una blockchain determinista con datos externos a la misma. Estos oráculos ingresan cada entrada de datos a través de una transacción externa. De esta manera, podemos estar seguros de que la propia cadena de bloques contiene toda la información necesaria para verificarse a sí misma. Es por esto que los oráculos se conocen como middleware blockchain: son el puente entre los dos mundos.</p><p>Así que eso es todo ¡esto es genial! ¿Pero qué es esto que sigo escuchando sobre un “problema de oráculo”?</p><h3>2. ¿ Qué es un problema de oráculo ?</h3><p>Demos un paso atrás y recordemos por qué estamos construyendo en cadena en primer lugar. Una gran razón por la que hacemos algo en cadena es la descentralización. Sin embargo, los datos tienen que venir de alguna parte.</p><p>Si importamos datos de una única API, nodo o fuente, ahora esencialmente hemos eliminado todo el propósito de usar blockchain en principio. Un oráculo centralizado significa que una entidad tiene el poder sobre su contrato inteligente, y su contrato inteligente ahora no es mejor que un contrato regular. E incluso si el oráculo centralizado tiene las mejores intenciones, ya hemos visto ataques en los que un oráculo centralizado es atacado, desactualizado o no mantenido, y se produce una catástrofe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*y6YjxpI0ZFiE0MxAJnwTiA.png" /><figcaption>(Image source: Chainlink)</figcaption></figure><h3>Definición del problema del oráculo</h3><p>El problema del oráculo son estas dos piezas combinadas:</p><p>1. Las cadenas de bloques por sí solas no pueden acceder a datos externos.</p><p>2. El uso de oráculos centralizados anula la ventaja de los contratos inteligentes y son importantes riesgos de seguridad.</p><h3>La Solución</h3><p><a href="https://chain.link/">Chainlink</a> resuelve ambos y es el estándar para oráculos descentralizados.</p><p>Chainlink provee un esquema para elegir su red independiente de nodos, de esta manera podemos conectar los datos del mundo real a la cadena de bloques y permitir que los contratos inteligentes alcancen su verdadero potencial. Con esto, estamos aprovechando el mismo concepto de infraestructura descentralizada confiable que tiene la blockchain, aplicado a los oráculos de la cadena de bloques. Si los nodos / fuentes son corrompidos, depreciados o eliminados, la red de Chainlink aprovechará la red descentralizada y continuará.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dhxAp0MhBQTOBsG_kgXjsA.png" /><figcaption>Decentralized oracles are the solution. (Image source: Chainlink)</figcaption></figure><p>Hay mercados masivos que aprovechan la tecnología Chainlink para ayudarlo a elegir su red de nodos independientes de donde obtener sus datos. De esta manera, sus contratos inteligentes nunca se van a caer por la falla de un solo nodo.</p><p>La tecnología es independiente de la blockchain y trabaja constantemente para integrarse con más blockchains, de modo que todas las blockchains puedan tener acceso a datos externos confiables y seguros. Y lo mejor de todo, la documentación es excelente tanto para ingenieros principiantes y experimentados por igual.</p><p>Para obtener una explicación, puede ver este video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZJfkNzyO7-U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZJfkNzyO7-U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZJfkNzyO7-U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d58f872f90339dda444f9791cf1d1f22/href">https://medium.com/media/d58f872f90339dda444f9791cf1d1f22/href</a></iframe><p>Usar un oráculo blockchain es un gran riesgo y Chainlink ofrece un nuevo ecosistema fantástico en torno a los datos. Los oráculos de blockchain son la clave para desbloquear el futuro que los contratos inteligentes tienen para nosotros. Los oráculos también proporcionan una forma para que las cadenas de bloques se vean entre sí. Esto se conoce como interoperabilidad y es también un próximo paso importante.</p><p>Al final del día, para que los contratos inteligentes sean una forma superior de acuerdo, necesitamos acceso a datos diversos y confiables.</p><p>Por eso necesitamos oráculos.</p><p><em>(*) Este artículo es una traducción de </em><a href="https://medium.com/better-programming/what-is-a-blockchain-oracle-f5ccab8dbd72"><em>What Is a Blockchain Oracle?</em></a><em> cuyo autor es Patrick Collins. Las imágenes fueron obtenidas del mismo artículo.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e49254cae2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>