"Native Smartcontracts" for IPFS?

Hi there,

Has there been any thoughts in the past about having smartcontracts natively supported by IPFS?

Meaning, in addition to the “add” api, which puts a file onto IPFS, a possibility to add-to-contract, meaning the smartcontract (living as file on IPFS itself) gets invoked by the add-method, leaving some sort of trace of its execution and as part of its execution creates new content.

const client = ipfsHttpClient('https://ipfs.infura.io:5001/api/v0')
const contract = ipfsSmartContract('ipfs://xxxxxxxasdasdas23221');  // DID
const added = await client.addToContract(file, contract)

The smartcontract, for instance coded in Javascript, runs in a node box which is handled by the IPFS server.

I can imagine there are many reasons other features would take precendence over such idea, beyond maybe many downsides (like endless loops or so) - one could think of.

Nevertheless, being able to have code reliably and traceable run on IPFS could also have its use cases in real world, especially when you don’t want to have reliance on/need for smartcontracts on blockchains.

Anyone care to chip in?

Thx

Tom

IPFS is not a blockchain and has no way to do verifiable computation.

The closest thing you could do is web assembly module into IPFS blocks.

2 Likes

Take a look at crust network. Blockchain storage on top of IPFS.

2 Likes

Thx @hsn10 and @SionoiS - will take a look & give it a thought