Angel \”Java\” Lopez on Blog

September 24, 2017

Building A Blockchain (16)

Previous Post

In recent months I have been busy working on the RSK project. It’s time to write about my personal blockchain projects:

https://github.com/ajlopez/BlockchainSharp
https://github.com/ajlopez/SimpleBlockchain
https://github.com/ajlopez/RskSharp

Currently, the most active one is the C# project. I added one project:

https://github.com/ajlopez/BlockchainJ

in Java. The experience I gained written all this code (using test-driven design, as usual) gaves me a clear idea of what is involved when building a blockchain. Writing my own implementations gave me better understanding of the parts related to the creation of a blockchain. And now the RSK project (Java core implementation) is public, I’m free to relate this work with an existing full implementation.

The key points to be written are:

  • Entities
  • States
  • Virtual machine to run smart contracts
  • Encoders
  • Consensus
  • Validation logic
  • Inter-node communication
  • Expose node state to external applications

The base entities are:

  • Block
  • Transaction
  • Account

The states to be kept are:

  • Blockchain
  • Account state
  • Contract state

My projects are oriented to have smart contracts, a la Ethereum. One reason to have a virtual machine is be agnostic of host programming language. I think that having a way of run smart contract that is independent of the programming language used in each project, is an interesting feature. So, I should define:

  • Virtual machine opcodes
  • Transient (memory) storage
  • Persistent storage

I need encoders for blocks, transactions and account states. The encoded entities are used in the network communication, local storage, and in the hash calculation. For example, when I have to transmit a block I encoded it. And if I want to send the block to another node, I should encoded the block before transmission. And the encoded data is the basis for hash calculation.

The inter-node communication includes:

  • Message definitions
  • Message and handshake protocol
  • Peer-discovery protocol

Validation logic refers to:

  • Validation of blocks
  • Sign of transaction and its validation

Consensus logic has:

  • Selection of the next block
  • Run of the transactions, updating the accounts/contracts states

The exposure of a node state is implemented in Bitcoin and Ethereum using JSON RPC (Remote procudure call), usually exposed via http. In this way, the node can be accessed by external technologies implemented in different technologies (JavaScript blockchain ecosystems are the more popular).

Followin Ethereum ideas, one entity I implemented many times is a trie. I think my implementations are very simple and effective. I hope to be able to write in the next posts about those implementations.

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

 

 

 

September 23, 2017

Blockchain: Links And Resources (84)

Filed under: Bitcoin, Blockchain, Ethereum, Links — ajlopez @ 4:11 pm

Previous Post

Scaling Lightning? How Revive Could Boost Bitcoin’s Boldest Scaling Plan
https://www.coindesk.com/scaling-lightning-revive-boost-bitcoins-boldest-scaling-plan

Ethereum’s ERC-20 Token Standard Has Been Formalized
https://www.coindesk.com/ethereums-erc-20-token-standard-formalized/

Steak Is the New Salad: Why These Techies Are Embracing an All-Meat Diet
https://www.inc.com/sonya-mann/bitcoin-carnivores.html

Estonia “Could Raise Billions” in an ICO Says e-Residency’s Director
http://www.trustnodes.com/2017/09/22/estonia-raise-billions-ico-says-e-residencys-director

World Governments Have Declared War on Bitcoin: John McAfee
https://www.thestreet.com/story/14315079/1/bitcoin.html

Principales actores del ecosistem Blokchain en Argentina
https://criptonoticias.com/educacion/principales-actores-ecosistema-blockchain-argentina-organizaron-catedra-bitcoin-buenos-aires/#axzz4tRU6CwLa

Dubai Aims to Be a City Built on Blockchain
https://www.wsj.com/articles/dubai-aims-to-be-a-city-built-on-blockchain-1493086080

John McAfee: China Bitcoin Ban Will Not Extend to Mining
https://www.cryptocoinsnews.com/john-mcafee-china-bitcoin-ban-will-not-extend-mining/

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 21, 2017

Blockchain: Links And Resources (83)

Filed under: Bitcoin, Blockchain, Ethereum, Links — ajlopez @ 11:55 am

Previous Post
Next Post

