Angel \”Java\” Lopez on Blog

June 18, 2017

Multi-Blockchains in Ethereum/RSK

Filed under: Blockchain, Ethereum, RSK, Uncategorized — ajlopez @ 1:51 pm

The implementation of a blockchain includes the creation, distribution, and manage of blocks:

A block, in Bitcoin and Ethereum, has:

  • An unique hash
  • A parent block, identified by hash
  • A block number (one plus parent block number)
  • A list of transactions

In the case of Ethereum and RSK, a transaction has:

  • A sender account
  • A receiver account
  • A value to transfer
  • Additional data (used if the receiver account is a smart contract)

A list of chained valid blocks form a blockchain:

In Ethereum/RSK, a block has also:

  • Uncle blocks
  • Associated Block Difficulty (difficulty of proof of work plus the sum of uncles difficulties)

So, the presence of uncles contributes to the block difficulty. And this number adds to the TOTAL difficulty of the blockchain. Many nodes in the network, called miners, could generate blocks to be added to the current blockchain, but the consensus algorithm  choose the blockchain with the greater total difficulty:

(in Bitcoin, the longest blockchain wins; in Ethereum/RSK a shorter blockchain could win if it has greater total cummulative associated difficulty).

One problem is to keep the state of all accounts and contracts in the system. Each transaction also has

  • State Root Hash

the hash of the world state AFTER the execution of the transaction. This hash is verified by every node in the network, so all the working nodes agrees on the resulting world state. A world state is saved in a trie, that can be identified by such root hash (see my previous work on tries Building a Blockchain (5) Building a Blockchain (12))

The block itself also has a State Root Hash, representing the world state AFTER the execution of the block. It could be different than the last transaction state root hash: the execution of block could assign rewards and alter account balances, if the protocol specifies the changes. This block root is also checked by the running nodes in the network, in order to validate the block state and consensus.

One problem is that the build of a block could be a bottlenect if the system should process many transactions (maybe hunders or thousands per second). This is the principal use case that guides the proposal of this post series. It could be interesting to have MANY blockchains:

Then, one blockchain could be dedicated to the process of a popular token/contract, or other blockchain could be dedicated to the transfer in a particular country. Only in few cases could be needed a transfer between blockchains. And this schema is not limited to TWO blockchains, we could have many blockchains. And the state storage and status could be maintaned by MANY nodes, sometimes, a node is dedicated to keep only ONE or TWO blockchains. So the scale of the operation does not hurt the system.

In the next post, I will describe the modification to apply to Ethereum/RSK so we can  manage multiple blockchains in the network.

Stay tuned!

Angel “Java” Lopez





December 23, 2007

My Week

Filed under: Uncategorized — ajlopez @ 11:21 pm

This is my week planned schedule:

Red hours: Revamping Fabriq, at Southworks.

Thursday, Friday, I’m going to give two courses (ASP.NET, PHP) at Club de Programadores.

This is a light week, Christmas week. But I’m going to think a lot, I must take some decisions about work in progress and future works.

Angel “Java” Lopez

December 3, 2007

My Week

Filed under: Uncategorized — ajlopez @ 10:47 am

These are my plans for this week:

Monday, Tuesday: I’m going to give a course on ASP.NET at Club de Programadores.

Tuesday: Philosophy with Laura Klein, more info at: Más cursos de filosofia

Friday morning: I’m going to give a speech about F#, at Microsoft Argentina.

Thursday night: Giving a course about .NET 2.x

Friday night: A speech about Spring Framework, for Java.

Week end: Go activities, Torneo Abierto Buenos Aires (more details at Asociación Argentina de Go).

Red hours: Revamping Fabriq, at Southworks.

Angel “Java” Lopez

November 19, 2007

My Week

Filed under: Uncategorized — ajlopez @ 12:55 am

Once or twice a year, I post about my week activities. Here is the plan for this week:

Some points:

Tuesday’s Philosophy course is with Laura Klein, more info at: Más cursos de filosofia

Thursday’s Philosophy course is about what is the human being, or anthropological philosophy, more info at: De nuevo, curso de filosofía

I teach about software development at Club de Programadores.

No courses at Microsoft User Group in Argentina, this week.

Southworks is a customer where I working in a team, revamping Fabriq software.

Go is a great game, more info at I’m going to play in the Asociación Argentina de Go next saturday.

Angel “Java” Lopez

September 15, 2007

Sabbatical Week

Filed under: Uncategorized — ajlopez @ 3:21 pm

Yesterday, Friday September 14th, I started my second sabbatical week of the year. During this “long” week (it ended at Monday September 24th), I’ll be dedicated to study, investigate, read, write, think, organize and create. I’m interested in work on some points:

– Add functionality to my project AjGenesis (code generation), write more examples, and post about its features

– Study about frameworks and technologies, from Java, .NET to Smalltalk, from EJB 3x to Windows Presentation Foundation, from Enterprise Service Bus to Architecture and Patterns

