...by Daniel Szego
quote
"On a long enough timeline we will all become Satoshi Nakamoto.."
Daniel Szego

Saturday, January 7, 2017

Notes on testing a Bockchain application

Testing a Blockchain application is actually fundamentally different as testing a custom software solutions. The problem is that the domain of a usual Blockchain solution is usually in a domain that requires high privacy and security. Theoretically, the Blockchain technology itself provides a certain level of privacy and security, despite there have been already a lot of hacking both for the Bitcoin protocol and for systems like Ethereum as well (for instance the DAO). Consequently, testing a Blockchain application requires much more competence in the direction of system hacking or cryptography than traditional testing methodologies. Instead of classical tests, perhaps a better way to set up an explicate set of advisories as possible attacks and show that the system is immune for these attacks. Another point to consider, if it is possible to test a Blockhain platform itself from an application that is built on top. 
    
One way in this direction to formulate the problem from a quality management point of view and give an explicit set of rules that should be kept at the implementation in order the system to be secure. Example for such an initiative is the CryptoCurrency Security Standard (CCSS) for defining implementation rules for Bitcoin applications. 

Another way might be the direction of mathematical proofs if the program works as expected. One initiation is the formal verification from solidity.

Friday, January 6, 2017

Setting up Ethereum development environment - tools

Being new in a programming language and environment it is sometimes a difficult to set up an initial development environment. We try to summarize the most important tools in the followings:

