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

Wednesday, January 31, 2018

Computational and business models for tokenisation


As most blockchain platforms are built on different tokens and cryptoassets it can be foreseen that most new state of the art blockchain end user applications will be based from an architectural perspective on tokens. For this reason it is an interesting question how different computational models and IT architectures can be reformulated based on tokens. Among the others:
- How accounting can be built on tokens, similarly as triple accounting ?
- How workflows can be built up with the help of tokens ? 
- How business processes can be formulated with the help of tokens ? 
- How token based collaboration models can be set ?
- How data flow models can be defined by tokens ?
- How business models can be defined with the help of tokens ?
- How organisational structure can be defined on tokens ?
- How blockchain tokens and classical database or network technology can be integrated with each other ?
- How markets can be built on tokens ?
- How AI and machine learning can be built on tokens ?
...
- What other kind of token based computational model can be imagined ?

Monday, January 29, 2018

Solidity and Truffle Tips and Tricks - all past events of a contract


So, if you want to read out all of the events of a contract and you have a geth client and a synchronized blockchain, even if you synchronized the blockchain with the --fast directive, you can use the following pattern: 

var abi = [{...}];

var contract= web3.eth.contract(abi);

var corionRef =contract.at(<... address...>);

corionRef.<Event>({},{fromBlock:0,toBlock: 'latest'}).get(
  function (error, eventResult) {
    if (error) console.log('Error in Event event handler: ' +
        error); 
    else console.log('Event result:'+ JSON.stringify(eventResult));
});





Sunday, January 28, 2018

Blockchain + smart contracts and business logic


From an architecture perspective, initial versions of a blockchain protocol, like bitcoin had a pretty simple architecture: transactions were put into the system that were validated by nodes and ordered into batches by the miners and the state transaction was computed as well in the same time. This architecture was further developed by smart contract systems like Ethereum in a way that instead of simple transactions, a complex business logic can be executed named as smart contract. 

As smart contracts seem to be a natural way to define general business logic into a blockchain system there might be a fundamentally different way of extending a blockchain architecture. Mining or ordering service is responsible for finding a subset of the transactions that are consistent and avoid double spending. However this logic can be something much more difficult, like solving different graph algorithms on the transactional graph or even general computational algorithms like something with constraint satisfaction or rule based systems. It might be even an option to define ordering based business logic as different modules that might be dynamically configured. 

In this sense business logic in a blockchain system might be designed in a two level way, similarly as in a classical software design there is client side and server side business logic:
- business logic that extends a given transaction and influences only one or just a couple of addresses should be realized as a smart contract.
- business logic that effects all of the accounts and transactions and the perhaps the ordering logic of the infrastructure as well should be realized together with the ordering service as an attachable business logic module.  


Thursday, January 25, 2018

Solidity and Truffle Tips and Tricks - using Parity with geth console on windows


Using parity with geth console on windows might be a little bit tricky. The point is to start parity with --geth option:

parity --geth

which results that the '\\.\pipe\geth.ipc' file is generated, so you can simply attach with the standard geth command:

geth attach

Wednesday, January 24, 2018

Solidity and Truffle Tips and Tricks - getting all token balances


Well, it is always a little bit problematic for a token to get a simple list on all of the accounts that have token balances at all. The problem behind is that the token balances are stored in a mapping structure which is practically a hash tree structure meaning that you can query the values for each of the individual elements but you can not iterate on the structure. So the things that you can basically do are the followings:

1. If you know the certain address or addresses, you can query the balance for these addresses with the help of the balanceOf function. Certainly there is a way to read out the total supply of a token as well with a standard function.

2. At each transfer, there is a Transfer function raised with the from and to address. Blockchain explorers can read these transfers events and query the balance of the accounts of the related addresses. 

3. If the previous point does not provide the necessary result, you can try to start scripting a taint analysis with explicitly enumerating all of the addresses that were somehow effected by the contract and query for each address explicitly the balance. 



Tuesday, January 23, 2018

On corporate and easy ICO-s


With the Hype around ICO-s the investor structure is to be found in a change. Previously only crypto fanatics were investing into the field who were technically competent to master all the challenges of the technology, like private-public key management, or dealing with the blockckahin. Nowadays, there seems to be a shift on the field with having more and more non-professional and industrial investors as well. Considering these parties, classical crypto investment technologies might not be the best fit. It is a general question if crypto investment technologies can be further developed to serve corporate ot non-professional investor groups as well.  

Saturday, January 20, 2018

Blockchain and batching


In a blockchain protocol a block is basically nothing more than a special batch which summarizes a number of transactions into one batch to provide the ability for more easy processing.  

On the different types of sharding: Lightning network, private channels vs private transactions

Lightning network at Ethereum or Bitcoin are pretty similar to the concept of private chains at Hyperledger Fabric. They simply define am off-chain channel that is hooked at the beginning and at the end to the Blockchain, but otherwise the transactions are running independently from the Blockchain, On the contrary, private transactions at Quorum can be regarded as the other side of the coin: as the transactions are running on the Blockchain, they are encrypted and only certain nodes with the necessary key are able to decrypt. The state transition of the private transactions are saved however into a special state, called private state that is separated from the private state. In this sense private channels make a splitting or sharding on the Blockchain itself as private transactions make a splitting or sharding in the state. Certainly the top is the proposed classical Ethereum sharding, in which both the state and the transaction chain are spitted into pieces.   


Figure 1, different types of sharding

Friday, January 19, 2018

Decentralized App store or DApp store


As blockchain technology slowly goes into the mainstream at least from a the marketing point if view, it might be a good question which applications are generally required for industrial scenarios. On such an application is surely something similar as a decentralized app store, which works similarly as a classical app store only for DApps. So, let we take a look which functionality should be put into such a general DApp store:

- Trusted name service: Name service should give something as a general unique, human readable name for each of the DApps. The name should be associated with a certain properties of the Dapp itself, like addresses, the ABI description files and some meta information regarding the DApp. The name service should be trusted, meaning that only people having certain private keys for the DApp should be able to update the information. It might be a further function to be able to delete certain DApp. 

- Discovery: one way for getting the information about the Apps might be simply based on the name of the DApp. However, more sophisticated discovery services can be imagined as well, like getting information based on DApp meta-information, description or even based on the ABI file.

It is certainly questionable how such a discovery can be realized in an efficient way. Further question if such a system should be blockchain specific or there is a way to realize such a functionalities in a multi or cross blockchain way.  

Tuesday, January 16, 2018

Solidity Blockchain - Metamask doesn't work with Ethereum Consortium Blockchain


If you work with Azure Blockchain especially with the different Azure Ethereum Consortium Blockchain templates and with Metamask, you can usually experience errors in several situations. Examples might vary from Metamask not able to connect to the network, or not able to receive transactions, or you can able to receive transaction but you are not able to send, because it stuck with a pending status or it freezes after one or two confirmations. The most simple resolution is to install an older version of Metamask to the browser. The most typical reason of the error is that Azure Blockchain geth nodes are still in an older release that is not compatible with the most up-to-date Metamask version.