Zenroom

Zenroom executes smart-contract code written in Zencode.

Zenroom is a tiny secure execution environment that integrates in any platform and application, even on a chip or a web page. It can authenticate, authorize access and execute human-readable smart contracts for blockchains, databases and much more. It helps to develop cryptography keeping it simple, understandable and maintainable.

Zencode example

Generating a keypair:

Scenario 'ecdh': Generate a keypair

Given I am 'Alice'

When I create the keypair

Then print my data

Encrypting a message with a public key (See this tutorial for more background):

Rule check version 1.0.0
Scenario 'ecdh': Alice encrypts a message for Bob and Carl

# Loading Alice' keypair
Given my name is in a 'string' named 'myUserName'
Given that I have my 'keypair'

# Loading the public keys of the recipients, you can load as many as you like
Given that I have a 'public key' from 'Bob'

# Loading the secret message
Given that I have a 'string' named 'myMessageForBob'

# Encrypt the secret message for 1st recipient and rename the output
When I encrypt the secret message of 'myMessageForBob' for 'Bob'
When I rename the 'secret message' to 'secretForBob'

# Printing out the encrypted messages: it's recommended to print them one by one
# Cause if you use the "Then print all" statement, you would also print all the keys.
Then print the 'secretForBob'

Further Reading