<?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 Iñigo Garcia de Mata on Medium]]></title>
        <description><![CDATA[Stories by Iñigo Garcia de Mata on Medium]]></description>
        <link>https://medium.com/@igmata?source=rss-4006c089b121------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EKg9kQYCxVx5XGg3XtgPtQ.jpeg</url>
            <title>Stories by Iñigo Garcia de Mata on Medium</title>
            <link>https://medium.com/@igmata?source=rss-4006c089b121------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:52:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@igmata/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[Aproximación a los Flash Loans]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://igmata.medium.com/aproximaci%C3%B3n-a-los-flash-loans-3b5447923d92?source=rss-4006c089b121------2"><img src="https://cdn-images-1.medium.com/max/681/1*HtcPwV-TiDl2xgLijchkEw.jpeg" width="681"></a></p><p class="medium-feed-snippet">Los Flash Loans son uno de los &#xE9;xitos m&#xE1;s importantes dentro de la corriente de DeFi, y por otro lado, uno de los terminos m&#xE1;s escuchados&#x2026;</p><p class="medium-feed-link"><a href="https://igmata.medium.com/aproximaci%C3%B3n-a-los-flash-loans-3b5447923d92?source=rss-4006c089b121------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://igmata.medium.com/aproximaci%C3%B3n-a-los-flash-loans-3b5447923d92?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b5447923d92</guid>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 18:14:18 GMT</pubDate>
            <atom:updated>2021-03-17T18:14:18.580Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Montando un ethSigner con Hashicorp vault]]></title>
            <link>https://igmata.medium.com/montando-un-ethsigner-con-hashicorp-vault-e6e09f8dbdfc?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6e09f8dbdfc</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Mon, 07 Dec 2020 03:18:19 GMT</pubDate>
            <atom:updated>2020-12-07T12:10:39.855Z</atom:updated>
            <content:encoded><![CDATA[<p>Uno de los productos más interesantes presentado por Pegasys es el ethSigner, una pieza dosftware que permite intermediar entre un nodo de Ethereum y nuestras aplicaciones, gestionando todo lo relativo a la cuenta con la que se este trabajando. En terminos un poco más tecnicos, es un pieza de software que expone la interfaz RPC de los nodos de Ethereum, con la sencillez de gestionar la cuenta (claves y nonce principalmente) pero evitando que esta informacion este en el nodo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*15vPXgrsfbQ6p3bdxRqUMg.png" /><figcaption>Flujo entre aplicacion, signer y nodo</figcaption></figure><p>En este articulo se seguiran los pasos para la creación de un ethSigner, que guarde las claves en un lugar significativamente seguro (Hashicorp Vault) de tal forma que se tendrá un intersante servicio para aquellas aplicaciones que quieran interactuar con blockchains basadas Ethereum.</p><p>Las herramientas que se van a utilizar son:</p><ul><li>Docker (<a href="https://www.digitalocean.com/community/tutorials/como-instalar-y-usar-docker-en-ubuntu-18-04-1-es">https://www.digitalocean.com/community/tutorials/como-instalar-y-usar-docker-en-ubuntu-18-04-1-es</a> instalación de Docker en ubuntu)</li><li>Ganache (<a href="https://www.trufflesuite.com/docs/ganache/quickstart">https://www.trufflesuite.com/docs/ganache/quickstart</a>)</li><li>EthSigner (<a href="https://docs.ethsigner.pegasys.tech/en/stable/">https://docs.ethsigner.pegasys.tech/en/stable/</a>)</li><li>Hashicorp Vault (<a href="https://www.vaultproject.io/">https://www.vaultproject.io/</a>)</li></ul><h4>Primer paso: Levantar una red de prueba sobre la que se lanzaran nuestras transacciones</h4><p>Este paso es sencillo, bastará con ejecutar el siguiente comando, con docker instalado en nuestro sistema, para que se levante una red de pruebas con ganache dentro de un Docker:</p><pre>docker run -p 8545:8545 --name=ganache trufflesuite/ganache-cli</pre><p>Con esto se tiene una instancia de docker corriendo una red de Ganache para pruebas.</p><p>Se podría levantar el entorno gráfico de ganache, sirviendo igual, para este ejemplo, para ser independiente del host, utilizaremos en todo lo posible contenedores de Docker.</p><h4>Segundo paso: Levantar un Hashicorp vault para almecenar claves privadas</h4><p>Este paso es un poco más complejo ya que hay evantar el Vault con una configuración apropiada para este desarrollo.</p><p>Es cierto que el ethSigner nos pide que para poder utilizar el Hashicorp vault, le debemos dar el token de acceso que el vault nos genera como <em>root. </em>En futuras revisiones exploraremos como poder evitar la utilización de este mecanismo y utilizar un sistema que no dé privilegios fuera del alcance del ethSigner, pero para este primer caso, vamos a aceptar esta opción como válida.</p><p>Primero, creamos un fichero de configuración con la configuración más sencilla para nuestro vault:</p><pre>{</pre><pre>  &quot;storage&quot;: {</pre><pre>    &quot;inmem&quot; : {}</pre><pre>  },</pre><pre>  &quot;listener&quot;: {</pre><pre>    &quot;tcp&quot;: {</pre><pre>      &quot;address&quot;: &quot;0.0.0.0:8200&quot;,</pre><pre>      &quot;tls_disable&quot;: &quot;1&quot;</pre><pre>    }</pre><pre>  },</pre><pre>  &quot;ui&quot;:&quot;true&quot;</pre><pre>}</pre><p>En este fichero se está diciendo al Vault que almacene en memoria todos los secretos, que el servicio esta escuchando en el puerto 8200 a todo y que active la interfaz gráfica (se puede acceder a la interfaz navegando a https://localhost:8200).</p><p>Al estar almacenando los secretos en memoria, cuando se apague el servicio, estos se borraran, si se quiere que persitan, la opción a configurar sería:</p><pre>&quot;storage&quot;: {</pre><pre>  &quot;file&quot; : {</pre><pre>    &quot;path&quot;: &quot;/vaultData&quot;<br>  }<br>}</pre><p>De esta forma, se almacenaran los archivos en esa ruta dentro del contenedor, si lo configuramos como un volumen, podremos recuperar la información si apagamos el contenedor.</p><p>A continuación se puede arrancar el contenedor utilizando el siguiente comando:</p><pre>docker run --cap-add=IPC_LOCK -v {{path_to_config_file_in_host}}:/data/vault/config.json -p 8200:8200 --name=signer-vault vault:1.2.2 server -config /data/vault/config.json</pre><p>Con el contenedor arrancado se puede navegar a <a href="http://localhost:8200,">http://localhost:8200,</a> donde se encontrará la siguiente pantalla:</p><figure><img alt="Vault unseal screen" src="https://cdn-images-1.medium.com/max/1018/1*88sGVwB7LbYszWV4xr88YQ.png" /><figcaption>Hashicorp Vault pantalla inicial</figcaption></figure><p>Aqui se indica cuantas partes se quieren generar de la clave de cifrado del Vault y cuantas requeriremos para volver a desellarlo. Para el caso que nos ocupa, con establecer 1 y 1 será más que suficiente (si se queire realizar un ajuste más fino de esta parte de la configuración, la información disponible en la documentacion del Vault es muy útil).</p><p>Una vez se han inicializado las claves, se pueden descargar tanto estas, como el token de acceso para el <em>root:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*t1w7HWg9lgLnsmsitYrbYw.png" /><figcaption>Pantalla postinicilización para descargar las claves.</figcaption></figure><p><strong><em>** Es importante guardar estos datos, tanto el root Token como los fragmentos de la clave (Key 1 en este caso). **</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*jq5XV6ChRtB--1WmzygioA.png" /><figcaption>Pantalla para el desellado del Vault</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*xFfbiMf3c8M_hEAcBuQS-g.png" /><figcaption>Pantalla de acceso una vez inicializado y desellado</figcaption></figure><p>Después se seguírá con la configuración del secreto,a continuación, se explica como conectar el Ethsigner con el Vault</p><h4>Tercer paso: Levantar el ethSigner conectado a la red pruebas y al Vault</h4><p>Primero, se deben crear un fichero que contendra el token de acceso <em>root</em> para incluirlos en el contenedor. El nombre del fichero puede ser cualquiera, en este caso será <strong>vaultToken. </strong>Una vez guardado el token en el fichero, se puede levantar el ethSigner:</p><pre>ethsigner --chain-id=2018 --downstream-http-port=8545 hashicorp-signer --host=127.0.0.1 --port=8200 --auth-file=vaultToken --tls-enabled=false</pre><h4>Cuarto paso: Añadir la clave privada como secreto en el Vault</h4><p>En este último paso, se va a añadir la calve privada con la que el ethSigner firmará las transacciones, y por tanto, la cuenta de ethereum asociada a este.</p><p>Para ello se crea dentro del hashicorp Vault un secreto bajo la siguiente ruta (ruta por defecto de acceso del ethSigner al secreto del vault, se puede configurar otra mediante el comando <em>signing-key-path</em>):</p><pre>/secret/data/ethsignerSigningKey</pre><p>Esto se puede conseguir accediendo a al entorno visual de hasicorp vault y creando un nuevo “secret engine”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*odcCPIIOuqgBjQuO0x3cfQ.png" /><figcaption>Botón para activar un nuevo motor de secretos</figcaption></figure><p>Se elige en el siguiente menú el motor kv:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*6vBRQLxKxfkEvfMbTv64Rg.png" /><figcaption>Selección de motor kv</figcaption></figure><p>Y se establece la ruta de secrets para poder almacenar la calve privada de ethereum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*GwkTlWtsxGrArXxtBzbonA.png" /><figcaption>Configuracion de motor kv</figcaption></figure><p>A continuación, se muestra el motor ya creado, con ningun secreto cargado:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*0XpyL6SLp6mbkFbKc4WXOA.png" /><figcaption>Vista del secret engine una vez creado</figcaption></figure><p>Haciendo click sobre el botón Create secret del motor, se nos mostrara la pantalla para crear el secreto de la clave privada para el eth signer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*OgkBXYTlPMNgBRqPWzZ-iQ.png" /><figcaption>Creación del secreto para la private key</figcaption></figure><p>Y tras hacer click en Save, ya estaría el secreto disponible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*ePEF0DnffQPnda8n7k9wVA.png" /><figcaption>Resultado de la creacion del secreto</figcaption></figure><p>Esta configuración del secreto, se puede realizar también mediante la linea de comandos del Vault y mediante llamadas al API del Vault, pero para el objetivo de este artículo se ha optado por la utilización de la interfaz gráfica.</p><p>Una vez realizados todos estos pasos, ya se puede utilizar el ethSigner como cualquier otro acceso por RPC a Besu, pero delegando la firma de transacciones al ethSigner.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6e09f8dbdfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Práctica con Hyperledger Besu]]></title>
            <link>https://igmata.medium.com/pr%C3%A1ctica-con-hyperledger-besu-dae0b67a284c?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae0b67a284c</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[hyperledger-besu]]></category>
            <category><![CDATA[español]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Mon, 21 Oct 2019 12:03:32 GMT</pubDate>
            <atom:updated>2019-11-27T13:21:49.992Z</atom:updated>
            <content:encoded><![CDATA[<p>Hyperledger Besu es uno de los últimos productos de Hyperledger, partiendo de la versión del cliente, creada por Consensys, Pantheon, Clearmatics ha cogido el relevo y ha creado este cliente dentro del ecosistema de Hyperledger. En este artículo se han agregado los tutoriales de su página web y de algunos foros para dar una visión completa y en español de cómo establecer una red de pruebas en local con la que aprender más sobre este cliente de Ethereum.</p><h3>Herramientas necesarias</h3><p>Hyperledger Besu está desarrollado con Java 11, por lo tanto, es necesario tener esta versión de java instalada.</p><blockquote>NA: Una vez dominado el funcionamiento de Besu, es interesante generar un Docker del cliente con la configuración que nos resulte más interesante, pero para llegar a ese punto yo siempre prefiero pasar por un entorno local en el que puedo “trastear” más fácilmente.</blockquote><p>El S.O. sobre el que se ha desarrollado la prueba es ubuntu 19.</p><p>Para instalar jabba , se puede seguir el README de su github (<a href="https://github.com/shyiko/jabba">https://github.com/shyiko/jabba</a>).</p><p>Con todo esto terminado, se puede pasar a la descarga de los binarios de Hyperledger Besu.</p><p>La versión de Besu utilizada en este ejemplo es la 1.3.0, la de Ethsigner es 0.3.1 y la de Orion 1.5.0.</p><h3>Generar binarios binarios</h3><blockquote>Traducido de su web (<a href="https://docs.pantheon.pegasys.tech/">https://docs.pantheon.pegasys.tech</a>).</blockquote><h4>Clonar el Repositorio Besu</h4><p>Se clona el repo Hyperledger/besu en un directorio de trabajo (/home/&lt;user&gt;/besu-net):</p><pre>git clone --recursive <a href="https://github.com/hyperledger/besu.git">https://github.com/hyperledger/besu.git</a></pre><h4>Generar Besu</h4><p>Después de clonar el repo, se entra al directorio de besu.</p><p>Se genera el binario con un wrapper de Gradle: gradlew, omitiendo los test:</p><pre>./gradlew build -x test</pre><p>Se entra al directorio de la distribución:</p><pre>cd build/distributions/</pre><p>Se descomprime el archivo generado:</p><pre>tar -xzf besu-&lt;version&gt;.tar.gz</pre><p>El binario está disponible en la carpeta descomprimida:</p><pre>cd besu-&lt;version&gt;/<br>bin/besu --help</pre><p>Para facilitar el desarrollo del ejercicio, es interesante mover la carpeta descomprimida al directororio raíz del proyecto:</p><pre>cp -R besu-&lt;version&gt; /home/&lt;user&gt;/besu-net</pre><h4>Descargar Ethsinger</h4><p>Para poder lanzar transacciones, Besu provée de una herramienta muy interesate, Ethsigner, que extrae del nodo la gestión de cuentas. Este comportamiento también se verá reflejado en clientes como parity, que ya han avisado de que en futuras versiones la gestion de cuentas no se podrá hacer directamente en el nodo.</p><p>Para instalar Ethsigner (traducido de la web) el método es sencillo, pudiendo descargar los binarios directamente del siguiente enlace:</p><p><a href="https://bintray.com/consensys/pegasys-repo/ethsigner/0.3.0#files">https://bintray.com/consensys/pegasys-repo/ethsigner/0.3.0#files</a></p><p>Después, basta con descomprimir el contenido de la carpeta:</p><pre>tar -xzf ethsigner-0.3.1-SNAPSHOT.tar.gz</pre><p>Y movemos el resultado a una carpeta donde resulte más cómodo de acceder</p><pre>mv ~/besu-net/ethsigner-0.3.1-SNAPSHOT.tar.gz ~/besu-net/ethsigner-0.3.1</pre><p>Ahora ya están las dos piezas necesarias listas para su utilización.</p><h3>Montar árbol de ficheros</h3><p>Para crear la red privada, se van a crear 3 nodos, 1 nodo validador y 2 nodos no validadores.</p><p>Se crean los 3 directorios, uno para cada nodo, dentro del directorio besu-net:</p><pre>mkdir node_1<br>mkdir node_2<br>mkdir node_3</pre><p>Y se crean 2 directorios en los que se generarán los ethsigners para los wallets que se van a manejar en el sistema:</p><pre>mkdir account_1<br>mkdir account_2</pre><p>Con este árbol de ficheros se puede empezar a montar la red.</p><h3>Inicializar los nodos</h3><h4>Nodo validador</h4><p>Primero, se va a crear el nodo validador de la red, para ello, se accede al directorio donde se va a crear este nodo:</p><pre>cd ~/besu-net/node_1</pre><p>La red que se va a crear utilizará el protocolo de consenso creado por Besu, Clique, que es el mismo protocolo de consenso que utiliza la red Rinkeby de Ethereum. En este enlace se puede encontrar más información sobre el protocolo (<a href="https://github.com/clearmatics/ion/wiki/Ethereum-Validation---Clique-PoA">https://github.com/clearmatics/ion/wiki/Ethereum-Validation---Clique-PoA</a>)</p><p>Para crear un nodo validador en este protocolo de consenso, lo primero es crear el fichero genesis.json y obtener el enode del nodo validador. Se empieza con la generación de un address para el nodo:</p><pre>~/besu-net/besu-1.3.0/bin/besu --data-path=~/besu-net/node_1/data public-key export-address --to=~/besu-net/node_1/data/node_1_address</pre><p>Ahora que ya se tiene el address del nodo 1, se puede ver el contenido del fichero que tendrá la siguiente apariencia:</p><pre>cat ~/besu-net/node_1/data/node_1_address <br>0xb641d88590f8c596b3fa8ad5b6109a177322e3e7</pre><p>Ahora, este address, sin el prefijo hexadecimal (0x), hay que copiarla en el fichero de genesis.json, que será de la siguiente forma:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48819789891ab1b88c34591f3dd8a916/href">https://medium.com/media/48819789891ab1b88c34591f3dd8a916/href</a></iframe><p>Dentro del parametro estraData, como se puede ver resaltado en negrita, ahí debe ir el address generado previamente</p><pre>“extraData”:”0x0000000000000000000000000000000000000000000000000000000000000000<strong>b641d88590f8c596b3fa8ad5b6109a177322e3e7</strong>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000&quot;</pre><p>El resto de parametros de configuración del fichero genesis, son los tipicos en Ethereum, solo son especificios de Clique:</p><ul><li>blockperiodseconds: Define el tiempo entre bloques</li><li>epochlength: parametro que define el tamaño de una época, en este caso, cada 30.000 bloques, es edcir, cada cuanto se recalcula el DAG de la cadena.</li></ul><p>Para poder tener un único fichero genesis en la red, se guardara en la raíz del proyecto ~/besu-net/</p><p>Ahora se creará el fichero de configuración para el nodo 1, este fichero se alamacenará en el directorio del nodo 1(~/besu-net/node_1). No olvidar cambiar &lt;user&gt; por el usuario actual.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9912efda4657749acbbcd9489cf851b/href">https://medium.com/media/c9912efda4657749acbbcd9489cf851b/href</a></iframe><p>En este enlace se puede encontrar información sobre los posibles campos de configuración del nodo (<a href="https://docs.pantheon.pegasys.tech/en/latest/Reference/CLI/CLI-Syntax/#config-file">https://docs.pantheon.pegasys.tech/en/latest/Reference/CLI/CLI-Syntax/#config-file</a>)</p><p>En este caso se ha configurado el nodo para que exponga todas las apis en el puerto rpc 8545 y el cliente se conecte por el puerto 30000. Se ha dejado un apartado para la configuración de la red privada, explicada al final de este árticulo, ya que no es estrictamente necesaria para su funcionamiento.</p><p>Ahora se puede iniciar el nodo 1 y obtener el enode para depues sincronizar el resto de la red. Esto se hace mediante el siguiente comando:</p><pre>~/besu-net/besu-1.3.0/bin/besu — config-file=~/besu-net/node_1/config.toml — bootnodes</pre><p>Si se esta usando jabba para la gestión de las versiones de java, ser anecesario primero indicar que se esta usando la version 11:</p><pre>jabba use openjdk@1.11.0</pre><p>El log de arranque del nodo devolverá:</p><pre>2019–10–21 12:28:27.824+02:00 | main | INFO | Besu | Starting Besu version: besu/v1.3.0/linux-x86_64/oracle_openjdk-java-11<br>2019–10–21 12:28:27.871+02:00 | main | WARN | Besu | Permissions are disabled. Cannot enable PERM APIs when not using Permissions.<br>2019–10–21 12:28:27.872+02:00 | main | INFO | StaticNodesParser | StaticNodes file /home/inigo/development/blockchainEnvironments/Besu/clique-network/node1/data/static-nodes.json does not exist, no static connections will be created.<br>2019–10–21 12:28:27.872+02:00 | main | INFO | Besu | Connecting to 0 static nodes.<br>2019–10–21 12:28:28.474+02:00 | main | INFO | KeyPairUtil | Loaded key 0x9683f07e51ed54f30a58332db6cdabc0f2413127961d2ca11bfa637a091a6f738c5f0f977d3cfbc0b603f7cf78b3b05f1c6d58d3f9b7d37d1b3198590e1d5ade from /home/inigo/development/blockchainEnvironments/Besu/clique-network/node1/data/key<br>2019–10–21 12:28:28.507+02:00 | main | INFO | RocksDBKeyValueStorageFactory | No existing database detected at /home/inigo/development/blockchainEnvironments/Besu/clique-network/node1/data. Using version 1<br>2019–10–21 12:28:28.744+02:00 | main | INFO | RocksDBKeyValueStorageFactory | No existing database detected at /home/inigo/development/blockchainEnvironments/Besu/clique-network/node1/data. Using version 1<br>2019–10–21 12:28:29.015+02:00 | main | INFO | ProtocolScheduleBuilder | Protocol schedule created with milestones: [ConstantinopleFix: 0]<br>2019–10–21 12:28:29.253+02:00 | pool-9-thread-1 | INFO | BlockMiner | Produced and imported block #1 / 0 tx / 0 om / 0 (0,0%) gas / (0x25f56213cdc8de8b818e5dbaab26a8ae689f3a962e436bc0b3957dd185d83b50) in 0,085s<br>2019–10–21 12:28:29.493+02:00 | main | INFO | Runner | Starting Ethereum main loop … <br>2019–10–21 12:28:29.493+02:00 | main | INFO | NetworkRunner | Starting Network.<br>2019–10–21 12:28:29.576+02:00 | nioEventLoopGroup-2–1 | INFO | NettyConnectionInitializer | P2P network started and listening on /0:0:0:0:0:0:0:0:30000<br>2019–10–21 12:28:29.577+02:00 | main | INFO | PeerDiscoveryAgent | Starting peer discovery agent on host=0.0.0.0, port=30000<br>2019–10–21 12:28:29.620+02:00 | vert.x-eventloop-thread-1 | INFO | VertxPeerDiscoveryAgent | Started peer discovery agent successfully, on effective host=0:0:0:0:0:0:0:0 and port=30000<br>2019–10–21 12:28:29.622+02:00 | vert.x-eventloop-thread-1 | INFO | PeerDiscoveryAgent | P2P peer discovery agent started and listening on /0:0:0:0:0:0:0:0:30000<br>2019–10–21 12:28:29.652+02:00 | main | INFO | DefaultP2PNetwork | Enode URL <strong>enode://9683f07e51ed54f30a58332db6cdabc0f2413127961d2ca11bfa637a091a6f738c5f0f977d3cfbc0b603f7cf78b3b05f1c6d58d3f9b7d37d1b3198590e1d5ade@127.0.0.1:30000</strong></pre><p>En negrita se puede observar el enode del nodo 1.</p><p>Ahora ya se tiene todo lo necesario para tener un nodo validador.</p><p>Se puede probar que el nodo esta levantado:</p><pre>curl -X POST --data &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;eth_chainId&quot;,&quot;params&quot;:[],&quot;id&quot;:1}&#39; localhost:8540</pre><h4>Nodos no validadores</h4><p>Los nodos no validadores se inician siguiendo un procedimiento parecido.</p><p>Crear las addresses de los nodos 2 y 3:</p><pre>cd ~/besu-net/node_2<br>~/besu-net/besu-1.3.0/bin/besu --data-path=~/besu-net/node_2/data public-key export-address --to=data/node_2_address</pre><pre>cd ~/besu-net/node_3<br>~/besu-net/besu-1.3.0/bin/besu --data-path=~/besu-net/node_3/data public-key export-address --to=data/node_3_address</pre><p>Y sus ficheros de configuración (se han variado los puertos en cada uno para que puedan convivir en la misma máquina):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85fef008fbce04ffba1cb64c4f5be691/href">https://medium.com/media/85fef008fbce04ffba1cb64c4f5be691/href</a></iframe><p>Estos ficheros se guardaran cada uno en los directorios de sus respetivos nodos (node_2 y node_3).</p><p>Con esto terminado, se pueden inciar cada uno de los nodos con los siguientes comandos:</p><pre>cd ~/besu-net/node_2<br>~/besu-net//besu-1.3.0/bin/besu — config-file=./config_node_2.toml — bootnodes=”<strong>enode://9683f07e51ed54f30a58332db6cdabc0f2413127961d2ca11bfa637a091a6f738c5f0f977d3cfbc0b603f7cf78b3b05f1c6d58d3f9b7d37d1b3198590e1d5ade@127.0.0.1:30000&quot;</strong></pre><pre>cd ~/besu-net/node_3<br>~/besu-net//besu-1.3.0/bin/besu — config-file=./config_node_3.toml — bootnodes=”<strong>enode://9683f07e51ed54f30a58332db6cdabc0f2413127961d2ca11bfa637a091a6f738c5f0f977d3cfbc0b603f7cf78b3b05f1c6d58d3f9b7d37d1b3198590e1d5ade@127.0.0.1:30000&quot;</strong></pre><p>Se ha resaltado en negrita el enode utilizado, que es el obtenido anteriormente al inciar el nodo validador.</p><p>Con todo esto, ya se tienen los 3 nodos funcionando y sincronizando.</p><p>Para probar que los nodos no validadores están conectados se pueden utilizar los siguientes comandos (nodo 2 y nodo 3):</p><pre>curl -X POST --data &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;eth_syncing&quot;,&quot;params&quot;:[],&quot;id&quot;:1}&#39; localhost:8541</pre><pre>curl -X POST --data &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;eth_syncing&quot;,&quot;params&quot;:[],&quot;id&quot;:1}&#39; localhost:8542</pre><h3>Generar wallets</h3><p>Para utilizar ethsigner con un wallet, es necesario generar un wallet de tipo V3KeyStore. Con este pequeño script para Node se puede generar un wallet de este tipo de forma sencilla.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5f6586d4cabfb4ac1d5d740e7a730ff/href">https://medium.com/media/d5f6586d4cabfb4ac1d5d740e7a730ff/href</a></iframe><p>El script se ejcutaria:</p><pre>PRIVATEKEY=&lt; 32bytes array in hex format, with 0x &gt; PASSWORD=&lt; your password&gt; node account_generator.js</pre><p>Y devolvería en el log el keystore:</p><pre>{“version”:3,”id”:”96ea3b57–39e0–4297–941a-9580ec281adc”,”address”:”6f1dfd035d83bd78cc01f7eb24655cd78ecce93f”,”crypto”:{“ciphertext”:”41bfc7058d29e2d85c50df79a08459f1f683fe2cca340cb5c80e398a588aa001&quot;,”cipherparams”:{“iv”:”d5ed24633dcd549cf9b38a58e4124bc0&quot;},”cipher”:”aes-128-ctr”,”kdf”:”scrypt”,”kdfparams”:{“dklen”:32,”salt”:”fa9b436ae2bba9b3749750d4e5f5aa0b0ba1aa39ccae1227797ff7c63eeaef14&quot;,”n”:8192,”r”:8,”p”:1},”mac”:”fb9c83a828ecb25080bfa97def6dc4c5ca8a3dac326e567b1ace4a14219c0139&quot;}}</pre><p>También se puede generar directamente el fichero redirigiendo la salida del log a un fichero:</p><pre>PRIVATEKEY=&lt; 32bytes array in hex format, with 0x &gt; PASSWORD=&lt; your password&gt; node account_generator.js &gt;&gt; ~/besu-net/account_1/keystore</pre><p>Para el account 2 sería:</p><pre>PRIVATEKEY=&lt; other 32bytes array in hex format, with 0x &gt; PASSWORD=&lt; your password&gt; node account_generator.js &gt;&gt; ~/besu-net/account_2/keystore</pre><p>Para el correcto funcionamiento del ethsigner, es encesario grabar la contraseña en un fichero:</p><pre>echo &quot;&lt;your password&quot; &gt;&gt; ~/besu-net/account_2/pass.pwd<br>echo &quot;&lt;your password&quot; &gt;&gt; ~/besu-net/account_3/pass.pwd</pre><p>Con esto ya estaría lo necesario para iniciar los ethsigner de cada cuenta</p><h4>Iniciar ethsigner</h4><p>Para cada una de las cuentas, se va a crear un ethsigner conectado uno al nodo 1 y otro al nodo 2.</p><p>Para iniciar cada uno de los ethsigner se ejecutan los siguientes comandos:</p><pre>cd ~/besu-net/account_1<br>~/besu-net/ethsigner-0.3.1/bin/ethsigner — chain-id=1729 — downstream-http-port=8540 — http-listen-port=8550 file-based-signer -k=./keystore -p=./pass.pwd</pre><pre>cd ~/besu-net/account_2<br>~/besu-net/ethsigner-0.3.1/bin/ethsigner — chain-id=1729 — downstream-http-port=8541 — http-listen-port=8551 file-based-signer -k=./keystore -p=./pass.pwd</pre><p>Estos ethsigner estas configurados para usar un fichero de tipo keystore, también se pueden configurar para utilizar otros recursos como Hashicorp Vault y Azure Key Vault.</p><p>Con esto ya estarían los 3 nodos corriendo y los dos ethsigners funcionando para probar el envio de transacciones.</p><p>Hasta aquí sería lo necesario para tener una red de pruebas en funcionamiento. Se puede probar cada ethsigner mediante (ethsigner 1 y ethsigner 2):</p><pre>curl -X GET <a href="http://127.0.0.1:8550/upcheck">http://127.0.0.1:8550/upcheck</a><br>curl -X GET http://127.0.0.1:8551/upcheck</pre><h4>Otros detalles</h4><p>La red está configurada con un coste de gas 0, pero se podría comenzar con la creación de los wallets y añadir en el genesis en el apartado de alloc cada una de las cuentas fijar un balance incial.</p><pre>&quot;alloc&quot;: {</pre><pre>  “0xaddress” : {</pre><pre>    “balance”:”0xad78ebc5ac6200000&quot;}<br>}</pre><p>También se pueden utilizar las cuentas que paarecen en el genesis de las cuales se tiene la clave privada y se puede generar su keystore con el fichero account_generator.js.</p><h3>EXTRA: inicializar Orion</h3><p>Además de lo habitual par aun cliente Ethereum, Besu provée una solución para generar transacciones privadas, llamada Orion.</p><h4>Descarga de Orion</h4><p>La version 1.5.0 de Orion se puede descargar del siguiente enlace: <a href="https://bintray.com/consensys/binaries/orion/1.5.0-SNAPSHOT#files">https://bintray.com/consensys/binaries/orion/1.5.0-SNAPSHOT#files</a></p><p>Una vez descarga, se descomprime el fichero y se mueve, por comodidad, a un nuevo directorio en la raiz del proyecto:</p><pre>tar -zxf  orion-1.5.0-SNAPSHOT.tar.gz<br>mv ./orion-1.5.0-SNAPSHOT ~/besu.net/orion-1.5.0</pre><h4>Inicializar Orion</h4><p>Para inciar la red de Orion en paralelo con la red de Clique, simplemente se tendría que crear dentro de cada nodo un directorio para incluir los ficheros de Orion:</p><pre>mkdir ~/besu-net/node_1/orion<br>mkdir ~/besu-net/node_2/orion<br>mkdir ~/besu-net/node_3/orion</pre><p>Ahora, se crearían las claves de cada uno de los nodos de la red de orion:</p><pre>cd ~/besu-net/node_1/orion<br>~/besu.net/orion-1.5.0/bin/orion -g node_1_key<br>cd ~/besu-net/node_2/orion<br>~/besu.net/orion-1.5.0/bin/orion -g node_2_key<br>cd ~/besu-net/node_3/orion<br>~/besu.net/orion-1.5.0/bin/orion -g node_3_key</pre><p>En cada nodo, se solicitará una contraseña para generar las calves, esta contraseña se debe almacenar en un fichero en cada nodo, esto se puedo hacer de forma sencilla con el siguiente comando:</p><pre>echo &quot;&lt; password node &gt;&quot; &gt;&gt; /home/&lt;user&gt;/besu-net/&lt;node&gt;/orion/pass.pwd</pre><p>Lo siguiente simplemente es crear un fichero de configuración para nodo dentro del directorio orion de cada nodo:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fce8973f3bf868f19ccc97457aa65c6e/href">https://medium.com/media/fce8973f3bf868f19ccc97457aa65c6e/href</a></iframe><p>Ahora para arrancar orion simplemente se haría:</p><pre>cd ~/besu-net/node_1/orion<br>../../orion-1.5.0/bin/orion ./node_1_config.conf</pre><pre>cd ~/besu-net/node_2/orion<br>../../orion-1.5.0/bin/orion ./node_2_config.conf</pre><pre>cd ~/besu-net/node_3/orion<br>../../orion-1.5.0/bin/orion ./node_3_config.conf</pre><p>Con esto ya estaría el nodo de orion funcionando en cada caso. Se puede comprobar que está levantado orion en cada caso utilizando el comando (nodo 1, nodo 2 y nodo 3):</p><pre>curl <a href="http://localhost:8888/upcheck">http://localhost:8880/upcheck</a><br>curl <a href="http://localhost:8888/upcheck">http://localhost:8881/upcheck</a><br>curl http://localhost:8882/upcheck</pre><p>Con esto ya estaría levantada una red completa de Hyperledger Besu para hacer prubas en un entorno local.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dae0b67a284c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A primer on contractual topology]]></title>
            <link>https://igmata.medium.com/a-primer-on-contractual-topology-316bd239129a?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/316bd239129a</guid>
            <category><![CDATA[smart-contacts]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Thu, 28 Jun 2018 16:58:53 GMT</pubDate>
            <atom:updated>2018-06-28T18:31:25.050Z</atom:updated>
            <content:encoded><![CDATA[<h4>In collaboration with <a href="https://medium.com/u/ef18a1735b81">Sara Esclapés</a></h4><h3><strong>Abstract</strong></h3><p>We define contractual topology as a new discipline that analyzes the characteristics of contracts in order to measure their degree or capacity for digitalization and automation through the lens of mathematical topology. The background to the problem is relevant, because with no legal validity, the reaction to the execution of a smart contract is subject to the goodwill of the parties involved in the process.</p><p>In this paper we present the first stage of a contract taxonomy, in order to produce a standard process to deploy a legal contract into a smart contract and retain its legal validity.</p><h3><strong>Introduction</strong></h3><p>Distributed ledger technologies, popularly known as “blockchains”, enable to streamline and automate relationships between unknown or competing parties without the need for trusted intermediaries or third parties. This property implicit in the blockchain protocols makes this technology a tool potentially applicable to a wide variety of sectors and agents, even involving new forms of organisation of economic, social and political activity.</p><p>The streamlining and automation of certain relationships, hitherto dependent on human intervention, generates economies of scale and spirals of productivity. Distributed registration protocols involve cost reductions, improved efficiency and a positive impact on the reduction of information asymmetry, concurrency issues and transaction costs in different markets.</p><p>Despite being at an early stage of development, with multiple solutions competing to become the next Internet model, the so-called value Internet, distributed ledger protocols are already seen as a key technology that will transform broad aspects of human activity. The convergence of this technology with other emerging technologies such as artificial intelligence and, in particular, the maturing of deep learning models, implies a qualitative and very relevant leap forward that must be explored from multiple angles, including ethical and social aspects.<br> <br>In the second generation distributed ledger protocols, special emphasis is placed on the development of tools to automate and emphasize the processes of executing information transactions within a blockchain. These tools are known as smart contracts, considered today to be a fundamental part of many of the applications developed using this technology.</p><h3><strong>Definition of a smart contract</strong></h3><p>A smart contract is defined as a piece of computer code (i.e. a program) designed to execute certain predefined actions under specific circumstances. The novelty of smart contracts compared to the automated execution of traditional code lies in the properties of distributed registration protocols. The design of these protocols produces the distributed and replicated execution of these processes in the different nodes of the network.</p><p>Thus, smart contracts allow the automation of user-defined actions in specific circumstances. In other words, smart contracts automate previously agreed responses based on information entered into blockchain or received from a predefined external source: an oracle. These “contracts” are not written in a language specific to legal discipline, but are materialized in computer code, and their execution does not require any specific action or express consent of the parties signing them. The technology itself provides the support of automation in response to particular pre-agreed values of the variables entered.</p><h3><strong>Is a “smart contract” a contract?</strong></h3><p>Giving a smart contract the consideration of a real contract seems a difficult hypothesis to sustain. In view of this fact, the question then arises as to what legal effects a smart contract may have on the parties to the contract, if it is even possible to use the terminology proper to the legal discipline.</p><p>The problem lies in the difficulty of translating interpretable clauses, vague or inaccurate phrases into computer code, as well as the existence of indeterminate legal concepts. This results in the inability to represent contracts of significant complexity in the form of a code, the clauses of which do not depend merely on the fulfilment of a logical condition.</p><p>Smart contracts are therefore too rigid and, in many cases, cannot fully represent the will of the parties. This limitation also applies to certain abstract or ambiguous aspects that are part of the contract and that not only cannot be interpreted by a machine (can be automated) but cannot even be digitised. This concept of digitisation will be explored in more detail in a later section.</p><p>In short, smart contracts are nothing more than pieces of code programmed to automate certain actions. They cannot be considered contracts, nor can they be considered intelligent. However, they could prove extremely useful in automating some relationships based on the fulfilment of objective conditions present in some specific contracts. It is also possible that, in cases where conditions can be interpreted under reasonably reliable data sets, the work of the smart contract could be supplemented by oracles managed by algorithms based on artificial intelligence models that offer sufficiently valid (sub-optimal) solutions to the problem of interpretation..</p><h3><strong>The role of contract topology: How to automate a contract so that it is code executable while retaining its legal properties.</strong></h3><p>We have designed a novel methodology that proposes to analyze the characteristics of contracts in order to measure their degree or capacity for digitalization and automation. The background to the problem is relevant, since, as mentioned above, without legal validity, the reaction to the execution of a smart contract is subject to the goodwill of the parties involved in the process. We have called this methodology contractual topology, and it is based on the application of concepts and relationships from the field of mathematical topology to the analysis and taxonomy of contracts.</p><p>Topology is the specialty of mathematics that studies those properties of geometric bodies that remain unchanged by continuous transformations. Using this definition, and taking the concept of the geometric body to the object of study of this document: the contract. In this way, it would be possible to identify the content of the contract that could be automated, bounded by a framework of limitations, which would be given by its wording, content or by its very nature.</p><p>This new discipline aims to provide tools and processes to design frameworks for the creation of new assets, assets that are both physical and digital, linked efficiently, legally, securely and transparently. In short, to solve a problem that is already evident in many of the implementations of the protocols and blockchain applications of second generation, and that has to do with the interaction and reliability between aspects inside and outside the network.</p><p>The contractual topology seeks to be a tool for the analysis of legal contracts for their subsequent digitalization in an ecosystem of distributed trust. This methodology, in short, seeks to find the tools to maximize the concurrence between the expressions of legal logic and the expressions of computer logic.</p><p>But the contractual topology aims to go further, analysing and making clear the limits of both sets of logics, and therefore the potentially “non-executable” components of a contractual relationship. In this way it is possible to create a new concept of intelligent contract that meets the requirements of the law and is both physical and digital. It is also possible to rethink contracts in chains of contracts, in which some parties are fully incorporated into the logic of a smart contract, and others retain non-executable components that can and should be validated in a traditional way.</p><p>The contractual topology takes some of the tools of mathematical topology, such as transformations or reductions, and a good range of other mathematical elements that operate on this new level of abstraction, offering an unexplored point of view to date.</p><h3><strong>The Contractual Topology methodology: An introduction to the taxonomy of contracts as smart contracts</strong></h3><p>The analysis of the contractual topology aims to offer a multi-stage process that defines the real possibilities of transforming a traditional contract into a smart contract that can be executed in a distributed and automated way within a distributed registration protocol.</p><p>The process aims to determine in a sequential manner the digitization capacity of the object of the contract, the capacity to automate the intrinsic processes, the reasonable objectivity or not of the clauses and the presence of independence or not between the clauses.</p><p>Below is a diagram that facilitates the sequence of processes suggested in order to analyze the taxonomy of the contract under the approach of the contractual topology:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0OUitrphsP-wrxD6" /></figure><h3><strong>Object digitization</strong></h3><p>The first step in the analysis process is to evaluate the possibility of digitising the subject of the contract. A priori, any contract which does not have as its object an asset or a right should be excluded as being digitalizable. This first, still crude, characterization is intended to draw a first line of work for which we establish a superjective application between legal contracts and smart contracts, so that only certain types of contracts will be legitimately reproducible as smart contracts under the current available technology.</p><p>Despite the need to analyse each individual case, this stage would make it possible to apply a first filter to rule out all contracts whose object is not an asset or a right. <em>For example, representing a physical asset that is the subject of a property right in digital format is relatively straightforward. At the other extreme, a confidentiality obligation is complex to represent digitally by its very nature, i.e. it requires additional information to understand its scope (limits of the confidentiality obligation or aspects of the business to which it applies, among others).</em></p><h3><strong>Automation of intrinsic processes</strong></h3><p>At this stage it is necessary to analyse to what extent the clauses that make up the contract reflect rights, obligations or movements that do not depend on effective actions by the parties.<br>Also including all those processes associated with the activities contemplated in the contract.</p><p>The need for effective and proactive actions creates boundaries in terms of contract automation, and therefore unavoidable execution. Properties usually well defined in smart contract environments. <em>For example, the application of a financial penalty for late payment is easily automated, as it depends on an objective fact: the arrival of a certain date. At the other end of the spectrum, it is difficult to automate the right of one party to terminate the contract or to claim damages when a breach by the other party has occurred.</em></p><h3><strong>Model A</strong></h3><p>The contracts under this model would be based on the need to involve (to some extent) the parties to the contract in the self-execution of the smart contract. It would be sufficient to require their intervention for certain actions that the parties do not want to occur automatically, for example by enabling the possibility of stopping the self-execution of the smart contract in certain circumstances, or for certain unscheduled events, allowing the execution of the smart contract to be suspended pending an order from one of the parties. In this way, the smart contract would remain fully integrated and executed in blockchain but would require certain activities of the parties to implement certain clauses or mechanisms.</p><p>In this sense, one could think of parties that act at the same time as oracles. Other options imply the delegation to third parties of potential criteria that would be suitable for implementation, even if such criteria were not a priori shared by the parties, since they are conditions subject to negotiation criteria, or strategic behaviour, in the sense of game theory. Different combinations of referees, oracles or even atomic legal assistants could be put in place to recreate path dependant pro active contract execution.</p><p><em>For example, a service contract. This type of contract typically includes clauses that regulate the rights and obligations of each party and that, although objective in most cases, require the action of one of the parties in order for the consequence stipulated in the contract to occur. Examples of this would be the obligation to provide the service in accordance with certain quality standards, an obligation of confidentiality, a right of access to the facilities of one of the parties, the right to terminate the contract for breach, clauses relating to the protection of personal data, etc. Only if a party considers that an obligation provided for in the contract has not been performed may it demand the activation of the relevant remedy mechanism. This therefore entails the need for the parties to intervene in the actual performance of the contract.</em></p><h3><strong>Objectivity of the clauses</strong></h3><p>Generally speaking, it is possible to define three main types of clauses within a contract. The aim of this phase is to classify the terms of the contract under analysis into one of the following three categories:</p><p><strong>Objective clauses: </strong>Those clauses of a contract that correspond to objective elements, and therefore their application is deductible from a decision tree.</p><p><strong>Subjective clauses:</strong> These are those clauses of a contract that correspond to elements that must be interpreted by the person reading the contract, therefore, their application translates into a set of possibilities with a certain distribution. A proper understanding over best execution paths among different sets of interpretations could be explored using deep learning tools.</p><p><strong>Ambiguous clauses:</strong> These are those clauses of a contract that correspond to objective elements expressed in a confused or uncertain manner and that give rise to a set of possibilities that can be equated under the same interpretation. Here, disambiguation analysis should be put in place and dealt with during the phase of the drafting of the contract. This tool may help not only smart contract integrity but traditional contract objectivity and neutrality.</p><h3><strong>Resolution of subjectivity</strong></h3><p>The purpose of this stage is to try to resolve, as far as possible, the subjectivity of the clauses classified as such. This is a difficult task, and is deeply related to the particular law system involved. In the spirit of the European continental tradition and, particularly, for the Spanish civil code (Article 1.281 onwards), the will of the parties, customs and traditions and all other sources that may be appropriate for the correct interpretation of the clauses of the contract must be applied.</p><h3><strong>Model B.1</strong></h3><p>This model contract would include those that, although they may be defined as a succession of automated clauses, present a scarce or indefinite lexical description, in such a way that it would be subject to the subjective interpretations of each of the parties involved, which calls for the inclusion of a third party, considered impartial, to resolve the differences of the participants.</p><p>These contract models, usually derived from formally incorrect contracts, are not the subject of a study of our methodology, although it is important to include in the analysis methodology tools that allow their identification and classification.</p><p><em>Example: master agreement for collaboration. Framework contracts are commonly used to define the general terms and conditions governing the relationship between two or more parties, with the aim of subsequently specifying the terms of that relationship for a particular product/service (usually by signing a specific annex). Such contracts may therefore contain interpretable, vague, generic clauses or even references to specific annexes that cannot be correctly interpreted without additional information on the legal relationship.</em></p><h3><strong>Independence of the clauses</strong></h3><p>The independence of the clauses is a desirable property for the transformation of a contract into a smart contract, since it facilitates the automated execution as there is no dependence on the path associated with the contract.</p><p>However, not all contracts can be built on the basis of independent clauses, which leads to the need to generate neutral execution processes that are path dependant.</p><p>Dependent clauses are defined as those clauses of a contract whose interpretation is directly linked to the previous clauses. For each possibility of a dependent clause, a new interpretation of the same contract could be reached, depending on whether the dependent clause applied.</p><p>The dependence on clauses differs from interpretable clauses in that, although there may be different interpretations depending on the dependencies, all of them are identifiable, unlike in cases with interpretable clauses, where it is not possible to identify all possibilities because they depend on the individual who interprets them.</p><p>In this case, the problem of automated enforcement lies in the need to establish independent mechanisms for the validation of clauses that trigger the applicability or otherwise of potential subsequent clauses. Therefore, in this case, the problem is reduced to the need to consider the different options of the flow diagram associated with the dependent clauses and the establishment of third parties that neutrally evaluate the compliance or inclination of clauses that trigger the following ones. In this sense, the figure of the oracle or the arbitrator plays a relevant role in this case.</p><h3><strong>Model B.2</strong></h3><p>If the object can be easily digitized, intrinsic processes automated, and clauses are independent (or transformed into various independent potential paths), then we arrive to a perfectly defined legal smart contract.</p><p>All those contracts with a high percentage of automated clauses would fit into this model. They would not require human intervention and could lead to the emergence of a new recruitment model based on tokenization.</p><p><em>Example: Consumer credit agreement. A consumer credit agreement is a transaction whereby a natural or legal person, in the exercise of his activity or profession, grants or undertakes to grant a consumer credit in the form of deferred payment, loan or credit facility or any other equivalent means of financing, to meet his personal needs, independently of his business or profession. This type of contract typically includes objective clauses, based on mathematical operations that determine, for example, the form of repayment of the credit, the interest rate to be paid, the commissions, the economic consequences of a total early repayment and even the intervention of guarantors. This type of contract, therefore, is easily automated, as most of the events they regulate depend on conditions that require little or no intervention by the parties. Although it would be complex to automate them 100%, the percentage of automated clauses in contracts of this type (mostly financial) is higher than in previous models.</em></p><h3><strong>Conclusions</strong></h3><p>With this brief document, we have tried to summarize an exhaustive process of contract analysis that aims to classify contracts into different models according to the capacity of the contract to be automated, that is, translated into computer code for its self-execution. The aim is not only to gain efficiency and save costs, but also to generate new models for contracting and creating digital assets, in which the optimum balance is found between the advantages of written contracts, the advantages of automating certain actions and the immutability and traceability offered by blockchain technology.</p><p>The taxonomy of contracts, and the implications associated with the possibilities of execution through smart contracts must be resolved in each case differently, in order to obtain the best possible approximation to an executable code model. In an ideal scenario, the object must be digitizable, the intrinsic processes automatable, the clauses objective and independent.</p><p>However, as has been demonstrated through simple examples in each case, different contract specifications imply imperfect versions of a perfect automation model. These imperfections can be resolved through the application of different techniques that range from changes in the legal wording of contracts, to the inclusion of neutral and independent agents that validate or provide objective data to the variables being executed, the need for arbitrators in the case of subjectivity or interpretable clauses, and the application of objective methodologies for the analysis and evaluation of the components of the contract.</p><p>The purpose of the contractual topology is to establish the basis for the analysis of these components and their relationships, in such a way that it is possible to transfer the version of the contract under the legal logic to the version of the contract under the logic of a programmable algorithm and executable in a neutral way on a distributed ledger protocol. The definition and limitation of transportable relationships and transformations from mathematical topology to algorithmic adaptation of contracts are among the next steps in this research. This methodology would also offer direct positive externalities in the field of objectivity and neutrality in the construction and taxonomy of contracts from the perspective of legal practice.</p><p>Finally, the possibility of incorporating automatic actors capable of finding ways to disambiguate clauses, the strategic analysis of path-dependent contracts, or even carrying out basic work on the syntax and morphology of contract clauses are among the future developments of this research.</p><h3>About the authors</h3><p>Sara Esclapés: Lawyer by the Universidad Autónoma de Madrid and double Master of Access to Law (ICADE) and Master in Global Business Law (ESADE). She is also a graduate in Business Administration and Management from the Universidad Autónoma de Madrid and a specialist in international marketing from the IEB (Instituto de Estudios Bursátiles). Experience in the legal field from both a commercial and new technology point of view, having participated in the legal, business and technological advice of large companies. He also has experience in advising start-up companies. Participation in projects related to the law of new technologies through volunteering (project “Entreculturas” for the protection of minors on the Internet) and seminars (a publication for FODERTICS V “Drones and their widespread use, a new challenge for the law”). Experience: Currently: Lawyer Blockchain at Grant Thornton, Department of Innovation and Technology. September 2016-November 2017: lawyer at CMS Albiñana &amp; Suárez de Lezo, commercial department. Experience in M&amp;A processes, commercial contracting, international corporate transactions and corporate law. December 2015-April 2016: Trainee lawyer in new technology and intellectual property law, OLSWANG, LLP. February 2015-June 2015: LandsCare S.L. Legal and business advice in a start-up phase.</p><p>Iñigo Garcia: Iñigo is an industrial engineer from the Pontifical University of Comillas — ICAI and is currently studying for a degree in computer engineering from the UNED. His professional career has been developed in various fields of engineering, and in recent years he has focused on blockchain technology and its applications to industry. Since Grant Thornton has developed several solutions for the industry using blockchain technology. He is also a member of the core identity team of Alastria, the Spanish consortium to promote blockchain technology nationwide. Within his academic career, he has been very involved with scientific training and development, directing master’s dissertations, writing informative articles and transmitting knowledge to the community.</p><blockquote>We want to send a special grateful to Carlos Fernandez for his incredibly help in the definition and writing of this article.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=316bd239129a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Desarrollo de una Dapp sencilla (I)]]></title>
            <link>https://igmata.medium.com/desarrollo-de-una-dapp-sencilla-i-9ea846fed780?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ea846fed780</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[desarrollo-de-software]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Wed, 13 Jun 2018 17:50:45 GMT</pubDate>
            <atom:updated>2018-06-13T17:50:45.952Z</atom:updated>
            <content:encoded><![CDATA[<h4>A raíz de mi charla sobre como desarrollar una Dapp en Ethereum, dejo a continuación este breve laboratorio que espero sirva de ayuda.</h4><p>El código esta disponible también en github: <a href="https://github.com/nefera606/BlockchainForDevelopers">https://github.com/nefera606/BlockchainForDevelopers</a></p><p>Se necesitaran las siguientes herramientas:</p><ul><li><strong>Atom</strong> (O cualquier editor de texto) <a href="https://atom.io/">[https://atom.io/]</a></li><li><strong>Ganache (TestRPC):</strong> Esta herramienta simula una blockchain y ofrece un API RPC de Ethereum <em>[</em><a href="http://truffleframework.com/ganache/"><em>http://truffleframework.com/ganache/][</em></a><a href="https://github.com/trufflesuite/ganache-cli"><em>https://github.com/trufflesuite/ganache-cli]</em></a></li><li><strong>Nodejs y npm:</strong> Uno de los principales entornos de desarrollo para aplicaciones en Javascript y su gestor de paquetes <a href="https://nodejs.org/es/"><em>[https://nodejs.org/es/</em></a><a href="https://www.npmjs.com/"><em>][https://www.npmjs.com/]</em></a></li><li><strong>Truffle:</strong> El entorno de desarrollo más sencillo para desarrollo de aplicaciones en Ethereu<a href="http://truffleframework.com/">m <em>[http://truffleframework.com/]</em></a></li><li><strong>Remix:</strong> Herramienta on-line para el desarrollo de smart contracts que ofrece interesantes consejos y alertas para debugging <a href="https://remix.ethereum.org/"><em>[https://remix.ethereum.org]</em></a></li><li>Documentación de solidity <a href="http://solidity.readthedocs.io/en/v0.4.21/"><em>[http://solidity.readthedocs.io/en/v0.4.21/]</em></a></li><li>Documentación de web3 versión 0.2x.x <em>[</em><a href="https://github.com/ethereum/wiki/wiki/JavaScript-API"><em>https://github.com/ethereum/wiki/wiki/JavaScript-API]</em></a><em> </em>y versión 1.0 <a href="http://web3js.readthedocs.io/en/1.0/index.html"><em>[http://web3js.readthedocs.io/en/1.0/index.html]</em></a></li><li><strong>Web de Infura (consensys):</strong> Este servicio permite conectarse a las redes de ethereum sin necesidad de tener el cliente corriendo <a href="https://infura.io/"><em>[https://infura.io/]</em></a></li><li><strong>Metamask: </strong>Este plugin para navegador permite acceder a servicios blockchain de manera transparente <a href="https://metamask.io/"><em>[https://metamask.io/]</em></a><em> </em>es importante remarcar la importancia de guardarse las 12 palabras que devuelve metamask al crear la cuenta.</li></ul><p><strong>El laboratorio se desarrollará en 6 pasos:</strong></p><ol><li>Instalación de las herramientas necesarias</li><li>Creación de Smart contract básico</li><li>Configuración del entorno para poder interactuar con la blockchain y el smart contract básico</li><li>Creación de aplicación javascript para interactuar con el smart contract</li><li>Desarrollo de test básico y explicación de su utilidad</li></ol><h3><strong>Resumen de instrucciones del laboratorio (OS ubuntu):</strong></h3><h4>Instalación de las herramientas necesarias</h4><p>Partiremos del punto de que se tiene la maquina configurada con el editor de texto favorito de cada uno instalado. Se abre un terminal nuevo y primero se procede a instalar Node.js y npm mediante NVM:</p><blockquote>$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash — sudo apt-get install nodejs</blockquote><p>Comprobación de que todo está correcto:</p><blockquote>$ node -v</blockquote><p>Comprobación de que npm también se ha instalado correctamente:</p><blockquote>$ Npm -v</blockquote><p>Instalación de Ganache:</p><blockquote>$ sudo npm install -g ganache-cli</blockquote><p>Instalación de Truffle:</p><blockquote>$ npm install -g truffle</blockquote><h4>Creación de Smart contract básico</h4><p>Se crea primero un proyecto vacío con el comando:</p><blockquote>$ truffle init</blockquote><p>Este comando crea una primera estructura de ficheros para empezar a utilizar el entorno de Truffle</p><p>Dentro de esta estructura de ficheros se encuentra la carpeta <strong>contracts</strong><em> </em>en la cual se situará el codigo de ejemplo de un Smart Contract básico en un fichero llamado <strong>myFirstContract.sol</strong></p><blockquote>pragma solidity ^0.4.21;<br>contract myFirstContract {</blockquote><p>Aquí se ha declarado el compilador de solidity a utilizar y el nombre del contrato “myFirstContract”</p><blockquote>//Declaracion de variables<br>address public owner;<br>uint256 private totalSupply;<br>mapping (address=&gt;uint256) internal balanceOf;<br>event Transfered(address from, address indexed to,uint256 amount);</blockquote><p>En este extracto del código se ve la declaración de las variables utilizadas</p><blockquote>//Constructor del contrato<br>constructor (uint256 _totalSupply) {<br>owner = msg.sender;<br>balanceOf[msg.sender] = _totalSupply;<br>totalSupply = _totalSupply;<br>}</blockquote><blockquote>//Modificadores<br>modifier onlyOwner() {<br>if(msg.sender != owner){<br>throw;<br>}<br>_;<br>}</blockquote><blockquote>//funciones del contrato<br>function send(address _to, uint256 amount) public {<br>require(balanceOf[msg.sender] &gt;= amount);<br>require(balanceOf[_to] + amount &gt;= balanceOf[_to]);<br>balanceOf[msg.sender] -= amount;<br>balanceOf[_to] += amount;<br>emit Transfered(msg.sender, _to, amount);<br>}</blockquote><blockquote>function getBalance(address _user) view public onlyOwner returns(uint256) {<br>return balanceOf[_user];<br>}</blockquote><blockquote>}</blockquote><h4>Configuración del entorno para poder interactuar con la blockchain y el smart contract básico</h4><p>Se configura el fichero truffle.js para interactuar con Ropsten y Ganache.</p><p>Primero se instala el siguiente paquete para poder utilizar la cuenta generada con Metamask en la instalación</p><blockquote>$ npm install truffle-hdwallet-provider --save</blockquote><p>Se modifica el fichero truffle.js para aceptar las redes deseadas</p><blockquote>var HDWalletProvider = require(“truffle-hdwallet-provider”);</blockquote><blockquote>var infura_apikey = “XXXXXX”;<br>var mnemonic = “lista de 12 palabras generada en metamask”;</blockquote><blockquote>module.exports = {<br> networks: {<br> development: {<br> host: “localhost”,<br> port: 8545,<br> network_id: “*” // Match any network id<br> },<br> ropsten: {<br> provider: new HDWalletProvider(mnemonic, “https://ropsten.infura.io/”+infura_apikey),<br> network_id: 3<br> }<br> }<br>};</blockquote><p>En este caso se han definido dos redes</p><ul><li><strong>Localhost</strong>: Red simulada por Ganache sobre la que se harán las primeras pruebas</li><li><strong>Ropsten</strong>: Testnet de Ethereum a la que se conectará Truffle gracias a Infura.</li></ul><p>Además, hay que remarcar que en la variable <em>infura_apikey</em> se debe añadir el apikey que se genera al crear la cuenta en Infura.</p><p>Acto seguido, se crea el fichero 2_migrate_contracts.js dentro de la carpeta <strong>migrations</strong>, este fichero es el encargado de decirle a truffle que contratos debe desplegar cada vez que se ejecute un <em>migrate. </em>El fichero tendrá la siguiente forma</p><blockquote>“use strict”;</blockquote><blockquote>const myFirstContract = artifacts.require(“./myFirstContract.sol”);</blockquote><blockquote>module.exports = deployer =&gt; {<br> deployer.deploy(myFirstContract);<br>};</blockquote><p>Despues de crear el fichero de migraciones, arrancamos la blockchain, Ganache en este caso. PAra ello, en un terminal nuevo se ejecuta el comando</p><blockquote>$ ganache-cli --port 8545</blockquote><p>Añadiendo el parametro <strong>port </strong>forzamos a que Ganache levante el <strong>RPC API </strong>en el puerto <strong>8545, </strong>suele ser el que funciona por defecto, pero para esegurarlo y que así funcione el fichero de configuración <strong>truffle.js,</strong> se fuerza el valor.</p><p>Con Ganache levantado, en la terminal original en la que se estaba trabajando, se ejecuta el comando</p><blockquote>$ truffle migrate</blockquote><p>Este comando desplegará el contrato “myFirstContract” en Ganache (por defecto)</p><blockquote>$ truffle migrate --network ropsten</blockquote><p>También se puede ejecutar este comando para desplegar el contrato en Ropsten.</p><p>Es necesaria una cuenta en INFURA para generar el apikey y metamask para simplificar el mnemonico.</p><p>Hasta aquí se ha visto como instalar las herramientas necesarias para crear una sencilla aplicación en Ethereum, como crear un contrato (no se ha entrado en la explicación del lenguaje de programación de solidity, del que existen ya numerosos ejemplos, y que se explicará en otro artículo) y como desplegarlo a Ganache (o Ropsten). En la siguiente entrega se explicará como crear una sencilla API que conecte con el contrato y como crear un frontal web que explote esta API para utilizar el contrato desde una interfaz gráfica.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ea846fed780" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Que es la identidad digital]]></title>
            <link>https://igmata.medium.com/que-es-la-identidad-digital-f02261caa2e4?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/f02261caa2e4</guid>
            <category><![CDATA[digital-identity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[identidad-digital]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Wed, 06 Jun 2018 08:54:56 GMT</pubDate>
            <atom:updated>2018-06-06T08:54:56.425Z</atom:updated>
            <content:encoded><![CDATA[<h4>Ejercicio de búsqueda del origen del concepto en perspectiva</h4><p>En este articulo reflexiono sobre lo que debería ser la identidad digital como referente de identidad personal en la sociedad actual, no solo como llave de acceso a servicios y recursos en la red.</p><p>Para poder empezar a entender el concepto de Identidad Digital, consultemos que significa según la RAE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81Ru0G2REL5XFLnUdgQxSA.jpeg" /></figure><p><strong>Identidad:</strong> Del lat. tardío <em>identĭtas, -ātis,</em> y este der. del lat. <em>idem</em> ‘el mismo’, ‘lo mismo’.</p><p><em>1. f. Cualidad de idéntico.</em></p><p><em>2. f. Conjunto de rasgos propios de un individuo o de una colectividad que los caracterizan frente a los demás.</em></p><p><em>3. f. Conciencia que una persona tiene de ser ella misma y distinta a las demás.</em></p><p><em>4. f. Hecho de ser alguien o algo el mismo que se supone o se busca.</em></p><p><em>5. f. Mat. Igualdad algebraica que se verifica siempre, cualquiera que sea el valor de sus variables.</em></p><p><strong>Digital:</strong> Del lat. <em>digitālis.</em></p><p><em>1. adj. Perteneciente o relativo a los dedos.</em></p><p><em>2. adj. Referente a los números dígitos.</em></p><p><em>3. adj. Dicho de un aparato o de un sistema: Que presenta información, especialmente una medida, mediante el uso de señales discretas en forma de números o letras. Termómetro digital.</em></p><p><em>4. adj. Que se realiza o transmite por medios digitales. Señal, televisión digital.</em></p><p><em>5. adj. Dicho de algunos medios de comunicación, especialmente de prensa: Que se publican en internet o en formato electrónico.</em></p><p><em>6. f. Planta herbácea de la familia de las escrofulariáceas, cuyas hojas se usan en medicina.</em></p><p>Quedándonos con las definiciones 1 de identidad, y la definición 4 de digital, Identidad Digital quedaría definido como:</p><blockquote><em>fem. conjunto de rasgos propios de un individuo o de un colectivo que lo diferencian de los demás y que se transmiten y almacenan en medios digitales.</em></blockquote><p>Si además tenemos en cuenta la definición 5 de identidad, y aunque sea una mera coincidencia, la identidad digital es una realidad que surge de forma casi natural en un entorno digital blockchain.</p><p>Una vez vista esta definición de Identidad Digital, toca plantear ¿Que es la Identidad Digital?¿Como debe ser? Para ello, es de gran utilidad plantearse el modelo de identidad digital que queremos implantar en un sistema. En los sistemas blockchain a día de hoy el modelo más utilizado es el de identidad soberana.</p><p>La identidad soberana es un modelo de identidad digital donde todas las acciones propias de la identidad y el control de los datos están en manos del usuario.</p><h3>Que debe ofrecer una identidad digital</h3><p><em>Enumeración y descripción de las características fundamentales de una identidad</em></p><p>Desde el punto de vista de cualquier usuario, un sistema de identidad digital debe permitir tres acciones muy concretas y que son la puerta a cualquier interacción digital que se quiera realizar:</p><p><strong>Autentificación</strong>: Toda identidad digital debe permitir a los usuarios demostrar , de forma unívoca, que son realmente ellos, y por tanto, pueden también exigir esta identificación a los demás usuarios. Con los mecanismos de autentificación, la identidad digital permite a los usuarios acceder a toda aquello que pueden hacer por ser ellos.</p><p><strong>Demostración</strong>: Uno de los pilares de la identidad es la capacidad de demostrar los atributos del usuario, es decir, una identidad demuestra que un usuario es como dice ser y cuenta con los atributos para ello.</p><p><strong>Autorización</strong>: Como parte asociada a cualquier identidad, esta la capacidad de autorizar y de ser autorizada para distintas acciones. Esta autorización puede ser implícita o explicita según lo que se puede demostrar de la identidad y si es capaz de autenticarse.</p><p>Estos elementos conforman todo lo que se le puede exigir a una identidad como tal, porque como se exponía anteriormente, una identidad digital identifica de forma que las acciones de autenticación, demostración y autorización se vuelven intrínsecas al individuo representado por su identidad.</p><p>En la sociedad actual, donde la identidad digital es un compendio de información proveniente de múltiples redes sociales, perfiles dentro de cada empresa en la que hemos comprado, solicitado información o visitado, y, como no, de los distintos entes gubernamentales. La tecnología blockchain permite establecer un nuevo paradigma de identidad centrada en el usuario, donde se mantiene el control de la información y tiene la capacidad de autenticar, demostrar y autorizar.</p><h3>Como se consigue la identidad digital</h3><p><em>La criptografía como herramienta de identidad</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ISgW36Fxx5c3h70r1Z2IQw.gif" /></figure><p>Gracias a la criptografía, se han podido crear mecanismos que aportan todas las características mencionadas anteriormente para crear una identidad digital. Gracias a la firma digital, un proceso criptográfico que permite asegurar que el emisor de un mensaje es realmente quien dice ser, por lo tanto, permite autenticar de forma digital. La digitalización tradicional (escanear, fotografiar, introducir manualmente) permite guardar información de formar digital, si a esto se le añade el cifrado y la firma digital (es decir, solo quien posee la clave puede acceder a la información, y además, podemos asegurar que el emisor del documento es quien dice ser) tenemos un sistema que permite demostrar mi información, presentando documentos digitalizados y/o digitales. Por último, gracias a la capacidad de la firma electrónica de asegurar que yo soy yo y la capacidad de enviar información cifrada, podemos crear un sistema digital de autorización, donde yo me autentico (identifico) y puedo ejecutar las acciones a las que estoy autorizado.</p><p>Con estos tres elementos llevados al mundo digital gracias a la criptografía, se crea un ecosistema donde pueden generarse diversos esquemas de identidad digital según los diferentes usos que vaya a tener la identidad, las garantías de protección de datos o los recursos que se quieran emplear.</p><p>Además, gracias a la criptografía, se pueden crear elementos bajo el principio de <strong>zero knowledge proof</strong>, o pruebas de conocimiento nulo. Estos elementos permiten contrastar la información cifrada sin necesidad de descifrarla. Por ejemplo, podríamos verificar que alguien es mayor de 18 sin necesidad de conocer su edad real. Pese a que estos elementos aún son muy costosos en términos de computación, su futuro es muy prometedor y permitirán crear identidades digitales para multitud de aplicaciones y en control de los propios usuarios.</p><h3>Blockchain como nuevo soporte de la identidad</h3><p>Las capacidades que ofrece la tecnología blockchain permiten la creación de sistemas de identidad que explotan las características ya mencionadas de la identidad digital, además de ofrecer un soporte para ofrecer cualidades como la certificación, transmisión de valor, portabilidad o inmutabilidad.</p><p>Dentro del ecosistema blockchain, has surgido diversas soluciones de identidad soberana (SSI) como Sovrin o Uport, que apuestan por sistemas donde el usuario es el único en posesión de los datos y ofrecen mecanismos de validación y transmisión de información de manera segura.</p><p>Además, dentro del mundo blockchain, el cual ha dado lugar a la aparición del concepto de token y tokenización, lo cual llevado al panorama de la identidad digital, da lugar al concepto de token de identidad. Y pese a la falta de definición de esto concepto, un token habitualmente es un elemento que representa el valor de un activo para poder comerciar con él, no encaja completamente en el concepto de identidad, puesto que la identidad es algo propio de la persona, y no se puede comerciar con ella en el sentido de que no se puede intercambiar por otro objeto de valor, se puede comerciar con el contenido de la misma y a quien se la cedemos para que lleve a cabo su modelo de negocio. Es cierto que como identidad, bajo la lupa de la tokenización, se puede llegar a la conclusión de que la identidad puede tener una versión física, analógica, … y una digital, y deben ser todas reflejo de la misma identidad, y todo lo que ocurre sobre esa identidad en cualquiera de sus versiones, debe reflejarse en las otras, siendo no solo una tokenización de la identidad sino una identidad con múltiples facetas equivalentes y conectadas.</p><p>Por lo tanto, desde mi perspectiva, la tecnología blockchain, fruto de la aplicación innovadora de las técnicas criptográficas, ofrece una respuesta muy potente para las soluciones de identidad digital accesibles para todos los ciudadanos con las siguientes características:</p><ol><li><strong>Seguridad y transparencia</strong></li><li><strong>Control de la información</strong></li><li><strong>Sencillez y agilidad de uso</strong></li><li><strong>Portabilidad e interoperabilidad</strong></li><li><strong>Robusted y fiabilidad</strong></li></ol><p>Espero que esta reflexión sirva para aclarar el concepto de identidad digital y generar sano debate alrededor de las ideas aquí expuestas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f02261caa2e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Topología contractual]]></title>
            <link>https://igmata.medium.com/topolog%C3%ADa-contractual-5bf5836ad234?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bf5836ad234</guid>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Mon, 14 May 2018 16:52:44 GMT</pubDate>
            <atom:updated>2018-05-14T16:52:44.034Z</atom:updated>
            <content:encoded><![CDATA[<p>Con motivo de nuestra ponencia en DevAcademy, mi compañera Sara Esclapés y yo queremos hacer una pequeña introducción a nuestra investigación actual, <strong>la topología contractual </strong>(ruego me perdonen los matemáticos por apropiarnos de este concepto y quizás no aplicarlo de la forma correcta).</p><p>Nuestro objetivo es buscar un punto común entre juristas y programadores para poder encontrar una forma de agilizar la ejecución de contratos. Se pretende encontrar un sistema que permita conocer el potencial de un contrato para ser automatizado, mediante la aplicación de reglas sencillas. De esta forma podemos hablar de áreas de acción, cláusulas de clausura, interpretaciones geométricas, etc.</p><p>En nuestro webinar contaremos más detalles y pronto tendremos un white paper en el cual contaremos nuestras conclusiones.</p><p>Os dejo aquí el enlace del webinar:</p><p><strong>Meetup</strong>: <a href="https://www.meetup.com/es-ES/DevAcademyES/events/250684648/">https://www.meetup.com/es-ES/DevAcademyES/events/250684648/</a></p><p><strong>Eventbrite</strong>: <a href="https://www.eventbrite.es/e/entradas-webinar-smart-contracts-blockchain-todo-lo-que-deberias-saber-46012530718">https://www.eventbrite.es/e/entradas-webinar-smart-contracts-blockchain-todo-lo-que-deberias-saber-46012530718</a></p><p><strong>Betabeers</strong>: <a href="https://betabeers.com/event/webinar-smart-contracts-blockchain-todo-lo-que-deberias-saber-8097/">https://betabeers.com/event/webinar-smart-contracts-blockchain-todo-lo-que-deberias-saber-8097/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bf5836ad234" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Criptografía básica para entender la tecnología blockchain]]></title>
            <link>https://igmata.medium.com/criptograf%C3%ADa-b%C3%A1sica-para-entender-la-tecnolog%C3%ADa-blockchain-eb94cdd64158?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb94cdd64158</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[criptografia]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[basics]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 10:05:11 GMT</pubDate>
            <atom:updated>2018-03-14T10:05:13.614Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Publicado en <a href="https://blockchain.grantthornton.es/">https://blockchain.grantthornton.es/</a></blockquote><blockquote>criptografía.</blockquote><blockquote>Del gr. κρυπτός <em>kryptós</em> ‘oculto’ y <em>-grafía.</em></blockquote><blockquote>1. f. Arte de escribir con clave secreta o de un modo enigmático.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vv0HNvRhU0ihKVaBIpDUww.jpeg" /></figure><p>La criptografía es la rama de la informática y las matemáticas que estudia los algoritmos utilizados para ocultar la información a quien no debe verla. Actualmente, son algoritmos que aseguran las comunicaciones digitales a lo largo de todo el globo.</p><p>Además, es uno de los pilares de la tecnología blockchain, que utiliza diversos algoritmos criptográficos para el funcionamiento de la red de nodos, la integridad de la cadena de bloques o los mecanismos de consenso, entre otros ejemplos.</p><p>Por ello, en el siguiente artículo se explican los mecanismos básicos de la criptografía para comprender un poco mejor como funciona la tecnología blockchain a día de hoy.</p><h4>CRIPTOGRAFIA SIMETRICA</h4><p>Desde los primeros momentos de la historia, la criptografía simétrica ha sido uno de los métodos más utilizados para el intercambio de información de forma segura.</p><p>En tiempos de los romanos, Julio Cesar, invento su propio sistema de cifrado. Consistía en escribir un mensaje, y luego “desplazar” cada letra un cierto número de veces:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3Gxi9Vn4sa6ch54RN5ieg.png" /><figcaption>Desplazamiento César para las primeras letras del alfabeto</figcaption></figure><p>La principal característica del cifrado simétrico es que existe una clave, que tanto quien emite el mensaje, como quien lo recibe, conocen. No es un sistema que se utilice habitualmente, pues el intercambio de esta clave requiere hacerlo de forma segura, para garantizar que solo emisor y receptor tienen la clave.</p><h4>CRIPTOGRAFÍA ASIMÉTRICA</h4><p>La evolución de los sistemas criptográficos llevó a la creación de los sistemas de clave asimétrica, donde se utiliza un mecanismo de claves que permite el intercambio de información sin que se requiera compartir la clave de forma previa. Este sistema utiliza dos elementos, uno privado y uno público. El privado lo guardamos en un lugar seguro, y el público se muestra a todo el mundo para que puedan interactuar con nosotros.</p><p>La peculiaridad de este sistema es que, para cada persona, existen un par claves, y cuando se quiere enviar información a alguien, se requiere primero su clave pública, se genera el mensaje cifrado y se envía a la persona. Esta podrá recuperarlo utilizando su clave privada.</p><p>Una manera sencilla de entenderlo es imaginarse la clave privada como una llave, y la clave pública como una caja que solo se abre con esta llave. Si nosotros queremos que nos envíen mensajes, dejamos cientos de cajas (todas iguales) en diversos lugares. De esta manera, cualquier persona podrá ir, coger nuestra caja (que no vale nada de momento, es una caja vacía), introducir el mensaje que nos quiera hacer llegar y cerrarla. En el momento en que se cierra, ya solo nosotros con nuestra llave maestra podemos abrir la caja, así, quien nos envía el mensaje puede enviar la caja de la forma que quiera y estar seguro de que solo nosotros seremos capaces de abrirla.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*3AvTEr0I1h4ZxHIevJpXUA.png" /><figcaption>Ejemplo de criptografía asimétrica</figcaption></figure><p>En resumen, en este sistema, la seguridad empieza y termina en el mismo usuario, siendo quien crea todas las claves (la llave maestra y las cajas en el ejemplo) y quien almacena en un lugar seguro las claves para descifrar. Es un sistema muy útil que permite a todos los usuarios utilizar un único canal de comunicación, pero, a cambio, requiere que se tenga, previamente al envío, la clave pública (las cajas del ejemplo) de cada usuario al que se quiere enviar información.</p><h4>FIRMA DIGITAL</h4><p>A raíz de los sistemas asimétricos, se creó un método que permite firmar digitalmente cualquier mensaje, asegurando que el mensaje proviene indudablemente de la persona que lo envía. Es decir, como en el mundo analógico, cuando firmamos una carta, aseguramos que somos nosotros y no otra persona haciéndose pasar por nosotros (Asumiendo que nuestra firma no puede ser falsificada fácilmente).</p><p>Utilizando el ejemplo anterior de criptografía asimétrica, imaginemos que ahora lo que creamos de forma única es la caja, y lo que cedemos a todo el mundo es la llave. De esta manera, cualquier mensaje que enviemos en esa caja, que solo nosotros podemos generar y en la que figuramos de remitente, solo se puede abrir con la llave que hemos repartido, y que todo el mundo sabe que es nuestra, así, cuando Alicia le envíe un mensaje a Bruno, al hacerlo dentro de su caja personal, Bruno podrá estar seguro de que el mensaje proviene de Alicia y de nadie más, evitando que alguien pudiera actuar en su nombre de forma malintencionada.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*2slPbNn364-AZWLIjJ1wMg.png" /></figure><p>En este ejemplo, al contrario del cifrado, la llave se convierte en el elemento público que se comparte con todo el mundo (dándole una copia a cada persona) y la caja en el elemento privado que solo yo conozco.</p><p>No todos los sistemas criptográficos de hoy en día permiten realizar las dos operaciones: cifrado y firma, algunos están orientados solo a sistemas de cifrado, otros a sistema de firma y otros sí que pueden actuar en los dos sentidos.</p><p>Apartándonos de los ejemplos visuales y resumir lo visto hasta este punto, los elementos que se crean en todos los sistemas criptográficos asimétricos son pares de claves, una pública y una privada. La clave privada es la que el usuario guarda y utiliza para descifrar los mensajes que recibe, así como para firmar los mensajes que envía. La clave pública es una clave que se pone a disposición de todos los demás usuarios, para que puedan cifrar los mensajes que quieran enviarnos, así como verificar nuestra firma digital. Como es lógico, la gran mayoría de los sistemas de intercambio de mensajes utilizan ambos mecanismos, cifrando y firmando los mensajes para que solo el receptor lo pueda entender y que además, esté seguro de que el mensaje realmente procede del emisor.</p><p>Como todos los sistemas digitales, no son perfectos, y existen vulnerabilidades y ataques que permiten actuar de forma malintencionada a pesar de la criptografía, pero por ello, gran cantidad de profesionales del mundo de la ciberseguridad trabajan cada día en hacer más seguros estos sistemas y en concienciarnos de como hacer un buen uso de ellos.</p><h4>HASH</h4><p>Por último, para poder entender un poco mejor todo los elementos criptográficos que se utilizan en la tecnología blockchain, hablaremos del hash.</p><p>Un hash es un elemento que se obtiene mediante una función hash. A estas funciones también se las conoce como “digestivas”, porque transforman la información a un elemento de tamaño fijo y con unas ciertas características, como si se tratase un “digerido” de la información.</p><p>Para entender un poco mejor los hashes, pensemos en el ADN. El ADN es un conjunto de elementos (casi siempre con el mismo número de elementos en todos los seres humanos) que todos tenemos, pero que con pequeñas variaciones es capaz de crear de forma única a todos y cada uno de nosotros. El hash de cualquier archivo es un conjunto de caracteres que se forma de manera única para ese archivo. De esta modo, si se hace el hash de dos archivos distintos, se obtendrán dos hashes distintos (de la misma longitud).</p><p>Este mecanismo es muy potente, pues nos permite, siempre y cuando utilicemos la misma “receta” (algoritmo) para crear el hash de un elemento, obtener un identificador único para dicho elemento. Esto nos permite también saber si un elemento ha sido modificado, es decir, si el elemento cambia, no puede mantener el mismo ADN.</p><p>Esto es muy potente y es uno de los elementos claves utilizados en la tecnología blockchain, permitiendo crear un ADN único para toda la información, asegurando así su inmutabilidad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*_lMTOaNVRWaCfzvB.png" /><figcaption>Obtenido de wikipedia: Ejemplo de hashes</figcaption></figure><p>Antes de terminar, quiero mencionar que las funciones de hash son algo más complejas de lo que he expuesto. Porque si intentamos llevar cualquier elemento, de cualquier longitud, a uno reducido de la misma longitud siempre, nos encontraremos con que existe más de un valor para el cual se obtendría el mismo hash. A este fenómeno se le conoce como colisión, y plantea ciertos problemas a la hora de utilizar algunas funciones de hash. Pero aun así, es una potente herramienta muy utilizada en el mundo digital.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb94cdd64158" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cryptocurrency and the fair trade]]></title>
            <link>https://igmata.medium.com/cryptocurrency-and-the-fair-trade-32dc289c1411?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/32dc289c1411</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[fair-trade]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Sun, 04 Mar 2018 22:56:42 GMT</pubDate>
            <atom:updated>2018-03-04T22:56:42.813Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a1QG1-cZFomiplbl.jpeg" /><figcaption>Recovering the good old things with the brandnew technology</figcaption></figure><p>There is a mainstream thinking line now about the good or evil of the cryptocurrencies and their use. Exists various examples of bad use of cryptocurrencies, but it is not fair saying that the pseudo-anonymity in the blockchain make this technology the best tool for breaking the law. Because it’s a fact that knowing who is behind a Bitcoin or an Ethereum wallet is hard work, but, the truth is that once the owner is identified, tracing his activity through the blockchain is easy.</p><p>Despite the lousy news about the cryptocurrencies and the blockchain technology are having these days, the truth is that the technology is a revolution, and cryptocurrencies will be part of the future of our economies. Because of that point, is a question that I make my self, could be the blockchain a new drive to the fair trade? I think that it would be.</p><p>There is a significant lack of opportunities and fair trades in several countries around the world. But, this can be reduced using blockchain and the cryptocurrencies. The blockchain technology can bring a new market on a global scale, helping people and families to access to new financial support, more clients, and new ideas.</p><p>For example, a marketplace for crowdlending business anywhere in the world, where the investors can track all the steps an follow the progress. In the other side, the entrepreneurs use the money they receive from all the investors and return to them a little amount of the benefits. It is a very common schema used in the starting business, but the blockchain technology and cryptocurrencies can bring a new level of transparency and communication.</p><p>There is another point that makes the blockchain a powerful technology for the fair trade: the governability over blockchain. Exploiting this idea is an exciting horizon for the technology. The governability over blockchain can bring the users a powerful tool to manage their business.</p><p>For last, I want to talk about the power of blockchain as a tracking tool. This can make a map of all the products, given the customers the power to decide what products they buy, and in what conditions they have been gathered or made. This empowers the customers and gives more vision to the people that create the products.</p><p>In conclusion, exists a lot of opportunities for the blockchain technology in improving the situation for a lot of people around the world and bringing new business models to the economy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32dc289c1411" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My understanding of scalability problem in blockchain]]></title>
            <link>https://igmata.medium.com/my-understanding-of-scalability-problem-in-blockchain-e8f3ed671480?source=rss-4006c089b121------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8f3ed671480</guid>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Iñigo Garcia de Mata]]></dc:creator>
            <pubDate>Wed, 21 Feb 2018 14:30:52 GMT</pubDate>
            <atom:updated>2018-02-21T14:30:52.917Z</atom:updated>
            <content:encoded><![CDATA[<p>Nowadays, there are a lot of people looking for a solution to the scalability problem in the blockchain ecosystem. New blockchains based on the DAG concept or solutions as Lightning Network, Plasma, sharding… all of these solutions are quite good, but, for my understanding, I need to abstract the ideas to a level in which I can compare each solution. This comparison and my thoughts are what I want to share with you.</p><p>First of all, let me introduce an imaginary blockchain, where consensus is not necessary because all the nodes are reliable(like in a private network) so in a first approach, only exists one node that stages all the commits to the database.</p><p>In this case, the only limits the blockchain may have for accepting more transactions per second is the bandwidth (or in a lower level, the capability of the machine to process al the transactions, but later I explain why I think this is a good problem to have), so, from this point we can accept that in a perfect blockchain, the transaction throughput is limited by the bandwidth. Just annotate this.</p><p>Just to follow all the steps, let’s think in the same blockchain, but with a bunch of nodes that can stage the commits, it still not needed a consensus mechanism, but, a mechanism to select the staging node. It is easy to see that in this case, the bandwidth continues being the limit for the throughput (except in very annoying selection mechanism that it is better to not consider)<br>Now, let’s think in a blockchain where the nodes aren’t reliable but there is only one node to stage all the changes to the blockchain. In this case, reaching a consensus within the blockchain is necessary to maintain it working properly.</p><p>In these case appears a new bottleneck, the consensus, because if we define a full consensus between all the nodes, in a very simple way, envolving n² communications between the nodes to accept that all the transactions in the transaction pool are correct before creating the next block. So, now the scalability pass through having enough bandwidth not only for sending all the pending transactions to all the peers, also needs bandwidth to request confirmations about this transactions. Applying a little math, for each new node in the blockchain, you will need double the requests for accepting the transactions, making the consensus the main bottleneck.</p><p>Within this scenario, some ideas I have about this are:</p><ul><li>Not only the bandwidth is important, the information needs time to reach all the network. So, exist a propagation limit for scalability.</li><li>Reducing the number of nodes in the network that are allowed to make consensus (Like Byzantium algorithms) is a good solution, but could not be enough for some people or purpose.</li><li>Solutions that increase the time for generating a new block with several techniques (Requiring a hard computational problem to be solved, adding delay to transactions, and similar solutions) are quite good solutions, but in the most cases, make the network inefficient from a global view.</li><li>Solutions that leave the consensus in a local area, making that each node accept the transactions each self with the information that have, waiting for this information to arrive if it doesn’t exist, reach a full consensus in a non-deterministic period of time.</li></ul><p>Breaking the network into little pieces, and reducing the consensus for this pieces could be the best solution now, but have two main challenges:</p><ul><li>When the different pieces need to reach consensus between them or the consensus is delayed to make that the pieces connect within the consensus layers or making a huge data exchange to synchronize the two pieces (so, in an infinite period of time, the network will become a compact network and the pieces will disappear)</li><li>Reducing the network to multiple little networks could affect the power of the network, the security and also could appear a lose of network effect that makes the blockchain something that is in continuous growing.</li></ul><p>Please, feel free to add any comments, if I’m in a mistake, I want to know it and create knowledge from this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8f3ed671480" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>