Ethereum Founder on ICOs: “We Are in a Bubble, A Lot of Projects Will Fail”
http://www.investopedia.com/news/ethereum-founder-cautions-ico-bubble-vitalek-buterin/

Hong Kong regulator ‘concerned’ by ICO funding boom
https://techcrunch.com/2017/09/05/hong-kong-ico-concern/amp/

Ethereum testnet just verified a zcash transaction
https://www.reddit.com/r/ethereum/comments/712idt/ethereum_testnet_just_verified_a_zcash_transaction/

El ABC del bitcoin: Lo que hay que saber de la moneda digital
http://www.lanacion.com.ar/2064465-el-abc-del-bitcoin-lo-que-hay-que-saber-de-la-moneda-digital

zkSNARKs in a nutshell
https://blog.ethereum.org/2016/12/05/zksnarks-in-a-nutshell/

What are zk-SNARKs?
https://z.cash/technology/zksnarks.html

Atomic Swaps: How the Lightning Network Extends to Altcoins
https://bitcoinmagazine.com/articles/atomic-swaps-how-the-lightning-network-extends-to-altcoins-1484157052/

Atomic cross-chain trading
https://en.bitcoin.it/wiki/Atomic_cross-chain_trading

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 20, 2017

Blockchain: Links And Resources (82)

Filed under: Bitcoin, Blockchain, Ethereum, Links, RSK — ajlopez @ 11:53 am

Previous Post
Next Post

Key Findings From Cambridge Cryptocurrency Study
https://cointelegraph.com/news/key-findings-from-cambridge-cryptocurrency-study

Global Cryptocurrency Benchmarking Study
https://cointelegraph.com/storage/uploads/view/2017-global-cryptocurrency-benchmarking-study.pdf

At A Major Crypto Conference, Blockchain Projects Tighten Security With Math
https://www.forbes.com/sites/amycastor/2017/08/23/at-crypto-2017-blockchain-presentations-focus-on-proofs-not-concepts/#665417657b70

Blockchain: Qué es y y por qué te cambiará la vida (con ejemplos)
https://www.internautas.org/html/9767.html

Barbarian Investor Show Episode 4 – Coinsilium, RSK and The Internet of Value
https://www.youtube.com/watch?time_continue=3&v=h6v2w4reg_E

Cracking the Ethereum White Paper
https://medium.com/@FolusoOgunlana/cracking-the-ethereum-white-paper-e0e60c44126

How Blockchain Is Kickstarting the Financial Lives of Refugees
https://www.technologyreview.com/s/608764/how-blockchain-is-kickstarting-the-financial-lives-of-refugees/

China’s ICO ban makes more sense in light of its history with fintech
https://techcrunch.com/2017/09/12/chinas-ico-ban-makes-more-sense-in-light-of-its-history-with-fintech/

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 19, 2017

Blockchain: Links And Resources (81)

Filed under: Bitcoin, Blockchain, Ethereum, RSK, Smart Contracts — ajlopez @ 11:36 am

Previous Post
Next Post

A New Blockchain App Is Poised to Radically Change How People Vote
https://futurism.com/a-new-blockchain-app-is-poised-to-radically-change-how-people-vote/

$4,000: Bitcoin’s Price Shrugs Off China Exchange News
https://www.coindesk.com/bitcoin-price-recovers-from-china-news-to-hit-4000/

RSK, Allowing Technology To Reach The Masses.
http://media.rsk.co/rsk-allowing-technology-to-reach-the-masses/

Major Chinese bitcoin conference flees to Hong Kong as government cracks down on cryptocurrencies
https://www.cnbc.com/2017/09/18/cryptocurrencies-major-bitcoin-conference-flees-as-china-cracks-down.html

The Economic Case for Conservative Bitcoin Development
https://www.coindesk.com/economic-case-conservative-bitcoin-development/

Decentralizing Everything with Ethereum’s Vitalik Buterin
https://techcrunch.com/video/decentralizing-everything-with-ethereums-vitalik-buterin/59c01b739e451049f87f8c18/

The best explainer on how blockchains will upend banking comes from an unexpected source
https://qz.com/1080044/bis-says-central-bank-cryptocurrencies-could-be-a-good-idea/

Ethereum will match Visa in scale in a ‘couple of years’ says founder
https://techcrunch.com/2017/09/18/ethereum-will-replace-visa-in-a-couple-of-years-says-founder/

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 17, 2017

