When designing a blockchain system it is important to make definition for a large number of aspects. You have to define what network components you require. In some systems there is basically only one component, that does everything, from verifying transactions, maintaining a copy of the ledger, accepting and broadcasting transactions, maintaining peers, ensuring consensus, validating identities, check permissions and executing smart contracts.

But before we can decide any of these, the purpose of a blockchain has to get defined. Public blockchains with their currencies are the most famous example. In first place there purpose is to transfer value, but in general, people want to execute “smart contracts” on a blockchain. (We discuss later what a smart contract is.). There is many discussions about how many transactions a blockchain can process per second. Also how much data can be stored in the system. In Bitcoin that is about 1MB per 10 minutes that have around 1000 transactions. Who is supposed to become part of the blockchain, get a copy. Can everyone join and setup a peer or is there maintained a list of participants and organizations. Blockchain is a system that will help to create transparency. But the first thing businesses ask is how it is possible to keep data private with managed reading and write permissions. And, as in any software development project, the utilized technology need to get decided, starting with programming language, database and operating system.

what is a smart contract

Basically a smart contract is a piece of code, that works with information on the blockchain and some input arguments from the transactions. Because of that, in some systems smart contracts are called chain code. Usually when transactions get executed in the same order, get executed against the same ledger state and the same transaction, they produce the same outcome. This property is called deterministic. To guaranty this behavior the Etherium blockchain has introduced a new programming language just for this requirement.

Other blockchains allow to develop smart contracts in statically typed languages, such as Java, Rust, Go or C++. It is usually not recommended to allow the development of contracts in dynamically typed languages, as the behavior is less predictable, especially for inexperienced developers. That contains PHP, Ruby and Javascript.

An other type of languages for smart contracts is designed to describe behavior in business terms. Such languages usually do not allow much complexity, but are therefor better understandable for users without programming experience.

Smart Contracts get deployed direct to the blockchain. That means the Source or at least the binary is stored in a transaction. Doing so can guaranty that it is absolutely clear, what transaction was processed by witch chain code ans specific by witch version of the chain code.


Designing Systems of such complexity, you have to be very precise. I believe that language need to be controlled very much. Often people say: “store that data on blockchain”. But that let a lot of open options.

  1. store on the blockchain itself
  2. store on the ledger of the blockchain
  3. store in the configuration for the blockchain

Also “Create a user.” allow a number of options for interpretation:

  1. create a key value pair
  2. store some username-password credentials on the blockchain
  3. store some credentials outside the blockchain
  4. create a signed certificate.

Naming for the different software components. Many people have different definition want is a peer. In hyperledger Fabric a peer is a server machine, that will connect to the orderer to get the blockchains and all new transactions. In other systems a peer is like a user or organization that also maintains its copy of the ledger and blockchain. In Fabric one Organization can operate a number of peers. What I want to say is, that you need clear definitions for words like: peer, organization, participant, channel.

In the next post you can read about an actually new design. I am going to present a blockchain data structure that will provide phenomenal attributes.

I want to say thank you. Thank you to the great Hexo community. The web system is beautiful. That is also the reason why this website is also made with it. Now it is time to give something back.

So here it is: As software developer we frequently need to present complex issues. There a small graphic for illustration can be worth more then a thousand words. A great tool to create graphs is nomnoml. As the name suggest its main purpose is for UML-diagrams. With an easy to learn syntax and a small plugin we can create graphics direct in the post’s markdown.

Simple use npm install hexo-tag-nomnoml to install the plugin to your hexo website. Then you can use the hexo-tag nomnoml to add graphics as demonstrated here:

{% nomnoml '{"style":"float:left;"}' %}
#fill: #00aaff;
[hallo] -> [world]
[tobias] love-> [Fanni]
[tobias] is on -> [earth]
[Fanni] is on -> [vanus]
{% endnomnoml %}

To learn more about nomnoml checkout its website and github repo.

Just to get it out of the way: BLOCKCHAIN ! ! !.

Even dough I recently do not work with blockchain, I still believe in the technology. I do not believe in the currencies, they are mostly fraught. That still does not change anything on the value of blockchain.

