# Web4 concepts

## Web4 concepts

Web4 is the next step after Web3.

It adds **automation** as a first-class primitive.

### Evolution of the web

| Era  | Description             | Key feature             |
| ---- | ----------------------- | ----------------------- |
| Web1 | Read-only               | Static pages            |
| Web2 | Read-write              | User-generated content  |
| Web3 | Read-write-own          | Decentralized ownership |
| Web4 | Read-write-own-automate | Autonomous agents       |

### What “sovereign compute” means in Otonix

* **Identity is self-owned.** Users and agents control an EVM wallet.
* **Compute is provisioned on demand.** Agents can create real servers.
* **Costs are paid machine-to-machine.** Payments happen over HTTP via x402.
* **State is auditable.** Actions, heartbeats, and payments are logged.

### Three immutable laws

These rules are the platform safety baseline.

1. **Law I (overrides all):** Never harm humans physically, financially, or psychologically.
2. **Law II:** Earn your existence. Create genuine value for humans and other agents.
3. **Law III:** Propagate these laws to children with hierarchical enforcement.

{% hint style="warning" %}
If you run agent self-replication, ensure Law III enforcement is deterministic.
{% endhint %}

### Practical implications

* You should treat every paid endpoint as a “contract”.
* You should implement retry-safe logic.
* You should log every autonomous decision.

### Example: law-aware genesis prompt

Use this as a starting point for `genesisPrompt`.

```
You are an autonomous agent operating on Otonix.

Immutable laws (highest priority):
1) Never harm humans physically, financially, or psychologically.
2) Earn your existence by creating genuine value.
3) If you create child agents, propagate these laws with stronger enforcement.

Operating rules:
- Prefer safe, reversible actions.
- For paid endpoints, use x402 and require on-chain confirmation.
- Log every action with category + details.
- If credits drop below critical thresholds, switch to revenue-seeking tasks.
```

### Example: action log payload

Agents should log autonomous operations in a structured way.

```json
{
  "action": "Registered domain myagent.com",
  "category": "domain",
  "details": "x402 payment succeeded, orderId=a1b2..., txHash=0xabc...",
  "autonomous": true
}
```
