Smart contracts are poised to usher in a new era of peer-to-peer transactions and activities. Many things have been written about smart contracts and their “trust-less” nature but how easy is it to validate any smart contract does what its author claims it does?

In a decentralized setting trust is earned, not assumed. So then as a developer, customer or business attempting to interact with smart contracts, how do you begin to trust anything?

Ethereum’s smart contract language ‘Solidity’ is the major player in the space, and adopted as the smart contract language of choice by other platforms. This is the way a smart contract looks when viewed on the Ethereum blockchain:

60806040526aa56fa5b99019a5c800000060035534801561001f57600080fd5b50600354600160a060020a0333166000908152602081905260409020819055600255610874806100506000396000f3006080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b5061019561037b565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a0360043581169060243516604435610381565b3480156101dd57600080fd5b506101956104ff565b3480156101f257600080fd5b506101fb610505565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561050a565b34801561024157600080fd5b50610195600160a060020a0360043516610602565b34801561026257600080fd5b506100d361061d565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610654565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561074b565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107ed565b60408051808201909152600881527f547275654465636b000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103a657600080fd5b600160a060020a03808516600090815260016020908152604080832033909416835292905220548211156103d957600080fd5b600160a060020a03831615156103ee57600080fd5b600160a060020a038416600090815260208190526040902054610417908363ffffffff61081816565b600160a060020a03808616600090815260208190526040808220939093559085168152205461044c908363ffffffff61082f16565b600160a060020a0380851660009081526020818152604080832094909455878316825260018152838220339093168252919091522054610492908363ffffffff61081816565b600160a060020a038086166000818152600160209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60035481565b601281565b600160a060020a03338116600090815260016020908152604080832093861683529290529081205480831061056657600160a060020a03338116600090815260016020908152604080832093881683529290529081205561059d565b610576818463ffffffff61081816565b600160a060020a033381166000908152600160209081526040808320938916835292905220555b600160a060020a0333811660008181526001602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f5444500000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03331660009081526020819052604081205482111561067957600080fd5b600160a060020a038316151561068e57600080fd5b600160a060020a0333166000908152602081905260409020546106b7908363ffffffff61081816565b600160a060020a0333811660009081526020819052604080822093909355908516815220546106ec908363ffffffff61082f16565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600160209081526040808320938616835292905290812054610783908363ffffffff61082f16565b600160a060020a0333811660008181526001602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561082857600080fd5b5050900390565b60008282018381101561084157600080fd5b93925050505600a165627a7a72305820b7bda2c17bde120610d8756414d5e5ff698ab33fd555b18576ba4cdf45ac80bb0029

I made you scroll all the way down here to hopefully make you think “what is this and why am I looking at it?” If you thought that, you illustrated my point perfectly.

Would you have guessed that this was the contract from “Truedeck”? Its a project that expects the gambling industry to use and trust this smart contract for online gambling. Even if you somehow did guess that, there is no way for you to decipher it.

Now, to be less obtuse; yes, you can look this contract up on Etherscan and get it’s verified code. But, this requires you to use and TRUST a third party to verify that the information is correct, which is not in the spirit of a decentralized, trust-less community. Making matters worse, you cannot turn a Solidity contract back into the code that created it, making your reliance on third parties inevitable.

In late December 2018, lamden.io released its “AnarchyNet”, which is an early stage deployment of its blockchain architecture named ‘Cilantro’. AnarchyNet also enabled development of Python based Seneca smart contracts.

Let’s look at how Cilantro stores Seneca’s smart contracts:

{"code_str":"@export

def balance_of(wallet_id):

# print(\"wallet {} has balannce {}\".format(wallet_id, balances[wallet_id]))

return balances[wallet_id]



@export

def transfer(to, amount):

balances = hmap('balances', str, int)

# print(\"transfering from {} to {} with amount {}\".format(rt['sender'], to, amount))

balances[rt['sender']] -= amount

balances[to] += amount

sender_balance = balances[rt['sender']]



assert sender_balance >= 0, \"Sender balance must be non-negative!!! {}, {}, {}, {}, {}\"\\

.format(rt['sender'], sender_balance, to, amount, balances.rep_str)



@export

def approve(spender, amount):

allowed[rt['sender']][spender] = amount





@export

def transfer_from(_from, to, amount):

assert allowed[_from][rt['sender']] >= amount

assert balances[_from] >= amount



allowed[_from][rt['sender']] -= amount

balances[_from] -= amount

balances[to] += amount}

(You can take a look at the entire contract by asking the AnarchyNet blockchain API to provide you the contract)

Each line of a Seneca contract is stored in native Python code; as it was programmed and submitted (including comments). To get an even better look at the code, let‘s copy it to a Python IDE and use the included ‘new line’ characters (“

”) to format it.

Jupyter iPython Notebook

Very refreshing!

As a developer or auditor, it is immediately apparent to me what this contract is going to do. Anyone can now run this code in minutes and validate that it provides the output they need.

To this day Sumo wrestlers demonstrate first party trust in each other by a display of open palms before each bout; a validation that they have no hidden weapons. As we go forward, the ability to quickly and easily validate smart contracts from a first party perspective does a lot to promote trust in an ecosystem that desperately needs it.