keep-starknet-strange / agentstark

Giza agents run provable ML models and act autonomously on Starknet using native Account Abstraction
MIT License
6 stars 3 forks source link
cairo starknet zkml

Agent STARK
![SN_Ver_0.12.2](https://img.shields.io/badge/Starknet-0.12.2-0C0C4C.svg?labelColor=282d33&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNTgiIGhlaWdodD0iMTU5IiBmaWxsPSJub25lIiB4bWxuczp2PSJodHRwczovL3ZlY3RhLmlvL25hbm8iPjxnIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTAgNzkuOTk2YzAgNDMuNjMxIDM1LjM2OSA3OC45OTkgNzguOTk5IDc4Ljk5OVMxNTggMTIzLjYyNyAxNTggNzkuOTk2IDEyMi42MjkuOTk4IDc4Ljk5OS45OTggMCAzNi4zNjYgMCA3OS45OTZ6IiBmaWxsPSIjMGMwYzRmIi8+PHBhdGggZD0iTTQ0LjE1NCA2MS4zODVsMS45NS02LjAyNWMuMzk2LTEuMjI1IDEuMzYzLTIuMTc5IDIuNTkzLTIuNTU1bDYuMDU0LTEuODYyYS45LjkgMCAwIDAgLjAxNC0xLjcwOGwtNi4wMjctMS45NWMtMS4yMjMtLjM5Ni0yLjE3Ny0xLjM2NC0yLjU1NS0yLjU5M2wtMS44Ni02LjA1NGEuOS45IDAgMCAwLTEuNzA4LS4wMTFsLTEuOTUgNi4wMjVjLS4zOTYgMS4yMjMtMS4zNjQgMi4xNzctMi41OTMgMi41NTVsLTYuMDU0IDEuODZjLS44MzguMjU4LS44NDcgMS40MzgtLjAxNCAxLjcwOGw2LjAyNyAxLjk1YTMuOTUgMy45NSAwIDAgMSAyLjU1NSAyLjU5NmwxLjg2IDYuMDUyYS45LjkgMCAwIDAgMS43MDguMDE0eiIgZmlsbD0iI2ZhZmFmYSIvPjxwYXRoIGQ9Ik0xMzkuODQ4IDU3Ljg3OWMtMi40OTYtMi43OTEtNi4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TQuMDk1YzAgNC45NjkgNC4wMzEgOSA5IDlhOSA5IDAgMSAwIDAtMThjLTQuOTY5IDAtOSA0LjAzLTkgOXoiIGZpbGw9InVybCgjQikiLz48L2c+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJBIiB4MT0iMTM5LjE3NiIgeTE9IjU1LjUwNSIgeDI9IjI4LjUiIHkyPSIxMTciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjZWM3OTZiIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZTE3NWIxIi8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9IkIiIHgxPSIxMjguMDciIHkxPSIxMDcuNzgxIiB4Mj0iMTEwLjA2OSIgeTI9IjEwOS42ODUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjZWM3OTZiIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZTE3NWIxIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+) [![Exploration_Team](https://img.shields.io/badge/Exploration_Team-29296E.svg?&style=for-the-badge&logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEgMTgxIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbDojZmZmO308L3N0eWxlPjwvZGVmcz48cGF0aCBjbGFzcz0iYiIgZD0iTTE3Ni43Niw4OC4xOGwtMzYtMzcuNDNjLTEuMzMtMS40OC0zLjQxLTIuMDQtNS4zMS0xLjQybC0xMC42MiwyLjk4LTEyLjk1LDMuNjNoLjc4YzUuMTQtNC41Nyw5LjktOS41NSwxNC4yN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MtLjY0LS40NS0xLjE0LTEuMDgtMS40Mi0xLjgxbDE5LjA0LDUuMTgsMi41OSwuNzhjMi4wNCwuNzYsNC4zMywuMTQsNS43LTEuNTVsMTIuOTUtMTQuMzhzLjc4LTEuMDQsMS42OC0xLjE3Yy0xLjgxLDYuNi0yLjk4LDE0LjEyLTUuNDQsMjAuNDYtMS4wOCwyLjk2LS4wOCw2LjI4LDIuNDYsOC4xNiw0LjI3LDQuMTQsOC4yOSw4LjU1LDEyLjk1LDEyLjk1LDAsMCwxLjMsLjkxLDEuNDIsMi4wN2wtMTMuMzQtMy42M1oiLz48L3N2Zz4=)](https://github.com/keep-starknet-strange)

AgentSTARK is an AI agent framework designed for Starknet. It uses the Account Abstraction and will be used with Giza's AI Agents to operate verifiable machine learning models and enable autonomous actions on Starknet.

How does it work?

skynet_diagram

Build the contract

Use scarb build to build the contract. You will need both the sierra and casm files to declare and deploy the account contract.

Deploy and fund your account

The Starknet JS deployment script [TODO] will return the transaction hash and the contract address. Send some Sepolia ETH to the account, the easiest way is to send it from any Argent or Braavos wallet. You will need that address to add the account to sncast.

Add your account to sncast

sncast --url "https://rpc.nethermind.io/sepolia-juno/?apikey=YOUR_API_KEY" account add --name agent --address your_contract_address --type oz --private-key 0x111111111111

Calling the verifier

cd scripts

Run the bash script with the verifier address and the calldata file generated from the Integrity repo. ./1-verify-proof.sh 0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7 calldata

Once the transaction is processed, the emitted event FactRegistered() returns the hash of the fact. Plug it into the the first call of the multicall.toml file to ensure checking the valid fact. Add the other calls the agent needs to execute multicall.toml.

TODO: connect the emitted event with the fact validity check.

Run ./2-check-fact-and-execute-calls.sh