Solidity AI demo

A demo of first-ever AI-enabled in a Solidity smart contract running on ETH side chain. An image is being uploaded into a decentralized social network running on a blockchain. Once the image is uploaded into the blockchain file storage, a precompiled SmartContract analyzes it using Resnet50 neural network, and rejects it if it contains an image of a cat.

5 Likes

Exciting. Wondering how much gas was spent by the call? And what size the image has?

2 Likes

Very promising. I have the same questions, how expensive is this operation?

1 Like

seems one way to filter out illegal information, but too expensive I guess

Thank you guys - the operation is not expensive. It is the same order of magnitude as crypto algorithms (e.g. ECDSA signature verification) . We did not decide on the gas value yet, but we are able to do several hundred AI predictions per second in EVM …

3 Likes

interesting, what about the transaction size and parameter size for the AI model?

This is awesome! :slight_smile:

What kind of sidechain are you using?

1 Like

Interesting:laughing:,want more detail

1 Like

Is the image processing off chain? It certainly cannot be on chain. Did you use a their party server to delegate the expensive computation?

1 Like

Yep - in our case image processing is precompiled smartcontract on chain.

We are using SKALE chains.

2 Likes

where are the inferences displayed? i couldn’t tell from the video, i only saw how the image was uploaded.

also, could you share the code you wrote for this?

Is the code available or could you mention any open-source projects that demonstrate a similar idea? I would like to read and learn more.

Awesome! It’s hard to believe that this is an idea which has been realized in 2019.

since I’m newbie to SKALE sidechain, so some questions here.

  • According to the large number of user requests in the past, we need to update the recognition model to improve the accuracy. Whether the model can still be updated after the contract is deployed?

  • Is SKALE sidechain based on zero-knowledge proofs and how does it achieve correctness?

Running precompiled some AI inference is Very interesting. Is there any advancement? and what is your idea?

1 Like

I could see this being useful to prevent the verification and injection of any known malicious smart contract Solidity action. Do away with being able to hide operations, set others’ permissions by blocking such things as msg.sender == newOwner and could also help limit or learn if the actin is being done too many times and I’d imagine built in wad calculation could work.

Just some thoughts.

Would also love to see the relevant code open sourced. However, especially interested in optimize performance for using AI model in smart contract.