MATRIX's unique code generation technique allows automatic conversion of an abstract description of a smart contract into an executable program. Matrix only requires users to input the core elements of a contract with a scripting language. Then a code generator based on a deep neural network is able to automatically convert the script into an equivalent program. MATRIX introduces a new mining mechanism in which miners perform the Markov Chain Monte Carlo (MCMC) computation, an essential tool for Bayesian reasoning. MCMC based Bayesian computing plays a fundamental role in numerous big data applications such as gene regulatory network, clinical diagnosis, video analytics, and structural modeling.