Skip to content

Default definitions

Default definitions are definitions included in IDX libraries by default. Their aliases can automatically be used to read records and write records without any additional configuration.

You do not need to add default definitions to your project's aliases object.

Basic Profile

The basic profile definition specifies a record which stores a general-purpose, universal profile for a DID. Interact with this record using the basicProfile alias.

{
  name: 'Basic Profile',
  description: 'Basic profile information for a DID',
  schema: 'ceramic://k3y52l7qbv1frxjdr9qpn9ldvbxb0jg4eig7wtjkdu6gk84vyazw9j4txf4o6d2io',
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "BasicProfile",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 150
    },
    "image": {
      "$ref": "#/definitions/imageSources"
    },
    "description": {
      "type": "string",
      "maxLength": 420
    },
    "emoji": {
      "type": "string",
      "maxLength": 2
    },
    "background": {
      "$ref": "#/definitions/imageSources"
    },
    "birthDate": {
      "type": "string",
      "format": "date",
      "maxLength": 10
    },
    "url": {
      "type": "string",
      "maxLength": 240
    },
    "gender": {
      "type": "string",
      "maxLength": 42
    },
    "homeLocation": {
      "type": "string",
      "maxLength": 140
    },
    "residenceCountry": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "maxLength": 2
    },
    "nationalities": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^[A-Z]{2}$",
        "maxItems": 5
      }
    },
    "affiliations": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 140
      }
    }
  },
  "definitions": {
    "IPFSUrl": {
      "type": "string",
      "pattern": "^ipfs://.+",
      "maxLength": 150
    },
    "positiveInteger": {
      "type": "integer",
      "minimum": 1
    },
    "imageMetadata": {
      "type": "object",
      "properties": {
        "src": {
          "$ref": "#/definitions/IPFSUrl"
        },
        "mimeType": {
          "type": "string",
          "maxLength": 50
        },
        "width": {
          "$ref": "#/definitions/positiveInteger"
        },
        "height": {
          "$ref": "#/definitions/positiveInteger"
        },
        "size": {
          "$ref": "#/definitions/positiveInteger"
        }
      },
      "required": ["src", "mimeType", "width", "height"]
    },
    "imageSources": {
      "type": "object",
      "properties": {
        "original": {
          "$ref": "#/definitions/imageMetadata"
        },
        "alternatives": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/imageMetadata"
          }
        }
      },
      "required": ["original"]
    }
  }
}
{
  name: 'Alan Turing',
  description: 'I make computers beep good.',
  emoji: '💻'
}

For more information, see Basic Profile Definition (CIP-19).

Crypto Accounts

The crypto accounts definition specifies a record which stores a list of cryptographic identities that belong to a DID. Interact with this record using the cryptoAccounts alias.

{
  name: 'Crypto Accounts',
  description: 'Crypto accounts linked to your DID',
  schema: 'ceramic://k3y52l7qbv1fry6z45y9s2w5npe0nyokbp0oiv1tdhvswhv07lb2v13zdz4i1bp4w',
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "CryptoAccountLinks",
  "patternProperties": {
    "^[a-zA-Z0-9]{1,63}@[-a-zA-Z0-9]{3,16}:[-a-zA-Z0-9]{1,47}": {
      "type": "string",
      "pattern": "^ceramic://.+",
      "maxLength": 1024
    }
  },
  "propertyNames": {
    "maxLength": 1024
  },
  "additionalProperties": false
}
{
    '[email protected]:1': 'ceramic://kjz123...456',            // Ethereum acct and proof
    '[email protected]:b0a...70f': 'ceramic://kjz987...654',  // Polkadot acct and proof
    '[email protected]:f': 'ceramic://kjz528...912',               // Filecoin acct and proof
    '[email protected]:cosmoshub-2': 'ceramic://kjz382...565'   // Cosmos acct and proof
}

3ID Keychain

The 3ID keychain definition specifies a record which stores encrypted authentication secrets for a 3ID DID. It allows a 3ID to be authenticated using any number of public key cryptographic accounts and is how DIDs can be authenticated using existing blockchain wallets. Interact with this record using the threeIdKeychain alias.

{
  name: '3ID Keychain',
  description: 'Key data for 3ID',
  schema: 'ceramic://k3y52l7qbv1fry69sodu0hc4nwvzglaxxvy3l0xdw7v1o36gyu2dl9us472qh8veo',
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "JWE": {
      "title": "JWE",
      "type": "object",
      "properties": {
        "protected": { "type": "string" },
        "iv": { "type": "string" },
        "ciphertext": { "type": "string" },
        "tag": { "type": "string" },
        "aad": { "type": "string" },
        "recipients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "header": { "type": "object" },
              "encrypted_key": { "type": "string" }
            },
            "required": ["header", "encrypted_key"]
          }
        }
      },
      "required": ["protected", "iv", "ciphertext", "tag"]
    },
    "WrappedJWE": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "jwe": {
          "$ref": "#/definitions/JWE"
        }
      }
    },
    "AuthData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/definitions/WrappedJWE"
        },
        "pub": {
          "type": "string"
        },
        "data": {
          "$ref": "#/definitions/WrappedJWE"
        }
      }
    }
  },
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "authMap": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/AuthData"
      }
    },
    "pastSeeds": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/JWE"
      }
    }
  }
}


Adding new defaults

If you would like to add a new default definition to this list, submit a pull request to idx-constants on Github. For your pull request to be accepted:

  • The definition must be captured by a CIP (Ceramic improvement proposal)
  • The schema used in the definition must be captured by a CIP
  • The definition must provide general utility to a large number of IDX applications