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:

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

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




September 6, 2017

New Month’s Resolutions: September 2017

Filed under: C Sharp, Java, JavaScript, NodeJs, Open Source Projects — ajlopez @ 5:25 pm

A lot of ideas and projects, and only one life. Time to review the last month’s resolutions:

– Continue Yasold [complete] see repo
– Continue SimpleBlockchain [pending]
– Continue BlockchainSharp [complete] see repo
– Continue ChineseP [complete] see repo
– Continue TensorSharp [complete] see repo
– Continue SimpleTensor [complete] see repo
– Continue WikiExpert [pending]
– Continue Neurum [complete] see repo
– Continue LLLJS [pending]
– Continue HuskyJS [pending]

Additionally I worked on:

– Started BlockchainJ [complete] see repo
– Improve RustScript [complete] see repo
– Start Elmie, Eml-like language transpiler to JavaScript [complete] see repo
– Improve PLangRe [complete] see repo
– Improve RSharp [complete] see repo
– Improve RskAPI [complete] see repo

My new resolutions:

– Continue Yasold
– Continue BlockchainJ
– Continue BlockchainSharp
– Continue ChineseP
– Continue TensorSharp
– Continue SimpleTensor
– Continue WikiExpert
– Continue Neurum
– Continue LLLJS
– Continue Elmie

Stay tuned!

Angel “Java” Lopez


December 5, 2015

New Month’s Resolutions: December 2015

Filed under: C Sharp, Java, JavaScript, NodeJs, Open Source Projects — ajlopez @ 6:35 pm

The last month of the year have started. Time to review past month’s resolutions:

– Work on SJonT [partial] see repo
– Work on SparkSharp [complete] see repo
– Work on Husky [complete] see repo
– Work on MessiJS [pending]
– Work on ElixirJS [complete] see repo
– Work on GStones [pending]
– Work on SharpGo [complete] see repo
– Prepare a NodeJS one-day course [complete]
– Prepare a FinTech-related talk [partial]

Additionally, I worked on:

– Start MeliLib, access to Mercado Libre API using NodeJS [complete] see repo
– Start RkModel, reactive model [complete] see repo
– Start Golin, Lisp interpreter in Go [complete] see repo
– Improve AjGenesisNode-Express [complete] see repo
– Start Go samples [complete] see repo
– Improve AjGenesisNode-Entity [complete] see repo
– Improve AjGenesisNode-Model [complete] see repo
– Improve AjGenesisNode using SimpleJson [complete] see repo
– Start GccSamples [complete] see repo
– Improve SimpleJson [complete] see repo
– Improve AjLispJava [complete] see repo

My new month’s resolutions:

– Prepare a FinTech-related talk
– Work on Husky
– Work on SharpGo
– Improve AjGenesis for Node
– Publis AjLispJava
– Work on Golin
– Work on RkModel
– Improve SimpleDT

Stay tuned!

Angel “Java” Lopez

June 15, 2015

Spark: Links and Resources (1)

Filed under: Distributed Computing, Java, Links, MapReduce, Spark — ajlopez @ 10:09 am

There are two project named Spark in Java: a web framework, and a distributed map reduce runner.

Scalable Machine Learning | edX

Spark Programming Guide – Spark 1.3.1 Documentation

Overview – Spark 1.3.1 Documentation



Top Best Tools for Java Programmers | Devzum – Its all about Design & Development

Sparkling, A Clojure API for Apache Spark

Getting Started with Sparkling

Developing Single Page Web Applications using Java 8, Spark, MongoDB, and AngularJS – OpenShift Blog


Spark Framework – A tiny Java web framework

Apache Spark with Scala


Windows on Devices

MapReduce and Spark | Cloudera VISION

Mesosphere · Learn how to use Apache Mesos

Got a Minute? Spin up a Spark cluster on your laptop with Docker. | AMPLab – UC Berkeley