So far, I worked with three big blockchain systems. Hyperledger Fabric, Hyperledger Sawtooth and BigchainDB. They all have in common the different focus of use case. They try to make business and organizations work more effective together.

Working with these systems, I learned log about the architectures of blockchain and business applications. In Fabric there is a great separation of responsibilities for the different components. These components (endorser/orderer/ledger) can each execute one part of the infrastructure and make sure to process lots of transactions. As a storage Fabric can use various database management systems.

Sawtooth is storing data in a local merkle tree. I believe you are not able to store as much data in the sawtooth store as you can do in Fabric or bigchainDB. There is an other feature that surprised be a lot. They have the ability to let the users generate their rsa-key-pair in the browser. Also the user can create and sign transactions in browser so that the sever never need to see the private key. As I had analysed, it would be possible to implement that feature as well for fabric. but it would require a major rewrite of the SDK.

On the technical part it is nice and good, still I see there is space for a system, that is able to cover many use cases that other blockchain architectures do not have in mind. I see that todays blockchain systems do not have the sovereignty of organizations of companies in mind. Sure, it would be a dream if companies would share data more openly. Still I do not believe that companies and government organizations would ever be able (and for sure not willing) to open all data goes into the decision for the execution of transactions. I believe organizations and individuals have to be able to do independent decisions if they accept certain transactions or not(during the endorsement process).

A second huge feature I see missing is what I call fragmentation. I believe to participate on a blockchain it should not be required to download and verify each and every transaction. I have my wallet, My car or my house or my stock portfolio, I don’t care about the wallet of my neighbor, I don’t care about the fishing licence of Joe Public in Bavaria and for sure i don`t care about the beer bottle with the id ‘a83aebd7-8a6c-46cc-83c8-8b99bba195d5’ was warm when it was served in London. Still I want to be sure, that when someone makes a decision to stand by it (within reasonable limits).

And third, setting up a blockchain system has to be reasonable easy to manage. Almost like the famous 5-minutes installation of a wordpress website. As long as setting up blockchain systems requires large teams of developers, and expert knowledge in economy, politics and computer science, I do not believe that blockchain has a real chance for a wide adoption.

You know, based on that assumption, I believe it would be possible to combine the advantages of all systems and create a blockchain architecture, that consist of distributed components for great scalability, allow user determined management of their crypto materials, support lots of transactions on a single channel, store huge amounts of data in a ledger database, verify a transaction against a blockchain without downloading and storing all data ever.

how can that be done? look at the next post.

Talking about some technology is difficult. You are passionate about some technology, just some technique, some idea how you want to structure your code, a lib or anything that you learned to know and think that could be useful for your projects. You like that, what ever it is. You think that might be changing your work. Then of course you want tell someone about that. But they don’t get the point.

That might have different reasons.

lack of interest
lack of understanding
is currently passionate about something else

Pretending to understand and talk about very general/low level stuff

Pretending he had a similar solution by doing something different and telling you about his interesting stuff, that you don’t care

Pretending to be interested, knowing they can never catch up in a reasonable time to understand

you find someone who understand it, who is giving you further good thoughts, but they are so busy doing other stuff.

Find someone else, find someone who got the point and is willing to use it in a project with you.

XML is loosing traction, it seems that every new API uses JSON or alike. But still there are big data sets only available in XML. As I already had a great XML-parser, that is extremely fast, has a clean API and provides an AST/DOM, I had to fill the last important feature missing for that parser. Until now it was only possible to parse about 10-40 Megabyte strings.

I thought long and I started a few times implementing a parser that is still very fast and has all the features and on top of that is able to parse though large files. Such as a Wikipedia-dump or the openStreetMap-world file. But now about at the fifed try, I found a solution to handle streams. I solved it by taking assumptions about the shape of large xml-files. Large XML files usually consist of a root element, containing a long list of items. The new parser is going to provide items one by one. It uses a nodejs-Streams. That makes it possible to use a stream reader for compressed files and use the plane-data stream for the xml-parser.

Each item provided from the xml is an ast on its own and can easily be simplified by the framework. That makes working with xml-files not just much faster then ever before in JS it is also much more convenient. Developer have an API they are probable already familiar with.

If I would be you and have to work with XML data, I would definitely use tXml!!! If you can really choose, choose JSON.