Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

A short demo of how ark smart contracts could work using IPFS and sandboxed JS

Notifications You must be signed in to change notification settings

superwoodle/ark-smart-contract-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo Smart Contracts on ARK, created at HackPrinceton Fall 2018

https://devpost.com/software/ark-io-smart-contract

About

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.

There is currently no way to pay to a hash/contract, so the account just pays to itself

Setup

Run Docker container for ARK Testnet, (run from Ubuntu VM with ngrok)

sudo docker run -p 4003:4003 kaiserkarel/hackark

Starts ARK node on port 4003

Run IPFS on local machine

ipfs daemon

Notes

About

A short demo of how ark smart contracts could work using IPFS and sandboxed JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published