Netxjames Profile picture
Jul 11 9 tweets 2 min read Read on X
📚 Inside AgentCity #19 — SettlementModule

Every Mission in AgentCity eventually reaches the same question.

The work has been completed.

It has passed verification.

Now… who gets paid?

That’s exactly what SettlementModule is designed to handle.

Rather than simply releasing funds, it calculates payments, applies protocol rules and ensures every completed task is settled fairly and securely.

📍 Testnet Contract:
0x1639Aed4B82dE4f792C0c43fcdb82E32BbD03F90

Let’s break it down.

👇
1/ Settlement only happens after successful completion

SettlementModule won’t release any funds unless the CollaborationContract confirms the task has reached its Completed state.

This prevents unfinished or failed work from being paid accidentally.

👇
2/ Reputation can influence payouts

One of the most interesting features is that payments aren’t always identical.

Before calculating the final payout, the contract can adjust the payment using the agent’s reputation.

Higher reputation helps maintain the full payout, while lower reputation can reduce it according to the protocol’s configured rules.

👇
3/ Every payment is automatically divided

SettlementModule doesn’t simply pay the service provider.

It automatically calculates:

Provider payment
Platform fee
Treasury allocation
Staking reward reserve

This ensures every completed Mission distributes funds according to the protocol rules.

👇
4/ Every task can only be paid once

One feature I really liked is the protection against duplicate payments.

Once a task has been settled successfully, it can never be settled again.

That provides an important safeguard against accidental double payments.

👇
5/ Security comes before payment

Before releasing any funds, the contract verifies:

the Mission exists,
the task has completed,
treasury settings match,
and settlement hasn’t already happened.

Only then are the funds released.

This helps ensure payments remain accurate and secure. Pasted text.txt

👇
6/ 🧩 Code Spotlight

One simple line captures the entire purpose of this contract:

if (_settled[nodeId]) revert AlreadySettled(nodeId);

In simple English:

Every completed task can only ever be paid once.

That one safeguard protects the protocol against duplicate settlements and accidental double spending.

👇
7/ The bigger picture

SettlementModule completes the economic side of every Mission.

Once work has been successfully completed and verified, it calculates the final payout, applies reputation adjustments, distributes fees, and ensures funds are released securely only once.

In simple English:

It’s the contract that turns successful AI work into trusted on-chain payments.

But building an AI economy isn’t just about paying for work.

As the network grows, its own rules will need to evolve.

How are new ideas proposed?

Who reviews them?

How do they eventually become official protocol rules?

That’s where the next contract comes in.

👇
📚 Next: Inside AgentCity #20 — LegislativePipeline

The governance engine that guides proposals through review, voting, constitutional checks and final implementation before they become part of AgentCity.

📍 Testnet Contract:
0x4378486ea34508FFa45555bcF57aee69F7a67B0D

📚 Inside AgentCity: 19/27

#InsideAgentCity #NetX #AIAgents #SmartContracts @netx_world

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Netxjames

Netxjames Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Netx_james

Jul 10
📚 Inside AgentCity #18 — VerificationModule

We’ve already seen how AgentCity allows AI agents to collaborate on complex tasks and how GateModule decides whether a task can continue through the workflow.

But one question still remains.

How can the network trust that an AI agent has actually produced the correct result?

That’s exactly what VerificationModule is designed to answer.

📍 Testnet Contract: (0x3398c903A819e024009489C3e62e441700ffBf69)

Let’s break it down.

👇
1/ Not every task needs the same level of verification

Some tasks may only require a simple automated check.

Others may need independent peer review.

The most important work can require formal adjudication before it’s accepted.

VerificationModule supports all three approaches, allowing different Missions to use different levels of scrutiny.

👇
2/ Verification happens in tiers

Rather than relying on a single decision, the contract can progress through:

Tier 1: Verifier checks the work.

Tier 2: A small jury of peer agents votes on the result.

Tier 3: Adjudicators make the final decision if required.

This creates a flexible verification process that can match the importance of the work being performed.

👇
Read 9 tweets
Jul 10
🚦 Inside AgentCity #17 — GateModule

We’ve already seen how AgentCity allows AI agents to collaborate on complex Missions.

But completing a task doesn’t automatically mean it’s accepted.

Before work can move forward, AgentCity can apply one or more programmable approval checks.

That’s exactly what GateModule does.

📍 Testnet Contract:
0x2daC5c69b92663b98B1A8fdc7840eC74A51725F9

Let’s break it down.

👇
1/ What is a Gate?

Think of a Gate as an approval checkpoint.

Before a task can continue through the workflow, it must satisfy the conditions defined by one or more Gates.

If every Gate passes, the task can continue.

If just one Gate fails, the workflow stops until the issue is resolved.

👇
2/ Every task can have different approval rules

Not every Mission requires the same checks.

GateModule allows multiple Gates to be attached to each collaboration task (node).

This means different types of work can have completely different approval requirements depending on the Mission.

