Airnode
Airnode is a serverless oracle node implemented with a "set and forget" philosophy. Airnode is flexible in that it can move API provider data on-chain for multiple purposes. The most important of which are data feeds (dAPIs) and also in response to dApp direct requests for API provider data (RRP).
Airnode sources data to dAPIs
An Airnode supplies API provider data to beacons from API providers. These beacons are the underlying data source for data feeds known as dAPIs.
API providers, owners of first-party Airnodes, store data feed values on-chain as individual beacons that in are turn sourced by the Api3ServerV1.sol contract as dAPIs. Airnode has an internal mechanism that looks for a deviation in the value of API provider's API operations. This mechanism updates beacons on-chain as needed.
Airnode processes RRP requests
An Airnode is capable of serving the data from one or more APIs directly to requesters (which are on-chain smart contracts) that request data served by a particular Airnode. This is done using the request-response protocol (RRP) mechanism of Airnode. The AirnodeRrpV0 protocol is designed to be flexible and is meant to serve a variety of use cases. See the the Calling Airnode (RRP) for more details on how an RRP request is made. Also see the Airnode requester examples for potential design patterns.
mnemonic
Each and every Airnode has a unique mnemonic identifying its wallet. This mnemonic is kept secret and Airnode is publicly identified using the default address derived from the mnemonic.
airnodeAddress
An Airnode is identified by the default address of a BIP 44 wallet (with the path m/44'/60'/0'/0/0
) which is referred to as the airnodeAddress
. This address is same for all chains on which Airnode operates. The wallet mnemonic is specified in the secrets.env file when deploying the Airnode.
Use the admin CLI command derive-airnode-address to derive the airnodeAddress
from the mnemonic for informational purposes.
npx @api3/airnode-admin derive-airnode-address \
--airnode-mnemonic "cricket elephant ..."
# outputs
Airnode address: 0xaBd9...
2
3
4
5
xpub
The Airnode owner announces the extended public key (xpub
of the hardened derivation path m/44'/60'/0'
) off-chain. Then a sponsor derives a sponsor wallet for the Airnode using the xpub
and airnodeAddress
. The sponsor wallet will then be used by the Airnode to fulfill requests made by the sponsor's contracts.
Use the admin CLI command derive-airnode-xpub to get the xpub
of an Airnode by passing the same mnemonic used to create the airnodeAddress
.
npx @api3/airnode-admin derive-airnode-xpub \
--airnode-mnemonic "cricket elephant ..."
# outputs
Airnode xpub: xpub6CUGRUo...
2
3
4
5
Admin CLI: generate-airnode-mnemonic
The generate-airnode-mnemonic command is useful because it will generate a mnemonic as well as return the airnodeAddress
and xpub
.
npx @api3/airnode-admin generate-airnode-mnemonic
# output
This mnemonic is created locally on your machine using "ethers.Wallet.createRandom" under the hood.
Make sure to back it up securely, e.g., by writing it down on a piece of paper:
############################## MNEMONIC ###############################
cricket elephant ...
############################## MNEMONIC ###############################
The Airnode address for this mnemonic is: 0xaBd9...
The Airnode xpub for this mnemonic is: xpub6CUGRUo...
2
3
4
5
6
7
8
9
10
11
12
13
14
Verification
The xpub
that the Airnode owner has announced is not verified on-chain. A sponsor can verify the xpub
off-chain. Use the admin CLI command verify-xpub command from the admin CLI.
npx @api3/airnode-admin verify-airnode-xpub \
--airnode-xpub xpub6CUGRUo... \
--airnode-address 0xaBd9...
# output
Airnode xpub is: VALID
2
3
4
5
6