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

Monday, June 25, 2018

Mining and optimization


Mining or block creation process in a blockchain consensus protocol can be regarded generally as an optimization problem. We have N different transactions in a transaction pool from which we have to find an M number of transactions that are consistent with each other and with older transactions as well in a way that double spending is avoided. Hence each transaction has a two parameters: a size and a transaction fee. The purpose of the optimization is to put a number of consistent set of transactions into the block that remains under the block size limit but provides the maximum possible transaction fee: I am curious if the problem can be generalized and solved in linear time probably the miners simply use heuristics.  

Friday, June 22, 2018

Blockchain as the next level of gamification


From an economical perspective blockchain and cryptocurrency based platforms can be regarded as the next level of gamification. With cryptoecomomical incentive structures it is possible to turn every kind of gamification, score or badge based systems into real measurable economical value. A well designed cryptoecomomical system is exactly what most of the gamification systems do: encourages and discourages certain patterns of behavior. 

Sunday, June 17, 2018

Solidity Tips and Tricks - private variable value


Private variables from solidity are usually not so private as they are expected. Value of a private variable can be read out by someone running a full client node and having a javascript console. As an example, considering the following private variable of a contract:

contract PrivateContract {

    string private Password = "MyPassword123";

    constructor() public {
    }

By knowing the contract address and running a full node on the Ethereum network, you can easily read out the value of the private variable, like with:

 web3.eth.getStorageAt(contractAddress, 0)

which results the following hex value:

'0x4d7950617373776f72643132330000000000000000000000000000000000001a'

after encoding:

MyPassword123

So the message is simple, do not store private information in private variables on the blockchain, because it is not really private !