# Structured Objects

# Simple Summary

Objects expand on the work on hinted object notation and further define the top levels of their structure in order to add some commonly used attributes that applications can leverage.

# Problem Statement

In order for application and service developers to be able to identify, use, and create data structures compatible with other applications we need to define a basic list of well known attributed, some required some optional.

# Proposal

The top level of each object consists of three main attributes.

  • @type:s is an arbitrary string defining the type of the object's content.
  • @metadata:m are a fixed set of attributes that add extra info to the object.
{
  "@type:s": "type",
  "@metadata:m": {
    "root:r": "bah...",
    "owner:s": "did:x:y",
    "parents:m": [
      "*:as": ["bah..."],
      "some-type:as": ["bah..."],
    ],
    "_signature:m": {
      "alg:s": "hashing-algorithm",
      "signer:s": "bah...",
      "x:d": "bah..."
    }
  },
  "foo:s": "bar"
}

# Type

WARNING

Types are currently a way of moving forward, it's quite possible they will be deprecated in the future in favor once schemes are introduced.

# Well known types

  • nimona.io/crypto.PublicKey
  • nimona.io/crypto.PrivateKey
  • nimona.io/object.CID
  • nimona.io/peer.ConnectionInfoInfo
  • nimona.io/peer.ConnectionInfoRequest
  • nimona.io/peer.ConnectionInfoResponse
  • nimona.io/object.Certificate
  • nimona.io/object.CertificateRequest
  • nimona.io/exchange.ObjectRequest
  • nimona.io/exchange.ObjectResponse
  • ...

# Metadata

  • owner:s (optional) Public keys of the owner of the object.
  • root:r (optional) Root hash of the stream the object is part of.
  • parents:as (optional) Array of cids of parent objects, this is used for streams
  • _signature:m (optional) Cryptographic signature by the owner.

Additional metadata will be added in regards to access control and schema specification.

# References