Spark Streaming Programming Guide – Spark 0.7.3 Documentation

Spark: Open Source Superstar Rewrites Future of Big Data | Wired Enterprise |

Spark | Lightning-Fast Cluster Computing

Learning Spark – O’Reilly Media

My Links

Stay tuned!

Angel “Java” Lopez

June 4, 2015

New Month’s Resolutions: June 2015

Filed under: .NET, C Sharp, Java, JavaScript, Liqueed, NodeJs, Open Source Projects — ajlopez @ 9:48 am

It’s the time for review my May’s resolutions and write the new ones:

– Improve ClojJS [pending]
– Add NPM support to ClojJS [pending]
– Write posts about JavaScript and Artificial Intelligence [pending]
– Give a talk about Meteor [partial]
– Prepare a talk about Clojure or ClojureScript [partial]
– Improve BScript [pending]
– Improve AjErl, distributed features [partial] see repo
– Improve Liqueed Project, kudos features [complete] see repo

I also worked on:

– Start SparkSharp, Apache Spark-like in C# [complete] see repo
– Improve SharpMongo, MongoDB-like in C# [complete] see repo
– Improve OStore, object store in memory, JavaScript/NodeJS [complete] see repo
– Improve PythonSharp, Python interpreter in C# [complete] see repo
– Improve RedPython, compile Python to C using JavaScript/NodeJS [complete] see repo

My new month’s resolutions:

– Give a talk about Meteor
– Write posts about JavaScript and Artificial Intelligence
– Improve ClojJS
– Add NPM support to ClojJS
– Continue work on SparkSharp
– Start Message project in C#, a la Apache Camel
– Improve Liqueed Project, kudos features
– Improve Templie, template engine in Java
– Improve BScript, Basic-like interpreter in C#
– Continue work on OStore
– Continue work on SharpMongo

More fun is coming 😉

Stay tuned!

Angel “Java” Lopez

October 9, 2014

Akka: Links, News And Resources (10)

Filed under: Akka, Distributed Computing, Java, Links, Scala — ajlopez @ 4:36 pm

Previous Post


Distributed Publish Subscribe in Cluster — Akka Documentation

Kamon | Core | Documentation – Resilient Applications with Akka Persistence by Björn Antonsson, Konrad Malawski, Patrik Nordwall

AKKA 5 Year Anniversary

How One Developer Set Out To Make The Internet Of Things Manageable – ReadWrite






My Links

Stay tuned!

Angel “Java” Lopez

October 6, 2014

Akka: Links, News And Resources (9)

Filed under: Akka, Distributed Computing, Java, Links, Scala — ajlopez @ 4:13 pm

Previous Post
Next Post

Building Reactive Applications with Akka

Typed Actors — Akka Documentation

Reactive DDD with Akka | Write less, do more!

Publish/Subscribe using Scala and Akka EventStream

Vaadin in Akka – Blog –

Endre Sándor Varga – Without Present or Past: How to Think Distributed – The Hard Way, With the rise of distributed databases, cluster management tools, co…

Reactive Programming with Akka and Scala | comSysto Blog

Let it crash



Jonas Bonér – Going Reactive: Event-Driven, Scalable, Resilient & Responsive Systems, The demands and expectations for applications have changed dramat…

Get started quicker with our docker image

Java is the new C: Comparision of different concurrency models: Actors, CSP, Disruptor and Threads


April 17, 2014 | Typesafe announces Akka Streams, a part of the Reactive Streams Initiative | Typesafe

akka/akka-stream/src/main/scala/akka/stream at release-2.3 · akka/akka

A very simple Ping Pong example using Akka’s local actors.

Orleans Actors Analysis – Tech stuff that interests me

Abstractivate: ForkJoinPool: the Other ExecutorService

Running an Akka Cluster with Docker Containers | Adventures in HttpContext

Getting Started with Actor Based Programming Using Scala and Akka – Reactive.TIPS – The Official Blog of Reactive.IO