Learning Ethereum/RSK (3)

Filed under: Bitcoin, Blockchain, Ethereum, RSK, Smart Contracts, Solidity — ajlopez @ 4:24 pm

Previous Post

In my previous posts I commented about two Bitcoin books/resources. They are many other ones, but it is time to write about Ethereum, the basis of RSK core.

First, the main reference is the project web site:

http://ethereum.org/

The first read should be the white paper:

https://github.com/ethereum/wiki/wiki/White-Paper

The main author is Vitalik Buterin, the project creator. See:

https://en.wikipedia.org/wiki/Vitalik_Buterin
https://twitter.com/VitalikButerin
https://medium.com/@VitalikButerin

In the white paper, Buterin describes Bitcoin protocol and its shortcomings. Ethereum is a blockchain, but it is different in many ways. In Bitcoin, you have UTXO (Unspent Transaction Outpus). In Ethereum, you have accounts with balances. In Bitcoin, you have limited scripts. In Ethereum, there is a Virtual Machine that can run smart contracts written in different specialized programming languages (altought the most popular so far is Solidity). And you have a trie and hash root for the state of world. Each contract has its own storage, again using a trie and hashes. These additions make Ethereum a very interesting project.

A good review of the white paper is at:

Cracking the Ethereum White Paper

A fragment:

So what is Ethereum really? In my previous article, I explained that Bitcoin acts as a trusted store of and means of transmitting value. I like to think of Ethereum as a means of transmitting value but also a trusted store for complex and shared interactive information and software. Understanding it is tough, but the reward might just be worth your time.

The next read is the Yellow Paper:

https://github.com/ethereum/yellowpaper
http://yellowpaper.io/

Written by another Ethereum co-founder, Gavin Wood. It has a detailed descripcion of account states, blocks, uncles, RLP (Run Length Prefix) the encoding of bytes used by Ethereum, hashes, and an appendix describing the Virtual Machine opcodes and operation.

In the next posts, I will describe the differences between Bitcoin and Ethereum transactions, the state storage, for world states, and contract states, and first steps using Solidity.

Stay tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

 

September 14, 2017

Blockchain: Links And Resources (80)

Filed under: Bitcoin, Blockchain, Ethereum, Solidity — ajlopez @ 11:40 am

Previous Post
Next Post

Wealdtech Solidity
Contracts and contract pieces for Solidity.
https://github.com/wealdtech/wealdtech-solidity

Beijing and Bitcoin Don’t Mix
https://www.wsj.com/articles/beijing-and-bitcoin-dont-mix-1505120133?mod=e2tw

Bitcoin OTC Service Suspends Trading Citing China Pressure
https://www.coindesk.com/bitcoin-otc-service-suspends-trading-citing-china-pressure/

China is shutting down domestic Bitcoin exchanges
https://www.theverge.com/2017/9/11/16288898/china-shutdown-rumored-bitcoin-exchanges-crackdown

How Anonymous Zcash Cryptocurrency Actually Works
http://www.ibtimes.com/how-anonymous-zcash-cryptocurrency-actually-works-2588875

Over 1.65 Million Computers Infected With Cryptocurrency Miners in 2017 So Far
https://www.bleepingcomputer.com/news/security/over-1-65-million-computers-infected-with-cryptocurrency-miners-in-2017-so-far/

Bitcoin Price Crashes Below $4,000 as China Bitcoin Ban Rumors Intensify
https://www.cryptocoinsnews.com/bitcoin-price-crashes-4000-china-bitcoin-ban-rumors-intensify/

Blockchains and voting
https://freedom-to-tinker.com/2017/09/12/blockchains-and-voting/

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 12, 2017

Blockchain: Links And Resources (79)

Filed under: Bitcoin, Blockchain, Ethereum, Links — ajlopez @ 5:02 pm

Previous Post
Next Post

Could SPV Support a Billion Bitcoin Users? Sizing up a Scaling Claim
https://www.coindesk.com/spv-support-billion-bitcoin-users-sizing-scaling-claim/

Curl disclosure, beyond the headline
https://blog.iota.org/curl-disclosure-beyond-the-headline-1814048d08ef

