Inspiration

Ark does not currently have a feature to create smart contracts like Ethereum.

What it does

Transactions on Ark can only contain small amounts of vendor data. So instead of creating an assembly like language similar to Ethereum would be an incredibly difficult feat to accomplish in a short time, or forking the implementation to increase the transaction payload size, this demo stores a "contract" which is just javascript, in IPFS. Each smart contract transaction contains a pointer an IPFS contract file. When the transaction is mined, the contract is loaded from IPFS and executed using vm2 as a sandbox.

This design provides great flexibility with javascript, and keeps the blockchain small. However, it requires an outside provider; IPFS.

How we built it

IPFS + NodeJS client application + ARK Core docker instance on testnet.

Challenges we ran into

NodeJS client documentation was sparse, however, the code base was well organized.

What we learned

How Ethereum smart contracts work and their life cycle. Never touched them before.

What's next for ark.io smart contract

Better lifecycle hooks in to ark core. Also there is currently no way to pay to a hash/contract.

Built With

Share this project:

Updates