What is dotx3?
dotx3 is the public front door for the language, tools and evidence. A .x3 file is the program you write.
Payment intent
Check, then authorize
Quickstart
Run these commands from a checkout of the X3Lang repository, not the dotx3 website. The local policy demo needs no wallet or API key and signs nothing. The bootcamp explains the language in depth.
Install
git clone https://github.com/Cyptopimpinainteazy/x3lang.git
cd x3lang
python3 -m venv .venv && . .venv/bin/activate
pip install -r x3-lang/requirements.txt pytestHash the trade program, then run the suite
sha256sum x3-lang/examples/base_sepolia_to_near_testnet_1usdc.x3
python3 x3-lang/cli.py x3-lang/examples/arb_solana_eth.x3
PYTHONPATH=x3-lang python3 -m pytest x3-lang/tests -qRun the current tests and retain the commit hash with the result. Contract checks are separate: cd x3-lang/near/x3-guard && cargo test --locked. Historical test counts are not proof for your checkout.
Syntax
Owner mandate
mandate x3_shopping_agent {
owner x3-owner.near
agent x3-agent.near
spend Solana.USDC
per_payment 50000000
per_24h 200000000
allow recipients x3-demo.near
allow assets Near.USDC
refund_to 4Nd1mzi8Y1QYxJt9wZWBYZpG7S4pYkZs6YzD3Vt9aBcD
require slippage <= 1%
require fees <= 100 bps
approve above 30000000 by 1 of x3-owner.near
expires 30d
}Agent payment under the owner mandate
// near_intents_agent_payment.x3 — an AI agent's payment, under its owner's mandate.
//
// The same NEAR Intents swap as `near_intents_sol_to_near.x3`, with one more clause:
// `under mandate x3-owner.near`. The agent account registers and accepts it through
// x3-guard's agent methods, which check `near_mandate_agent.x3`'s terms on chain first:
//
// near_intents.py mandate check near_mandate_agent.x3 near_intents_agent_payment.x3
// near_intents.py quote near_intents_agent_payment.x3 --live --mandate near_mandate_agent.x3 \
// --guard-contract <x3-guard account>
//
// 25 USDC is under the mandate's 30 USDC approval threshold, so no approval is needed.
intent near_intents_agent_payment {
from Solana.USDC amount 25000000 receiver 4Nd1mzi8Y1QYxJt9wZWBYZpG7S4pYkZs6YzD3Vt9aBcD
to Near.USDC receiver x3-demo.near
route {
bridge NearIntents Solana.USDC -> Near.USDC min_receive 24800000;
}
under mandate x3-owner.near
require slippage <= 0.5%
require fees <= 100 bps
require nonce unused agent_payment_001
timeout 10m refund Solana.USDC
on_fail rollback
}
The program behind the testnet trade
intent x3_testnet_base_usdc_to_near {
from BaseSepolia.USDC amount 1000000 receiver 0x5aF0c1BF95B3A158f6Fc48e3DED35903b2fa0721
to Near.USDC receiver x3lang.testnet
route {
bridge NearIntents BaseSepolia.USDC -> Near.USDC min_receive 980000;
}
require slippage <= 1%
require nonce unused x3_base_testnet_trade_001
timeout 30m refund BaseSepolia.USDC to 0x5aF0c1BF95B3A158f6Fc48e3DED35903b2fa0721
on_fail rollback
}Read the amounts and limits
Integer token units
Explicit permission
A bounded request
Compiler and execution
What compiles today
What runs on NEAR
What does not run on a block
LimitThis installation guide uses source. Check the current release artifacts separately. Programming notes live in the repo under docs/x3-lang. Judge steps: docs/hackathon.