Solidity, browser edition (https://ethereum.github.io/browser-solidity/):
- lightweight development environment for coding in solidity. 
- good tool for developing and manually testing small contracts or simply to practice the language. 
- no-live Blockchain integration

Mist browser (https://github.com/ethereum/mist/releases):
- I would say this is the infrastructure part of Ethereum: fancy user interface for managing accounts, smart contracts, deploying into the test or live Blokchcain or simply initiating transactions between actors. 

Geth (https://geth.ethereum.org/downloads/):
- This is another tool on the infrastructure side. Geth is a command line tool for similar purposes as the Mist browser, like creating accounts, deploying contracts to the Blokchain or transferring ethere  between different accounts. It provides however extended functionalities. like setting up a private Blockchain or accessing to some of the detailed cryptographycal elements of an account.   

Ethereum Block explorer (https://etherscan.io/):
- It is an online monitoring tool for the live Ethereum Blockchain, providing the possibility to see accounts or transactions.

Ethereum Studio (http://blog.ether.camp/post/142794388568/ethereum-studio-is-ready-for-you, or https://live.ether.camp/):
- Ethereum Studio is a complex online integrated development environment to develop and test Blockchain applications, including both solidity and other javascript elements.

Additional practical tools (http://ether.fund/tools/):
- There are some additional tools that are nice to use, like Ethereum unit converter.




Wednesday, January 4, 2017

Serializing state into the Blockchain in Decentralized Business Process Management

Well serializing state for Decentralized Business Process Management (or simply DBPM) does not seem to be very complicated for the first sight If we consider Ethereum as a Blockchain solutions. Let we assume that we have custom workflow for approving a project budget, having the following properties: ProjectName, ProjectType, ProjectBudget.The first intuitive realization is a simple smart contract, called WF_ProjectBudget having the three properties as parameters and having a set get function for each: 

contract WF_ProjectBudget
{
 string ProjectName;
 string ProjectType; 
 int ProjectBudget;
 
    function setProjectName(string _ProjectName)
    {
        ProjectName = _ProjectName;
    }
    
    function getProjectName() constant returns (string)
    {   
        return ProjectName;
    }

    function setProjectType(string _ProjectType)
    {
        ProjectType = _ProjectType;
    }

    function getProjectType() constant returns (string)    {
        return ProjectType;
    }
    
    function setProjectBudget(int _ProjectBudget)
    {
        ProjectBudget = _ProjectBudget;
    }

    function getProjectBudget() constant returns (int)    {
        return ProjectBudget;
    }
}

There is a problem however with this intuitive approach. As the parameters can be set one by one, there is no guarantee that they will be set in an atomic action, meaning that either all of the values change or none of them. Supposing that atomic action is required saving the workflow state, the following code might describe the situation better:

contract WF_ProjectBudget
{
 string ProjectName;
 string ProjectType; 
 int ProjectBudget;
 
    function getProjectName() constant returns (string)    {   
        return ProjectName;
    }

    function getProjectType() constant returns (string)    {
        return ProjectType;
    }
    
    function getProjectBudget() constant returns (int)    {
        return ProjectBudget;
    }

    function setWFState(string _ProjectName, string _ProjectType, int _ProjectBudget) {
        ProjectName = _ProjectName;
        ProjectType = _ProjectType;
        ProjectBudget = _ProjectBudget;
    }
}


It is important to note that although the construct seems to be pretty simple, it guarantees that the three values are set in an atomic transaction independently of any kind of possible errors, like network outage, validation node failure or heavy cyber attack.

In real life scenarios we should consider that not always the whole state but only a part of it is saved in a transaction. As a consequence, it might make sense to explicitly define atomic groups: group of variables that should be serialized together. Another drawback is that this model assumes the one contract - one workflow model. A more general model might be to work with structs instead of individual variables, in this way one general solidity contract can contain the storage interface for several different workflows:

contract WF_State
{
    struct ST_ProjectBudget{
     string  STProjectName;
     string ProjectType;
     int ProjectBudget;
    }

    ST_ProjectBudget LatestProjectBudget;

    function WF_State(string _ProjectName, string _ProjectType, int _ProjectBudget)
    {
        LatestProjectBudget = ST_ProjectBudget(_ProjectName, _ProjectType, _ProjectBudget);
    }

    function getProjectName() constant returns (string)    { 
        return LatestProjectBudget.ProjectName;
    }

    function getProjectType() constant returns (string)    {
        return LatestProjectBudget.ProjectType;
    }

    function getProjectBudget() constant returns (int)    {
        return LatestProjectBudget.ProjectBudget;
    }

    function setWFState(string _ProjectName, string _ProjectType, int _ProjectBudget) {
        LatestProjectBudget.ProjectName = _ProjectName;
        LatestProjectBudget.ProjectType = _ProjectType;
        LatestProjectBudget.ProjectBudget = _ProjectBudget;
    }
}







  

Blockchain as a storage

From a technical point of view Blockchain can be regarded as some kind of a special storage system. It is much slower as for instance a replicated database system, however due to the P2P architecture the availability can be actually higher as at a replicated database. Certainly the 'hacking resistance' is much higher at a Blockchain solution as with other solutions, and of course a Blockchain is far less efficient (Figure 1).



Figure 1. Blockchain as a storage.


Ways of decentralization for Decentralised Business Process Management

Considering Decentralized Business Process Management (or simply DBPM), one of the major question is which part of the framework should be decentralized and which should be not. The system has at least three layers (Figure 1), so let we see which one should be decentralized:

- Data Layer: Data is the state of the system tha has an initial state and a final one between all transitions. That must be saved into the Blockchain, it is one of the key characteristic of the  Business Process Management solution. However, it might be considered if all state between all transitions are saved or only certain ones, working as a checkpoint of the system. As an example, it can be imagined that cross-company decentralized processes save states of transitions in the Blockchain only if they deal  with cross-company communication. Local steps that are internal for a company can be realized independently from the Blockchain. 

- Workflow and Rule Engine: Well it is the major question of only storage should be decentralized or computation as well, like workflow or business rules. Having decentralized storage only without computation provides us clearly the advantage that workflow transitions run efficient. However, if the system is hacked in a way, then perhaps a state is written into the Blockchain that is already 'hacked'. It would be certainly a tragedy. On the other hand, keeping the computation decentralized might provide an enorm computing capacity. 

- Low code editors and API-s: Low-code, no-code editors are usually user interface components that should not be considered to keep decentralized. However, it is an open question how it is possible to avoid that the system is hacked and a wrong state transition is simulated. 



Figure 1. Possibilities for decentralization.

As a conclusion, the best option should be to provide a customizable solution, in which both elements of the state and types of the transitions could be individually parametrized if they should be saved into the Blockchain and validated by a decentralized consensus or not.  

Monday, January 2, 2017

Notes on machine payable micro-services


With the appearance of the different cryptocurrency technologies, micro-payment services have become possible. So basically the next evolutionary step can already be predicted: cloud-micro services with the direct micro-payment possibility. There are some initiative for creating such an architecture for Bitcoin, like, https://21.co/, however I think the idea gets much more exciting if it changed to Ethereum. At Ethereum there is basically an amount of 'money' or gas that is payed for all of the execution that are validated by the Blockchain. It is not difficult to imagine an extended model where each execution independently if it is an internal call or a an external micro service cost a certain amount of 'money'. In this sense providing a backend service will be realized as a complex micro service integration task with complex financial impacts. 

Sunday, January 1, 2017

Technology hype-cycle, exponential growth and the s-curve

Classical technology hype-cycles usually have the following characteristics: After an over-estimated expectation curve there is a negative peak of expectations and on the long run, the somehow the expectations reach the real output of the technology (Figure 1).


Figure 1. Technology Hype-Cycle.

Surprisingly the first positive and negative peaks can be pretty well described with the the following model. We can assume that the technology is exponential, starting slow at the beginning in comparing with a linear growth but after reaching the "singularity" point accelerating fast. Human forecast on the other hand are usually linear, just because based on the human thinking it is much easier to imagine something that is linear. The difference of forecast and real performance of the technology, let we call it over expectations, shows exactly the previously demonstrated positive - negative peak characteristics (Figure 2). 


Figure 2. Exponential technology curve vs linear expectations.

The model can be further refined if we suppose that the technology itself is not exactly exponential but it has the characteristics of a typical technology. With other words let we assume that the technology has a typical s-curve, but the expectations are despite linear. If so the phase of 'slope of enlightenment' can be clearly identified (Figure 3).



Figure 3. Technology curve with linear expectations

The need for machine assisted human intelligence


As more and more information getting available on the internet, sometimes in a pretty well organised way, the natural question rises: how can one cope with dealing with this always increasing amount of knowledge and information. Several educational platform like Coursera already exist there is already a way for getting this knowledge in a very well structured and high quality way. Despite the amount of information is simply huge. As we hear practically every day the achievements of the artificial intelligence, the questions raise pretty much naturally: is there a way to support the systematic learning process with machine intelligence ? Is there a way that I get access for the knowledge somehow in a machine assisted modular way, that I do not have to learn everything by myself ?  And well basically the answer should not be just having some data mining algorithm to offer the next course if I have already finished one, but something much more efficient, like getting the whole knowledge instead of 2 weeks in 2 hours. 

Notes on disruptive educational technologies


Udemy, Coursera, Nanodegree, Getsmarter and a docent of different online educational platform have been being emerged from the void in the last couple of years. They are sometimes different regarding on the business model and the used technology: as Coursera and Getsmarter concentrate rather on getting the education from well-known universities, Udemy tends to be rather an open platfrom for everyone. It is however surprising that high-quality knowledge itself have become very cheap and very wide-spread. It will surely have disruptive impact both on the global education and on the job market as well. 

Sunday, December 18, 2016

Towards unmanned software development and delivery

In the good old days custom software projects were simply. there were some kind of an initial interaction with the customer called as specification or analysis then developing and architecting a solution and at the end some kind of a delivery. Independently if the project was running in a classical waterfall style or something more fancy agile style  software projects had the following roles:
- Business Analyst / Industry Business Consultant: to help for the customer to create / update / finalize the specification.
- Software Architekt / Developer : to implement the software itself.
- Infrastructure expert: to deal with special infrastructure oriented questions.
- Tester: to quarante software quality.
- Project Manager / Scrum Master: to coordinate the whole process.

- Sales: selling the software.
In the meantime complex development frameworks appeared as well making a custom software development from the end customer point of view simpler, usually reducing the development efforts and making possible a much faster agiler and bug-free software delivery. Typical examples for these frameworks:
- Rapid application development frameworks: these are practically rather development oriented frameworks that make the coding much faster, implying in less coding resources. Examples were for instance the Enterprise Library for .NET framework.
- Complex Business Solutions: There are a lot of initiative to provide a framework with many use cases out of the box, starting from the most common user and identity services to complex business applications or apps implying reduced again the need for reduced resources in the classical technical coding - testing fields. Example is Odoo Business Apps.
- Self-Service Solutions: Last but not least there are many solutions that work in a self-service manner, providing the possibility for end-customers without prior development or even IT knowledge to build up software applications themself. Examples are elements in the Azure cloud, like PowerApps or PowerBI.

Certainly there is a catch using these frameworks. Even if they are theoretical self-service or providing a lot of functionality out-of-the-box, they reach in real life a highly increased technical complexity. So configuring these frameworks usually require pretty much know-how, as a consequence delivering solutions with such frameworks require highly increased IT consulting (Figure 1).



Figure 1. Roles and resources in different IT projects.

So the question is in which direction can we imagine the further development of custom software development and delivery, I think there are three major factors that should be considered:

- Sharing economy: As software are not necessarily developed from the zero but rather half-ready parts are configured together sharing parts of the software will play an always increasing role. Something similar is already happening on the cloud backend side, instead of individual software, everyone try to concentrate on creating and sharing (or selling) micro-services. On the other hand, certain software configuration frameworks like Azure PowerApps already contain built-in feature to share part or the whole application. It is important to note that sharing does not only make an application available, but the collected domain and industry know how as well. As an example supposing that I spent 20 years in the logistics field and I create and publish my custom logistics application then indirectly part of my collected domain know-how will be shared as well.

- Electronic Markets: Electronic markets are similar to sharing economy, making possible that the collected knowledge is used by someone else. Direct applications of the market can be selling and reselling building blocks of a software or whole ready to go solutions.

- Machine Intelligence: Despite machine intelligence is pretty much in an over-hype-cycle at the moment, it can be used to analyzing or refining specification of a software. Creating the first requirement analysis with machine intelligence is certainly difficult, although there are some attempts for that like in process mining. If a version of a software set up however it is simple to monitor the usage of the software itself, analyzing the data with machine learning and proposing a new better version of the software automatically. Example for such a framework is the Gird, fully automated web pages based on machine learning of web traffic.

- Robo advisors: To decrease the complexity of a configuration framework from an end-customer perspective and eliminate the need of IT consultancy Robo-advisors can be used. Although such advisors are more typical in the fintech field at the moment, it is not illusory to imagine that similar technology can be implemented in the software development branch.

So as a conclusion let we imagine perhaps in the not far future a classical software development example as an end-customer needs some kind of a custom software for supporting his business processes. Let we investigate which human resources and roles do we need for that:

- Do we need Business Analyst - Software Architekt - Business Consultants for creating and delivering a custom software solution ? Well, not necessarily, firstly ready-to-go software solutions can be bought via online markets or simply used via sharing platforms. If the end-customer does not find a ready ready solution, custom software solution configurations can be used in a self-service manner with the help of robo-advisors and machine learning to create the necessarily solution.

- Do we need Developers - Software Architects or Testers for creating and delivering a custom software solution ? Well, not necessarily, If we work with configurable software solution frameworks, most software is produced on a self-service manner. Certainly such frameworks have to be implemented first in a classical way, however if they are created already, concrete software solution development can be realized without developers, software architects or testers.

- Do we need Infrastructure experts for creating and delivering a custom software solution ? Well, not necessarily, if everything is hosted in the cloud than minimal infrastructure expertise is required.

- Do we need sales people for selling a custom software solution ? Well, not necessarily. if everything is sold via online markets and application stores than further sales support can be avoided.

- Do we need Project Manager for creating and delivering a custom software solution? Well, not necessarily, if we consider the previous points the only human in the software delivery process is the customer, so project management is not required.