1 of 30

Blockchain, Ethereum, RSK y .NET

Angel “Java” Lopez

@ajlopez

2 of 30

#soytanviejo

3 of 30

你们很好

4 of 30

5 of 30

Ethereum

6 of 30

Mastering Ethereum

7 of 30

8 of 30

Descentralizada

9 of 30

No Para: ¡Skynet!

10 of 30

Bloque

Transacciones

Encabezamiento

Al Bloque Padre

11 of 30

Cadena de Bloques

Cada bloque tiene un único bloque padre

Cada bloque tiene una altura (un número)

Cada bloque tiene un hash (depende del contenido)

Altura bloque padre == altura bloque - 1�Distinta cantidad de transacciones por bloque

12 of 30

Inmutable

Nadie puede cambiar un bloque ya emitido y consensuado, rompería la cadena

13 of 30

Hash

Arreglo de Bytes (longitud variable)

Función de Hash

Hash

14 of 30

Cadenas Alternativas

15 of 30

Transaction

Sender

Receiver

Value

Data

State Root

16 of 30

Account

Balance

Nonce

Code

Storage Root

17 of 30

State in Trie

1

0

1

0

1

0

18 of 30

Contrato

contract Counter {

uint counter;

function Counter() {

counter = 1;

}

}

19 of 30

Ecosistema

20 of 30

Nethereum

21 of 30

Comenzando con NEthereum

22 of 30

Instalando Paquete NuGet

PM> Install-Package Nethereum.Web3

23 of 30

Cliente Ethereum

Nodo�Ethereum

Cliente�Ethereum

JSON-RPC

24 of 30

Ejemplo JSON RPC

25 of 30

Ejemplo: Creación de Instancia Web3

web3 = new Web3("http://localhost:8545");

26 of 30

Ejemplo: Recuperar Cuentas

await web3.Eth.Accounts.SendRequestAsync();

27 of 30

Ejemplo: Ejecutar Transacción

TransactionInput ti = new TransactionInput(null,

toAccount,

fromAccount,

gas, gasPrice, value);

return await web3.Eth.Transactions.SendTransaction.SendRequestAsync(ti);

28 of 30

Lanzando nodo RSK

java -cp rskj.jar co.rsk.Start --regtest

29 of 30

30 of 30