Data Types

Data types describe a space of possible values through the specification of constraints

What are data types?

Data types describe a space of possible valid values. For instance, the string value foo might be an instance of a Text data type, or a float value of 0.6 might be an instance of a Number data type.

Data types describe their possible values by specifying constraints. For an instance of a value to be valid, it must satisfy the constraints expressed on the associated data type.

Data types consist of the following:

  • a required url, which is a globally unique identifier, where the data type’s definition can be accessed (in most cases this will be a URL)
  • a required name, which should generally be a non-pluralized short description of the data type (for example: “Number” not “Numbers”)
  • optionally a description to further explain the semantic meaning of the data type
  • a required definition of its possible value

Top-level data types in HASH

The Block Protocol specifies a set of primitive top-level data types, which we use in HASH.

These can be considered the least restrictive value spaces:

  • Text
  • Number
  • Boolean
  • Null
  • Object

Create a free account

Sign up to try HASH out for yourself, and see what all the fuss is about

By signing up you agree to our terms and conditions and privacy policy