Intro to First Class Data (FCD)

First Class Data are data available directly on-chain, in Umbrella Chain smart contract. This data can be used by Layer1 applications - by smart contract directly.

At the moment of writing this documentation, Chain contract supports only numeric (uint256) FCD.

FCD are part of the consensus mechanism, that means they are verified by validators and once they are submitted to Chain, there is no need for any additional verification.

There is limited number of FCD, they are chosen based on validators configuration and usually they aim to be most popular, most wanted data... first class data :)

FCD, similar to Layer2 Data, are key->value pairs. In order to get the value you looking for, you need to know the key. FCD are stored with a timestamp, so L1 applications can access it and check if this FCD is up to date or not.

Only latest values

Chain Contract stores only latest values. That means when new consensus happens, values are overwritten.

🚧

FCD can be added and removed over time

Your contract should always check the timestamp of the selected FCD to ensure it's in your acceptable range.

  • Why can FCD be removed?

There are few reasons:

  1. If validators can't agree on a value during the consensus round, this particular key-value pair will not be included in this round of updates, and so the value for this particular key will not be updated (timestamp will be old / remain unchanged)
  2. This is configurable and configuration can change

That's why you should always check the timestamp for the FCD you are using and decide if data is fresh enough for your purpose.

FCD Keys

FCDs are configurable and can change over time. The full list of FCD keys can be retrieved from our API with the /keys/fcds endpoint.