Blockchain, Ethereum, RSK y .NET
Angel “Java” Lopez
@ajlopez
#soytanviejo
你们很好
Ethereum
Mastering Ethereum
Distribuida http://stats.rsk.co/
Descentralizada
No Para: ¡Skynet!
Bloque
Transacciones
Encabezamiento
Al Bloque Padre
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
Inmutable
Nadie puede cambiar un bloque ya emitido y consensuado, rompería la cadena
Hash
Arreglo de Bytes (longitud variable)
Función de Hash
Hash
Cadenas Alternativas
Transaction
Sender
Receiver
Value
Data
State Root
Account
Balance
Nonce
Code
Storage Root
State in Trie
1
0
1
0
1
0
Contrato
contract Counter {
uint counter;
function Counter() {
counter = 1;
}
}
Ecosistema
Nethereum
Comenzando con NEthereum
Instalando Paquete NuGet
PM> Install-Package Nethereum.Web3
Cliente Ethereum
Nodo�Ethereum
Cliente�Ethereum
JSON-RPC
Ejemplo JSON RPC
Ejemplo: Creación de Instancia Web3
web3 = new Web3("http://localhost:8545");
Ejemplo: Recuperar Cuentas
await web3.Eth.Accounts.SendRequestAsync();
Ejemplo: Ejecutar Transacción
TransactionInput ti = new TransactionInput(null,
toAccount,
fromAccount,
gas, gasPrice, value);
return await web3.Eth.Transactions.SendTransaction.SendRequestAsync(ti);
Lanzando nodo RSK
java -cp rskj.jar co.rsk.Start --regtest