Autonomous Agents

An Autonomous Agent (AA) is a special address (account) on the ledger that acts according to a program associated with it. Its behavior is similar to that of a vending machine that receives coins and data entered on a keypad and in response, releases a cup of coffee, plays a song, or does whatever it was programmed to do.
Introduction to Autonomous Agents (announcement post on Medium)

Oscript — the language of autonomous agents

Autonomous Agents are written in Oscript — a new programming language developed specifically for this purpose. The language is very simple and any developer who has experience in curly-brace languages such as JavaScript, PHP, Java, C/C++, etc should not have any difficulty learning it.
Some of the features of the language:
  • convenient access to variables that describe the state of the ledger and the triggering (requesting, activating) transaction received. That’s what makes the language domain-specific. In particular, the following variables are available:
  • amounts received in the triggering transaction;
  • data received in the triggering transaction;
  • who sent the triggering transaction;
  • state variables of the current and other AAs;
  • data feeds;
  • attestations;
  • balances of this and other AAs;
  • information about assets;
  • arithmetic operations;
  • logical operations (AND, OR, etc);
  • comparisons;
  • concatenations;
  • some math functions;
  • some cryptography functions for calculating hashes and validating signatures created off-chain;
  • branching with if/else;
  • no loops (just iteration methods for objects and arrays);
  • no recursive functions;
  • scalar and object data types;
  • generation of deterministic pseudo-random number from seed.
AA code can be deployed with Oscript (mainnet) editor and Oscript (testnet) editor. There is also a extension for VS Code and Autonomous Agent testkit.