Skip to Content
How money moves

Accounts without gas

Sign in with email for a named NEAR account holding only dollars, or bring your own NEAR wallet; either way Tegata relays every action and pays its fee, exactly once.

The account

  1. You sign in with your email (Privy). Your login holds an ed25519 key; nobody sees a wallet.
  2. Tegata's operator (tegata.testnet; tegata.near once Live is built) creates your-name.tegata.testnet with your key as its only full-access key.
  3. The operator registers it on USDC (a 0.00125 NEAR storage deposit, paid by Tegata in its own transaction).

Your account holds dollars and no NEAR.

Every action

  1. The server drafts the action list from its own records (for example, one USDC ft_transfer with 1 yoctoNEAR attached).
  2. Your browser re-encodes the draft, checks it matches what you're approving, and your key signs it as a NEP-366 delegate action.
  3. The server checks the signature over exactly the bytes it drafted, and that the sender is your account.
  4. The worker wraps it in an operator transaction, pays the fee and the yoctoNEAR, and sends it.

The relayer only sponsors action lists the server drafted itself. A signed action is valid for 120 blocks (a little over a minute on testnet today). Each person can have 30 sponsored actions an hour and 200 a day.

Or your own NEAR wallet

On the sign-in page, Continue with a NEAR wallet opens NEAR Connect with the wallets that can do both things Tegata needs (on testnet: Meteor, Intear, Ledger and NEAR CLI).

  1. Sign in. The server hands out a one-time 32-byte nonce. The wallet signs "Sign in to Tegata" with it (NEP-413), in the same prompt that connects it. The server checks the signature and that the key has full access to the account, spends the nonce so it can't be used twice, and starts a session (an httpOnly cookie, signed by the server).
  2. Your account stays yours. Nothing is created: your wallet's account (abu.testnet) is your pay address. Tegata's operator registers it on USDC if it can't hold dollars yet.
  3. Approving. The same draft as above goes to the wallet, which signs it as a NEP-366 delegate action with its own nonce, expiry and key (signDelegateActions). Several drafts are one prompt. The server takes the wallet's answer only if, apart from those three, it is byte for byte the delegate it drafted, signed by a full-access key. Then the relay is the same: Tegata pays the fee.

Wallet accounts live on one network: a testnet account uses the Sandbox. A Tegata account (name.tegata.testnet) can't sign in through a wallet; only its email can.

Proved on testnet

A real tegata-wallet-dacd0228.testnet signed in with its own key (the same signature sent twice was refused), opened a business with that account as its pay address, and sent $0.05 with a delegate action it signed itself, relayed by Tegata: 8PWgsY…FnXRo7. A delegate for a different receiver was refused, and the wallet's NEAR balance didn't change. packages/services/src/proofs/wallet.ts plays the wallet.

Exactly once

The worker saves the signed transaction's bytes and hash before sending it. After a crash it never signs again: it re-sends the same bytes and reads the result by hash, so an action lands once and only once. packages/services/src/proofs/recover.ts proves this by stopping before and after sending; both land once, with the same hash.

PieceCode
Accounts, USDC registrationpackages/core/src/near/accounts.ts, operator.ts
Drafting and checking delegate actionspackages/core/src/near/delegate.ts
Wallet sign-in (NEP-413) and wallet-signed delegatespackages/core/src/near/wallet.ts, packages/services/src/wallet-auth.ts, apps/web/lib/client/near-account.ts
Relays: draft, signature, sendpackages/services/src/relays.ts, apps/worker

Measured

An account holding 0 NEAR moved a token (0.001 wNEAR on wrap.testnet) while the operator paid 0.00029 NEAR in fees: 8oDoAf…zp9Bxk. A USDC send from the app cost the operator 0.00033 NEAR: 4a5U9o…jqH6TX.

On this page