MASTer Plan: Better Bitcoin Smart Contracts Could Go Live This Year
https://www.coindesk.com/master-plan-better-bitcoin-smart-contracts-go-live-year/

Warsaw Block with special guest RSK – 11.09
https://www.youtube.com/watch?v=-tj85adNg48

MGT Capital Investments, Inc. (OTCMKTS: MGTI) ranks as one of the largest U.S. based Bitcoin miners.
http://streetregister.com/2017/09/11/mgt-capital-investments-inc-otcmkts-mgti-ranks-as-one-of-the-largest-u-s-based-bitcoin-miners/

Criminals Thought Bitcoin Was the Perfect Hiding Place, but They Thought Wrong
https://www.technologyreview.com/s/608763/criminals-thought-bitcoin-was-the-perfect-hiding-place-they-thought-wrong/

‘Very High Risk’: UK Finance Watchdog Issues Statement on ICOs
https://www.coindesk.com/very-high-risk-uk-finance-watchdog-issues-statement-on-icos/

The Economics of Filecoin
https://medium.com/@ryanshea/the-economics-of-filecoin-a8d826774674

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 11, 2017

Blockchain: Links And Resources (78)

Filed under: Bitcoin, Blockchain, Ethereum, Links — ajlopez @ 4:40 pm

Previous Post
Next Post

$257 Million: Filecoin Breaks All-Time Record for ICO Funding
https://www.coindesk.com/257-million-filecoin-breaks-time-record-ico-funding/

Merged Mining: Curse or Cure?
https://eprint.iacr.org/2017/791.pdf

Cryptographic vulnerabilities in IOTA
https://medium.com/@neha/cryptographic-vulnerabilities-in-iota-9a6a9ddc4367

Revolutionary Blockchain Applications: Energy Utility – Developer Perspectives On Blockchain
https://www.youtube.com/watch?v=ng3HaaVPfPM

MIT And BU Researchers Uncover Critical Security Flaw In $2B Cryptocurrency IOTA
https://www.forbes.com/sites/amycastor/2017/09/07/mit-and-bu-researchers-uncover-critical-security-flaw-in-2b-cryptocurrency-iota/#415cb78b7570

China bans all initial coin offerings pending broad review
https://siliconangle.com/blog/2017/09/03/china-bans-initial-coin-offerings-pending-review/

Cryptocurrency and Central Banks: The Quest to Dematerialize Money
https://www.coindesk.com/central-banks-cryptocurrency-and-the-quest-to-dematerialize-money/

Blockchain to Disrupt Utilities as Customers Trade Power: BNEF
https://powerledger.io/blockchain-disrupt-utilities-customers-trade-power-bnef/

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com
http://twitter.com/ajlopez

September 9, 2017

Blockchain: Links And Resources (77)

Filed under: Bitcoin, Blockchain, Ethereum, Links — ajlopez @ 2:38 pm

Previous Post
Next Post

Blockstack: A New Decentralized Internet
https://blockstack.org/whitepaper.pdf

Extending Existing Blockchains with Virtualchain
https://blockstack.org/virtualchain_dccl16.pdf

China Outlaws ICOs: Financial Regulators Order Halt on Token Trading
https://www.coindesk.com/china-outlaws-icos-financial-regulators-order-halt-token-trading

Mining Giant Bitmain Reportedly Raising $50 Million Funding Round
https://www.coindesk.com/mining-giant-bitmain-reportedly-raising-50-million-in-new-funding-round/

Introducing Prism: The world’s first trustless portfolio market platform
https://info.shapeshift.io/blog/2017/05/21/introducing-prism-worlds-first-trustless-portfolio-market-platform

Blockchain company ConsenSys launches $50m venture capital arm
http://www.ibtimes.co.uk/blockchain-company-consensys-launches-50m-venture-capital-arm-1638289

Casper Basics
https://github.com/ethereum/research/blob/master/papers/casper-basics/casper_basics.pdf

Casper Economics
https://github.com/ethereum/research/blob/master/papers/casper-economics/casper_economics_basic.pdf

Stay tuned!

Angel “Java” Lopez
https://github.com/ajlopez
http://www.ajlopez.com

 

Older Posts »

Create a free website or blog at WordPress.com.