A compiler method for a smart contract. The compiler method is deployed on a blockchain; hence, the compiler method is an on-chain compiler. The compiler method comprises receiving a byte sequence program for an object structure. The object structure includes at least one agreement condition. The compiler method further, maps the byte sequence program into at least one executable smart contract representation of the object structure executable by the blockchain.