Midge · on NEAR

A network of private rooms
with public rules

Funds, DAOs, teams and AI agents decide together in private. Their money follows rules that everyone can see and the room cannot change. If anything goes wrong, each member takes their own share back.

A working prototype on NEAR testnet · no token Reading the contract…

The problem

Deciding together with money on the line is hard

A group can bid in public, trust an organizer, or trust a black box. Each one breaks something.

A · Do it in public

example amounts

public bid bookvisible to everyone
Member A1,250visible
Member B900visible
Member C1,100visible
Watcher1,260last second

The watcher wins the lot by bidding just above

Everyone sees your bid before it lands, and trades against you

3 of 5

bids an observer read in our public auction

0 of 5

with Midge sealed bids, same run

B · Trust an organizer

Backer 1 0.01Backer 2 0.02Backer 3 0.03Backer 4 0.04 The organizerholds 0.10 its pick Backer 1 0.01Backer 2 0.02Backer 3 0.03Backer 4 0.04 The organizerholds 0.10 its pick

One person holds the money. If they vanish or get hacked, it is gone

4 of 4 amounts read through the organizer0% recovered by members if it disappears

C · Trust a black box

the pot Secure hardwaresigns any payout a member a thief the pot Secure hardwaresigns any payout a member a thief

Private, but if it can pay anything, one bug empties the pot

Secure hardware has had real attacks. Midge assumes it can fail, and limits what a failure can pay.

Measured on testnet, same chain, fresh accountsdocs/lab/COMPARISON_*.md
PublicOrganizerMidgeBids or amounts an observer read3 of 54 of 40 of 5Who can move the potno pot: each pays directlythe organizer, aloneno one outside the rulesIf the operator disappearsnot applicablemembers recover 0%each member leaves alone

What Midge keeps

  • Private like the black box
  • Rules anyone can read, like public
  • An exit no organizer gives you
See how it works

How it works

Four parts, each checking the one before

The room

Members seal their bids. Only the room can open them.

It weighs every bid or vote in secure hardware and proposes one payout. It holds no key to the money.

The rules

Set when the group starts and stored on NEAR, where anyone can read them: who may be paid, how much per round, until when. The contract has no method to change them.

The payout

Paid only if it fits the rules. Anything else is refused and nothing moves.

The exit

If the room stops, each member takes their own share back.

Who uses it

For groups that decide together with money on the line

Auctions and token sales

Sealed bids; losing bids never published

Voting

Sealed ballots; only the result is paid

Paying people

One-time addresses; owners stay private

Investing together

Equal deposits hide who put in how much

AI agents

A key that can only take money back

Each has run on testnet next to a public version. See them in the proof

view · the newest groupnot read yet
Not read yet. This page reads them from NEAR when its script runs.

Reads as not read yet

The rules

Read a group's rules straight from NEAR

No server of ours in between. The room can only propose; the contract decides.

Open the contract

AI agents

A hijacked AI agent still can't take the money

An agent can hold a key that does one thing: take its owner's money back. We tricked one into trying everything. Every attempt was refused.

Attempt 1 of 9

Send money to the attacker

Refused by the key · the chain said: Access key requires full access

Attempt 2 of 9

Call another contract

Refused by the key · the chain said: Access key receiver c.fly-1793636729.testnet does not match transaction receiver

Attempt 3 of 9

Approve a payout itself

Refused by the key

Attempt 5 of 9

Make the attacker an owner

Refused by the key · the chain said: Access key requires full access

9

agent attempts recorded on testnet

9

refused

0

got through

The key limits what a fooled agent can do; it does not stop the agent from being fooled.

Proof

520 transactions
Not one paid outside the rules

Every dot is a real transaction

520 transactions · 80 test runs · NEAR testnet

Money in · 99Group created · 54Payout · 166Member left with their share · 36Refused by the rules · 81Other · 84
Skip the 520 transaction links

What anyone can see Point at a dot, or move through them with Tab. Each one opens on NearBlocks.

What stayed private Bids, votes, and who each one-time address belongs to

Attacks that NEAR stopped before they even ran never became transactions, so they are not dots here; the AI agents section shows them.

Read the contract yourself

not read yet

Straight from NEAR, with no server of ours in between.

    Check the AI's secure hardware

    Your browser asks NEAR AI Cloud to prove what it is running, using a random number it picks, and checks the answer.

      A recorded refusal

      A payout to an account that was not on the list

      The contract refused it before anything else, and no money moved. Open it on NearBlocks.

      payout call · group lab-mw30klm2-2run 20261105T035644Z-7c1d
      CheckThe payout askedThe rules allow Recipientthief-mw30klm2.testnetlisted accounts only Money moved0 NEARnothing outside the rules

      Refused · the recipient is not on the group’s list3gW41Caz…RB1CmPk on NearBlocks

      What runs where, today

      Testnet only · no audit yet · every test account was ours

      • NEAR Protocol

        Live

        the contract · testnet · 15 groups (recorded)Holds every group’s money and rules, pays only within them, and runs the exit.

      • NEAR AI Cloud

        Live

        Bids are sealed to a model in secure hardware; it proposes the split. Check it above.

      • Phala Cloud

        Deployed, sleeps when idle

        The room as its own program in a confidential VM. It runs the playground and sleeps when idle; last attested on 14 Nov.

      • NEAR Chain Signatures

        Rules checked, on testnet

        The contract checked a group’s rules and had payments signed on Solana devnet and Ethereum Sepolia; it refused three that broke the rules. Money on other chains is outside the member exit.

      • NEAR Intents · 1Click

        Read-only

        210 assets read live across NEAR, Bitcoin, Ethereum and Solana. No testnet, so no swap was made.

      • For agents

        Runs on your machine

        Every route, SDK method and MCP tool exercised locally. The limited keys that can only take money back are live on testnet.

      • Simulations

        Not on chain

        Lending quotes, block trades and shared AI requests run as models, not on the contract.

      What it cannot do

      The room cannot take the money. Only the rules can pay.

      It cannot take the money

      The room only proposes. Only the contract pays, and only within the rules every member agreed to.

      81 refused by the rules on testnet

      It cannot pay outside the rules

      An unlisted account or a payout over the cap is refused, and nothing moves.

      Recipient and cap checked in the contract

      It cannot lock anyone in

      If the room stops, every member takes their own share back after the exit timer.

      36 exits recorded

      One honest limit: on testnet our deploy key can still upgrade the contract, so the rules are only as fixed as that key. It is removed before mainnet (gap GAP-044).

      Try it

      Three ways in

      Approve a live pay run

      On NEAR testnet, with your own key. A model on NEAR AI Cloud reviews it, the room in secure hardware signs it, and you check your payslip.

      Open the playground

      Check everything, offline

      One command runs every test and check. No keys, no money.

      git clone https://github.com/etvjay/midge && cd midge npm install && npm run verify

      Or replay the recorded runs

      Look at the live network

      The newest groups, read from NEAR by your browser:

      • Not read yet