Etleneum is a pun on Ethereum. But more than that it's a place where you can write public "smart contracts" that deal with satoshis as their universal currency.

The idea comes from the realization that the concept of "smart contracts" doesn't have to be restricted to blockchains decentralized censorship-resistance protocols. In fact, Ethereum itself arguably doesn't have these features. Anyway, a centralized smart contract platform can work for a myriad of use-cases.

An smart contract in Etleneum's sense is a piece of imperative code (in Lua, a language so simple and easy to learn no one bothers doing that) with an internal state (stored as JSON), a balance of funds (in msatoshis) and a collection of callable methods. Each contract is also associated with a name and description just to make it more user-friendly.

Once deployed contract code cannot change.

A "method" is just a Lua function. Each method can take msatoshis from the caller and a payload (JSON). Upon receiving a call for a given method the contract will add the attached msatoshis to its balance of funds and execute the code for that function. Besides Lua standard library the calls have access to a bunch of utility functions like http functions, keybase functions (useful for tying Etleneum stuff to external identities), util.sha256 and special Etleneum calls such as contract.send() which is the main way to get funds out of a contract by sending them to an existing Etleneum account.

Forgot to say that Etleneum has its own account registry that makes it easy to implement contracts that deal with accounts and send money from contracts to people. Some method calls can be made anonymously (when you don't expect to get any money back from the contract in the future, mostly) but in most cases an authenticated call it is needed.

Account logins are done with lnurl-auth and withdrawals with lnurl-withdrawal only. Since lnurl-auth is not as widespread as lnurl-withdraw I also made, a small helper that turns a username/password combination into a key that is then used to perform lnurl-auth. has many contracts deployed on it already. Some of them are there just for testing and demo purposes, but many others are serious (although modest) and can be useful. It's also possible to create a contract and then write a static JS client (or mobile app, or CLI tool, you name it) for it easily using Etleneum's HTTP API, that's what is happening at and, for example.

To create a new contract you have to be very careful because the code can't change and a bug can turn the contract in worthless garbage or be easily exploitable. I have some ideas of tools to improve the development process, but for now there is where you can create and call (and delete) contracts for free. For simple contracts it works quite well.

Built With

Share this project: