- What is an UBot?
- How does it work?
Possible use cases and scenarios
- Trading bot
- Games with prizes
- Web applications and services
- The personal wallet with web interface
- Chat bots for Universa chat service
- Booking resources and tickets
- Surveillance and evidence collection
- Voting and elections
- Shares, shareholders, meetings and so on
- Smart home, city, organization
- Distributed computations
- Distributed random sequences (DRNG – decentralized random number generator)
- Distributed sample: image recognition
What is an UBot?
Generally, an UBot can provide:
- functional interface: methods that could be called from clients using UMI-style interface from uniclient, libraries, or directly, using UMI-like protocol.
- time-based events, also periodic.
- networking I/O (for example, UBot can expose itself as HTTP service).
The UBots have some unique features provided by the tight integration with the main Universa network:
shared cloud storage. A smart contract can store contract-specific data, that will shortly be available on any UBot server, without collisions and race conditions.
consensus-based results. Any method could be marked as requiring consensus of some number of “ubot workers”. Any results and shared storage changes will therefore executed in parallel by many ubot servers, and could be rejected unless the required consensus is found. In this scenario, finding a consensus assumes that the required number of servers/workers arrived to the same result.
special shared data streams allowing parallelly executing instances to accumulate results. This approach, for example, allows ubots to generate secure distributed random number sequences, perform parallel calculations and so on.
special Universa-specific features, permissions and roles representing consensus of UBot worker instances. For example, it is possible to put some UTN tokens to the disposal of the ubot but require consensus of 30+ instances to perform any changes on it (e.g. to perform payments). In other words, the consensus of ubot instances can sign Universa contracts, and some Universa contracts can require such a signature to be present.
How does it work?
The number of UBot servers is expected to be much more than the number of Nodes, as UBots usually perform slow and asynchronous operations (including waiting for network operations/IO, running calculations and much more). UBot servers run ubots and take a fee (directly in UTN!) for that; the amount of the fee depends on multiple factors, such as how long the UBot runs, how much shared storage is used and modified, and some other factors of this kind. Unlike the Universa network, an UBot server only gets paid for ubots it runs itself.
The UBot network is self-configured and backed by the Universa Mainnet, which accumulates information about currenly available UBot servers. Similarly to the Mainnet, the UBot network is 1-tier (all the nodes are equal) too, it self-configures as new servers join the network, existing servers shut down and get back online. The Ubot network randomly spreads ubots execution over the available servers, to balance the load and improve the response time.
Users can request the ubot execution on any specific ubot server they wish (if they really wish to run it on a specific server rather than the random-selected one), but most likely the execution will require consensus; in this case the initial ubot server will randomly select some other ubot servers to perform the requested operations. Also, the internal requirements can even explicitly prohibit launching some UBot on a non-random UBot server.
Also, the network requests and time events are executed on random UBot server using special load balancing algorithms backed by the Universa network.
Possible use cases and scenarios
Periodically checks rates on stock exchanges using the network interface and stock exchange APIs. Depending on it, it automatically trades tokens available in the portfolio. To get safe access to the token assets, it uses the consensual permission. Can also access external components like dedicated personal botserver that has access to private data to use external wallets and trading accounts to protect their credentials.
Could be implemented as web service or a web site. All operation except the purchase could be performed fast without requiring any consensus, so the catalog, search, basket, preparing the order could be as fast as with a regular website; while any purchase could completely be made inside the ubot using Universa payments, or calling external payment and delivery providers (which could also be implemented as ubots).
Uses a network-connected camera (with face-recognition software), QR-code (or similar visual codes) reader, NFC-reader or contract reader (for example, USB socket to use USB thumb drive as a pass) to check and redeem ticket contract and operate some physical turnstile or barrier.
Games with prizes
Ubot is capable to run turn-based games and provide fair and trustworthy prize awarging logic. Board games, card games, turn-based online strategies fit perfectly well into ubot capabilities. For real-time virtual world games, ubots still can be used to implement trusted game economics, transactions, contests and awards. And don’t forget the “cryptokitten”-style games, their (typically rather primitive) game logic can be implemented as easy as a school project.
Could be implemented with very high level of trust by using the distributely generated random sequence to select a winner that excludes any fraud possibility. See below for secure decentralized network-generated random numbers.
Ubots can accept bets on any events, that could be programmatically checked using the network interfaces/APIs (do you want to bet on the outcome of the FIFA match of F1 race? or even if whether it will be raining tomorrow? Just find a service providing this information through the public API!) The consensus-based processing protects users from possible fraud.
Web applications and services
The personal wallet with web interface
Safely stores all the assets encrypted in the shared cloud storage, in user-encrypted form. Never lose any data anymore: sort of an improved and decentralized Crypto Cloud. Could also permit periodic payments, auto-accept and process incoming payments and so on. Also, could be used as a heavily protected/secure notebook, diary and file storage. Such an encrypted storage is planned to be much cheaper than SLOT1 store in the Universa Mainnet.
Chat bots for Universa chat service
UBots will have simple and convenient access to the Universa chat (Unichat) service.
Booking resources and tickets
Step ahead for ticket reservation. Using smart contracts for initial ticket pool guarantees no overbooking can ever happen; and there is no need in separate registration (confirmation) step like in the airports. The ubot could easily generate, sell, exchange and refund tickets making them immediately available for sale.
Surveillance and evidence collection
The ubot can collect information and safely store it, having it always approved by the Universa network. It is rather hard to remove any information that was ever inserted in the shared storage, and just impossible to tamper.
Voting and elections
Extremely easy to implement with Universa smart contracts as votes, and even using some KYC service to authenticate person in offline.
Shares, shareholders, meetings and so on
Could also be implemented using ubots with ease. Can even provide the web interfaces open new page in business automation and enterprise management as SaaS.
Smart home, city, organization
Collecting data from resource consumption meters, consumption planning and forecasting, buying resources. Everything from electricity and water to raw materials and components.
Could be made exceptionally easy with the ubot network (think: AWS Lambda over Universa network, paid with UTNs!). Also, ubots will have “idle priority”: low-performance and cheap execution mode to handle the background processes.
Distributed random sequences (DRNG – decentralized random number generator)
Many ubots (running together) form a long pseudo-random (or random) sequence, where each ubot instance add its part of entropy and checks that it was actually used in the final random number. Special two-pass algorithm (already designed, TBA) prevents any possibility of fraud, even if any ubot server owners have an interest in some particular results of DRNG (e.g. it is used for a lottery) – they still won’t be able to tweak their input to the DRNG to affect the final result.
Distributed sample: image recognition
Suppose there is a camera that takes shots in real time and we want to detect in real time whether there are people from a very long list. Say, we want to distinguish hotel guests from visitors in the hotel elevator for security reasons. We can order each instance of ubots to check some few faces from a list, and run as many instances as we need in parallel getting real-time recognition.