My Links

Stay tuned!

Angel “Java” Lopez

July 11, 2014

Play Framework: Links and Resources (1)

Filed under: Java, Links, Play Framework, Scala, Web Development — ajlopez @ 1:56 pm

Play is an open source web application framework, written in Scala and Java, which follows the model–view–controller (MVC)architectural pattern. It aims to optimize developer productivity by using convention over configuration, hot code reloading and display of errors in the browser.[1]

Support for the Scala programming language has been available since version 1.1 of the framework.[2] In version 2.0, the framework core was rewritten in Scala. Build and deployment was migrated to SBT, and templates use Scala instead of Groovy.

Advanced routing in Play Framework – all that jazz

Christopher Hunt on Software Development: Play-ing with WebJars

JsZipper : Play2 Json advanced (& monadic) manipulations – Mandubian Blog

huntc/play-spring · GitHub
A sample Play application with the minimum configuration required to support Spring JSR-299 and JSR-330

guillaumebort/play20-spring-demo · GitHub
Using Spring from within a Play 2.0 application

Stupid Java Tricks » Play Framework 2.1: The Bloom is Off The Rose

Observations on the Play! framework | James Gregory’s Blog

#98 Support for optional trailing slash – Play framework 2.0 – play

Abnorm: A better non-ORM // Speaker Deck

Play CMS
A simple CMS to be able to edit pages, page fragments and images using a WYSIWYG editor

parroit76-play-cms – port of play-cms to version 2.0 of play framework – Google Project Hosting

julienrf/play-scala.g8 · GitHub
g8 template for Play applications

What startups or tech companies are using Play Framework? – Quora

yobriefca screencast

Introduction to Play Framework

yanns/play2-scala-DI · GitHub
Technical prototyp to test different dependency injection solutions.

Sadek Drobi, the Play 2.0 Story and what’s new in 2.1
CTO of Zenexity, a Web Oriented Architecture Company, Sadek is a software engineer specialized in bridging the gap between the problem domain and the solution domain. As core Play developer and co-creator, he works on the design and implementation of the framework. Twitter: @sadache Photos: Blog:

Iteratees in Big Data at Klout « Klout Engineering
In this blog post we describe the usage of Play! Iteratees in our redesigned data collection pipeline.

My Links

Stay tuned!

Angel “Java” Lopez

May 13, 2014

Akka: Links, News And Resources (8)

Filed under: Akka, Distributed Computing, Java, Links, Scala — ajlopez @ 10:08 am

Previous Post
Next Post

Streaming Twitter API in Akka and Spray | Cake Solutions Team Blog

Akka persistence webinar

Intro to Akka persistence with Patrik Nordwall – YouTube

Community Page Reinvisioned | Akka

Prabhath’s Bolg: Integrating an actor system with Play framework (A distributed message classifier with and Play framework)

Martin’s Programming Blog: Distributed Actors in Clojure

Fun doesn’t mean compromising scalability – all that jazz

Using Scala Implicits to Implement a Messaging Protocol

Camel — Akka Documentation

Post: Akka Extras Email

BitTorrent client written in Scala using Akka

scala – How to create minimal Akka actor? – Stack Overflow

scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala at master · scala/scala

My Links

Keep tuned!

Angel “Java” Lopez

February 24, 2014

Akka: Links, News And Resources (7)

Filed under: Akka, Distributed Computing, Java, Links, Scala — ajlopez @ 11:11 am

Previous Post
Next Post



Distributed Publish Subscribe in Cluster — Akka Documentation

Microkernel — Akka Documentation

Typesafe Blog – PlayFramework – Blog – Typesafe


Dispatchers — Akka Documentation

Akka in C#

Getting Started Tutorial (Scala): First Chapter — Akka Documentation

My Links

Keep tuned!

Angel “Java” Lopez

Older Posts »

Blog at