How it works
Everything runs through one smart contract, the vault, on NEAR.
The vault
The vault holds the USDT behind every credit. 1 USDT buys 100 credits, so 1 credit is $0.01. It also keeps every balance, every spending limit and every app's earnings. The reserves page shows live that it holds enough USDT to cover them all.
Users
Users sign in with an email code. A NEAR wallet is made for them, and only they can sign with it. They never need gas, a seed phrase or a crypto app: each action they sign is a NEAR meta transaction, and the network pays for it.
Spending limits
Before you can charge a user, they approve a limit for your app, such as 200 credits. The vault enforces it:
- You can never charge more than the limit, and only that user's credits.
- The same charge can't go through twice.
- The user can lower or remove the limit any time in their account.
Our own servers can't charge at all. Only your app's key can, and only up to the limit.
Your app's key
Your app has its own NEAR account, with one key that can only charge, hold, capture, release and refund on the vault. Charges must come from that account, so a leak, a bug or Kredo itself can't charge your users. Your payout account controls which account signs for your app. See who signs a charge.
Charges and holds
A charge takes credits right away. Use it for quick things: a message, an image, an API call.
A hold reserves credits for a long job. When it's done, you charge what it actually cost and the rest goes back. If it fails, the user keeps everything.
Storage
On NEAR, data costs a small deposit of NEAR. The vault follows NEP-145: an account is registered with a storage deposit before it holds anything, and each write is paid from the storage balance of whoever caused it. The network registers users for you, and funds your app's signer once when you register. A deposit to an account nobody registered is sent back in full.
Fees and gas
The network keeps 5% of each charge. That pays the gas for every transaction, yours and your users', so nobody else pays any. You withdraw the other 95% in USDT.
Your own credits
Already have your own credits? Keep them. Set an exchange rate, such as 2 of ours for 1 of yours, and users can buy yours with ours.