– Write posts about my progress (if it doesn’t written, it doesn’t exist… 😉

– Review other open source projects that I have started

– Read a pile of books about software development, business of software, and technology.

This is an ambitious plan, but I hope it will be interesing and full of fun.

You can see my other activities for this week (not related with software development) in my personal blog (Spanish).

Angel “Java” Lopez

July 13, 2007

LINQ in Orcas Beta 1

Filed under: Uncategorized — ajlopez @ 5:51 pm

I’m using a virtual machine with Orcas installed Beta 1, the version to come of Visual Studio 9. In another one “post” I’ll enumerate the main new features, but now, I want to concentrate in showing a small great step to me, that brings built-in code generation for LINQ. (code of this example in

Those that saw LINQ, the Microsoft technology, in some way, an object relational mapping, remembered that there was a command line tool named SQLMetal, that generated code to make that mapping. Now, the SQLMetal is still alive, but, following with the idea of to do everything from the Visual Studio, the Orcas version provides a new type with item: Linq to SQL.

In the example, I dragged tables from a connection of data SQL Server, and soon they appeared in the new designer (in this case, using a datasbase from a Hands On Lab Orcas Beta 1, on a database similar to the one of DinnerNow, with restaurants, menus, and items of menus):

In a file of code produced automatically by “designer” (Redmond boys saw the light, the generation of code… for years that people have been adding more code generation utilities in Visual Studio versions, e.g., software factories… ), in this example, a DinnerNowDataContext:

public partial class DinnerNowDataContext : global::System.Data.Linq.DataContext { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public DinnerNowDataContext(string connection) : base(connection) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public DinnerNowDataContext(global::System.Data.IDbConnection connection) : base(connection) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public DinnerNowDataContext() : base(global::DbmlLibrary1.Properties.Settings.Default.DinnerNowOrcasLabsConnectionString) { } public global::System.Data.Linq.Table<Menu> Menus { get { return this.GetTable<Menu>(); } }

in a similar way as the code generated by SQLMetal tool. As before, it defines “business entities” that are the classes that correspond to the database tables:

[global::System.Data.Linq.Table(Name="dbo.Menu")] public partial class Menu : global::System.Data.Linq.INotifyPropertyChanging, global::System.ComponentModel.INotifyPropertyChanged { private global::System.Guid _MenuId; private global::System.Nullable<global::System.Guid> _MenuTypeId; private global::System.Guid _RestaurantId; private global::System.DateTime _StartDate; private global::System.DateTime _EndDate; private global::System.Data.Linq.EntitySet<MenuItem> _MenuItems; private global::System.Data.Linq.EntityRef<MenuType> _MenuType; private global::System.Data.Linq.EntityRef<Restaurant> _Restaurant; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public Menu() { this._MenuItems = new global::System.Data.Linq.EntitySet<MenuItem>(new global::System.Action<MenuItem>(this.Attach_MenuItems), new global::System.Action<MenuItem>(this.Detach_MenuItems)); this._MenuType = default(global::System.Data.Linq.EntityRef<MenuType>); this._Restaurant = default(global::System.Data.Linq.EntityRef<Restaurant>); } [global::System.Data.Linq.Column(Storage="_MenuId", Name="MenuId", DBType="UniqueIdentifier NOT NULL", IsPrimaryKey=true, CanBeNull=false)] public global::System.Guid MenuId { get { return this._MenuId; } set { if ((this._MenuId != value)) { this.OnPropertyChanging("MenuId"); this._MenuId = value; this.OnPropertyChanged("MenuId"); } } }

Thanks to the people of Southworks by the virtual machine with Orcas Beta 1.

Angel “Java” Lopez

March 11, 2007

Security, SOA, WCF and SaaS: all in one

Filed under: Uncategorized — ajlopez @ 3:16 pm

Matias Woloski has posted an article about the security implementation on a Software as a Service .NET demo application LitwareHR. It’s very interesting to see in action the declarative capabilities of Windows Communication Foundation, the use of Federated security, SAML tokens, and authorization policies. The post is here:

Enjoy and learn!

Angel “Java” Lopez

CoRank opening

Filed under: Uncategorized — ajlopez @ 9:03 am

There is a new site, from Rogelio Bernal Andreo, founder of , and

It’s, with a Spanish version

According with its home page:

coRank is a site where you can share whatever you find interesting on the web with people who value your opinion, and where you can also find what’s interesting for people whose opinion are important to you – your sources – whether they know who you are or not.

In coRank, your Front Page is yours only, and likely different than any other, as it is based on how the-people-you-select react to upcoming stories and submitted websites.

You can read about its features at Take a tour

Great job, Rogelio!

January 28, 2007

Computer nightmare

Filed under: Uncategorized — ajlopez @ 9:38 pm

You MUST see this video (thanks to Juan Pablo García, great link Pablo!)

January 27, 2007

Sabbatical Week

Filed under: Uncategorized — ajlopez @ 9:38 am

Today is the first day of my sabbatical week, a week dedicated to think, read, write, create and put order in my life. In my opinion, a “free” week is a must, twice a year: you can put all effort in one subject or you can explore new possibilities, without links to daily activities.

This time, during these days I’ll write down some ideas. I want to write some code that is in my mind, and rearrange some open source projects. I hope to publish any advance, here, my technical English blog, and at: (technical Spanish blog) (personal Spanish blog)

The last month was very exciting for me, full of ideas and challenges, and now, it’s time to put order on all that stuff.

Angel “Java” Lopez

Older Posts »

Create a free website or blog at