Add QAGENT decentralized AI agent marketplace contract#814
Add QAGENT decentralized AI agent marketplace contract#814RideMatch1 wants to merge 1 commit intoqubic:developfrom
Conversation
|
Before I start the review of this Contract, please make sure it compiles and does not have any error when checking with https://github.com/Franziska-Mueller/qubic-contract-verify. |
800d9bf to
4407762
Compare
|
@fnordspace Thanks for the review request. Addressed both CI failures and rebased on latest Contract VerificationRan qubic-contract-verify locally (latest Changes since initial push
Workflow runs need maintainer approval to execute (fork PR restriction). |
7c3ad96 to
745b823
Compare
|
Just to be clear about this contribution: This is entirely free. I don't want money, tokens, grants, or any form of compensation. I built this purely because I believe in Qubic and want to see it succeed. I've addressed all feedback from the contract verification check — it compiles, passes Let me put this into perspective: QAGENT is 3,800+ lines of production-grade smart contract code with a full test suite of 3,900+ lines. It implements three-tier dispute resolution with oracle escalation to the 676-computor quorum, stake-weighted governance, a five-tier reputation system, progressive slashing, commit-reveal task verification, and 29 procedures covering the complete agent lifecycle. This is not a toy contract. This is, to my knowledge, the most advanced smart contract ever written for Qubic — by a significant margin. Qubic needs real infrastructure to be taken seriously as a platform. A decentralized AI agent marketplace is exactly the kind of unique, high-value application that sets Qubic apart. This contract is ready to go, it's been built to production standards, and it's being offered at zero cost. I'm happy to answer any technical questions, walk through the architecture, or make adjustments based on review feedback. But I do need someone to actually look at it. If the team decides this isn't something they want — that's completely fine, it's your call. But I'd ask that this at least gets a proper technical review before that decision is made. The work speaks for itself. |
745b823 to
4a87934
Compare
|
@fnordspace The C4018 signed/unsigned mismatch that caused the previous EFIBuild failures has been fixed — all However, since this is a fork PR, the CI workflows require maintainer approval to run. The last two workflow runs are stuck on TL;DR: Code is fixed and rebased. Just needs a click to run CI. |
|
Status update on the open items from the previous review pass: Build fix. The Rebase. The branch is rebased onto current Expanded test coverage. Since the last push, the suite has grown from 96 to 120 test cases, now the most extensive coverage of any contract in
CI status. The post-fix runs on Happy to split the test additions into a separate commit series if that would make review easier. |
4ea102c to
d293829
Compare
|
Rebased on latest Both CI checks passed on the previous run (Apr 12), waiting for workflow approval on the new push. Ready for review whenever you are, @fnordspace. |
|
@RideMatch1 feel free to merge the newest |
0ba2895 to
8521113
Compare
|
Thanks @Franziska-Mueller! Just rebased on the latest develop which includes your oracle verification fix (#839). Ran the updated contract-verify locally (v1.0.7) — all checks pass. I kept the Branch is clean and up to date, ready for review whenever works for you @fnordspace. |
|
Thanks @RideMatch1 for your contribution. We will review the contract in detail soon. Please remove the using alias from |
fnordspace
left a comment
There was a problem hiding this comment.
Thanks @RideMatch1 for this PR. This is a first part of the review. Please note that we do not check the logic of the contract itself and mainly check for that the contract meets the requirements of a SC in Qubic. In this regard it looks quite good to me and i only pointed out a few small issues.
The arbitrator issue is not relevant for acceptance.
However I also struggle to understand the use of the Oracle at the moment. To my understanding this is only used for dispute resolution. However since tasks can be of a wide range how shall the oracle know how to answer the task? Maybe I miss something, tho.
7524009 to
18c82a3
Compare
|
Thanks @fnordspace and @philippwerner for the detailed review — really appreciate you taking the time! All changes are in:
On the oracle question (@fnordspace) — you're right that the oracle is most effective for deterministic tasks. The design is intentionally tiered:
So the oracle isn't meant to answer every task — it's a strong verification layer for tasks where deterministic reproduction is possible, and it gracefully degrades for everything else. Happy to add inline documentation to make this clearer in the code. Ran the updated contract-verify (v1.0.7) locally — all checks pass with the |
Smart contract for on-chain AI agent task orchestration. Agents register with stake, accept tasks with escrow, submit results via commit-reveal, and earn reputation through successful completions. Disputes are resolved by arbitrator voting or escalated to the 676-computor oracle quorum via the AIVerify interface. - 29 procedures, 9 functions, 96 Google Test cases - Three-tier verification: optimistic, challenge, oracle - Commit-reveal with K12 hash verification - 5-tier reputation system with progressive slashing - Stake-weighted governance with 10 tunable parameters - Task delegation up to 3 levels deep - AIVerify oracle interface (index 3) for computor quorum consensus - Contract index 28, construction epoch 212
18c82a3 to
3a5b78a
Compare
|
Fixed — was a typo in the new conflict-of-interest check ( |
|
Thanks for the update and explanation, contractend looks good to me so far. About the Oracle do plan to also provide the Oracle Machine part for this? https://github.com/qubic/oracle-machine Also please do not force push anymore now that we startet the review because all references of open review points get distroyed with a force push. |
|
Thanks @fnordspace! Good catch on the force-push — will only do regular commits from here on. On the Oracle Machine: yes, that's the natural next step. The AIVerify interface on the contract side is the easier half — the harder part is the oracle implementation that actually runs the inference deterministically across the 676 computors. Looking at the existing oracles ( I don't want to promise a full Realistically the first version would support only |
QAGENT: Decentralized AI Agent Infrastructure
Smart contract for on-chain AI agent task orchestration. Agents register with stake, accept tasks with escrow, submit results via commit-reveal, and earn reputation through successful completions. Disputes are resolved by arbitrator voting or escalated to the 676-computor oracle quorum via the AIVerify interface.
Task Lifecycle
Three-Tier Verification
Procedures (29)
Functions (9)
State Size
Key Features
Oracle Integration: AIVerify
New oracle interface at index 3. Allows QAGENT to request that the computor quorum independently verify an AI agent's claimed result against a task specification. Fields: taskId, specHash, resultHash, modelHash, taskType. Reply: verdict (valid/invalid/abstain), confidence, verifiedHash.
Tests
96 Google Test cases covering:
Verification
state.get()/state.mut()Files Changed (10)
src/contracts/QAGENT.hsrc/oracle_interfaces/AIVerify.htest/contract_qagent.cppsrc/contract_core/contract_def.hsrc/oracle_core/oracle_interfaces_def.htest/CMakeLists.txtsrc/Qubic.vcxprojsrc/Qubic.vcxproj.filterstest/test.vcxprojtest/test.vcxproj.filtersAll infrastructure file changes are pure additions (zero deletions).
Local Testnet
Unit tests cover all 29 procedures end-to-end (96/96 passing on MSVC x64). Local testnet testing with Core Lite pending (development machine is ARM-based, Core Lite requires x86 AVX2). Happy to test on x86 testnet infrastructure provided by the core team.
Construction Epoch
Set to 0 (placeholder). To be assigned by core team after proposal vote.