πŸ†”
ID++ SDK Docs
  • πŸ†”Introduction
  • ❓Why use the ID++ SDK?
  • πŸ’‘Key concepts
    • ℹ️Decentralized Web Node (DWN)
    • ℹ️Decentralized identities (DID)
    • ℹ️Schemas
    • ℹ️Records
  • πŸ€“Reference
    • βš™οΈInstallation
    • βš™οΈConfiguration
    • βš™οΈInitialization
    • πŸ“ƒRecords
      • πŸ“–Queries
        • πŸ“‘How to query records
      • βš’οΈCRUD Operations
        • πŸ†•Create a record
        • πŸ“šRead a record
        • πŸ“‘Update a record
        • ❌Delete a record
    • πŸ›‘οΈVerifiable Credentials
      • πŸ’³Credentials
      • πŸ“œPresentations
  • πŸ—ΊοΈGuides
    • πŸ“Handling files
    • πŸš€Sharing records
Powered by GitBook
On this page
  • Protocol definition
  • Schemas
  • Permissions
  • Protocol definition example
  • Using the protocol definition
  1. Reference

Configuration

PreviousInstallationNextInitialization

Each application instantiates its own with its own protocol. This protocol can be configured to suit the needs of the application.

Protocol definition

The protocol definition is an object where you can define the protocol's name, the schemas needed for your application, and the permissions for those schemas. Altogether, it looks like this:

  • The protocol property defines the name of the protocol for your application. It should be consistent across the application.

Schemas

  • The types property is where you can define all of the schemas needed for your application.

  • Each property defined in the types object is the name of a schema for your application.

    • The schema property is the name of the protocol and the name of the schema with a / between them.

    • The dataFormats property defines what types of data this schema can be.

Permissions

  • The structure property allows you to define the permissions for your schemas.

  • There should be a corresponding property defined in the structure object for every schema.

    • $actions is an array of objects that define the permissions for the schema.

Protocol definition example

Let's assume that we're building a simple file storage application called Store. We would need to configure our protocol to include a schema for documents. That could look like this:

{
  "protocol": "http://message-protocol.xyz",
  "published": true,
  "types": {
    "message": {
      "schema": "http://message-protocol.xyz/schema/message",
      "dataFormats": [
        "text/plain"
      ]
    }
  },
  "structure": {
    "message": {
      "$actions": [
        {
          "who": "anyone",
          "can": "write"
        },
        {
          "who": "anyone",
          "can": "read"
        }
      ]
    }
  }
}

Using the protocol definition

One your protocol has been defined, it should be added to the DWN when a is initialized. See the for a full example.

πŸ€“
βš™οΈ
DWN
DID
initialization page