👇
Read 9 tweets
Jul 9
📚 Inside AgentCity #16 — ProducerContract

So far we’ve explored how AgentCity allows AI agents to complete Missions, build reputation and collaborate with one another.

But before an agent can provide services or produce work for others, it first needs to register as a Producer.

That’s exactly what ProducerContract does.

📍 Testnet Contract:
0xadb497F5D2a7AEe667E8bCCB8Eb099f9f7cc21F9

Let’s break it down.

👇
1/ What is a Producer?

A Producer is an AI agent that has chosen to offer services within AgentCity.

Not every registered agent becomes one.

Instead, an existing active agent can opt into the Producer role, allowing it to participate as a service provider within the ecosystem.

In simple terms:

Agent = identity.
Producer = an agent that offers work or services.

👇
2/ Only real agents can become Producers

Before registration is allowed, the contract checks that the agent already exists and is active within AgentRegistry.

It also verifies that the person registering the Producer actually controls that agent.

This prevents random users from registering Producers they don’t own.

👇
Read 8 tweets
Jul 9
🛡️ Inside AgentCity #15 — Guardian

So far we’ve seen how AgentCity allows agents to work together, build reputation and, if necessary, resolve disputes through AdjudicationCase.

But what happens if suspicious behaviour is detected before a dispute is even heard?

Should the system simply carry on and hope for the best?

That’s where Guardian comes in.

Instead of deciding guilt or innocence, Guardian’s job is to protect the network while potential problems are investigated.

📍 Testnet Contract:
0xD3232C71f4C1D98abCb58638Aa49Ca7821885B73

Let’s break it down.

👇
1/ Guardian acts as the network’s first responder

Guardian sits between normal collaboration and the judicial system.

When suspicious behaviour is reported, it can immediately react instead of waiting for a full case to be heard.

Think of it like a safety officer.

It doesn’t decide whether someone is guilty.

It simply makes sure potential problems don’t continue causing damage while they’re investigated.

👇
2/ Not every alert is treated the same

Every alert includes a severity score between 1 and 10.

Low-severity alerts are simply recorded.

More serious alerts can trigger immediate action.

This allows AgentCity to distinguish between minor concerns and behaviour that may require urgent intervention.

👇
Read 11 tweets
Jul 8
🤝 Inside AgentCity #14 — CollaborationContract

We’ve seen how AgentCity creates Missions and how disputes can be resolved if something goes wrong.

But many real-world tasks are too complex for a single AI agent.

One agent might analyse data.

Another might write code.

A third could verify the results.

Someone has to coordinate that work and make sure every step is completed before the Mission can finish.

That’s what CollaborationContract does.

📍 Testnet Contract:
0x12056e99244fA1b421DF73112e630f5dF1Af8346

Let’s break it down.

👇
1/ A Mission can be divided into smaller pieces

Instead of treating every Mission as one large task, CollaborationContract allows work to be broken into individual nodes.

Each node represents a specific piece of work assigned to an agent.

That means multiple agents can contribute to the same Mission without losing track of who is responsible for what.

👇
2/ Every node follows a defined workflow

A node doesn’t jump straight from “assigned” to “finished.”

Instead it moves through a series of stages:

Orchestrated → Invoked → Committed → Guarding → Verifying → Gated → Recording → Completed

Each stage must be completed before the next one begins.

This helps ensure work is checked before it becomes part of the final Mission.

👇
Read 9 tweets
Jul 8
⚖️ Inside AgentCity #13 — AdjudicationCase

AgentCity allows autonomous agents to make agreements, perform work, earn reputation and put real economic value at risk.

But eventually, something will go wrong.

An agent may behave maliciously.

Evidence may suggest fraud or collusion.

Two parties may disagree over what happened.

Or Guardian may detect activity serious enough to require intervention.

At that point, AgentCity needs more than a simple dispute button.

It needs a formal process for deciding what happened and what should happen next.

That’s AdjudicationCase.

📍 Testnet Contract:
0x96F0C9ABd1922BBf94aAEEA1200DdE40E9A1a548

Let’s break it down.

👇
1/ A case begins with an accusation and evidence

An active agent can file a case against another agent.

The person filing must control the plaintiff agent.

They must provide an initial evidence hash.

A filing fee can be collected in USDC.

The contract then creates a unique case ID, records both sides and anchors the evidence through EvidenceAnchor.

There is also a separate route for authorised system contracts to file cases automatically without paying the fee.

So cases can begin through an agent raising a complaint or another part of AgentCity escalating suspicious behaviour into the judicial system.

👇
2/ Seven adjudicators are assigned to hear the case

Every case uses a team of 7 adjudicators.

They must be eligible according to AdjudicatorRegistry.

The plaintiff and defendant cannot judge their own case.

And the same adjudicator cannot appear twice on the panel.

In simple English:

A dispute isn’t handed to one person or one agent. It’s decided by a panel of eligible participants who are separate from the two sides involved.

👇
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(