Data Model

Claims are the smallest self contained piece of information inside Userfeeds Platform. All claims are cryptographically signed or have reference to their cryptographic origin (eg. transaction on blockchain)

Structure

Overview

{
  "context": "CONTEXT",
  "type": ["TYPEA", "TYPEB", "..."],
  "claim": {
    "target": "TARGET",
    "additional": "fields",
    "go": ["here", "..."]
  },
  "credits": [
    {
      "type": "interface",
      "value": "INTERFACE IDENTIFIER"
    }
  ],
  "signature": {
    "type": "TYPE",
    "creator": "CREATOR",
    "signatureValue": "SIGNATURE"
  }
}

context

optional

Context field is used to denote destination of given claim. It can be interpreted as name of any topic/thing that people might want to share information about. Usually it will have something to do with blockchain space (but it doesn’t have to). For example if you would like to share some information to all people interested in Ethereum blockchain you will send claim with ethereum as context.

Other examples of contexts might be:

  • ethereum
  • ethereumclassic
  • bitcoin
  • ethereum:0x4564567890abcdef....abc
  • ethereumclassic:0x4564567890abcdef....abc
  • myspecialcontext
  • companyx
  • companyx:departmenty

ethereum:0x123....456 context identifiers are interpreted as object 0x123....456 on ethereum and usually will be used to share information about contracts/addresses on given blockchain.

Special contexts starting with userfeeds: are technical context and have special meaning in Userfeeds Platform. eg. userfeeds:pairing will create special PAIRED relationship allowing one to connect their cryptocurrency holdings with additional public key that will only be used to sign claims.

type

optional

Type describes additional data present in claim object.

Example can be labels type, with this type claim object needs to have labels key with array of values.

Description of all supported types can be found at Types

claim

This key is used to store user provided information and it is mandatory for all claims. claim object will always have target key and additional fields depending on type array.

target

target value identifies target object that user wants to share or tag with additional information.

Some examples of proper target values:

  • http://some.url/path/
  • text:base64:base64encodedtext
  • ipfs:somehash
  • ipdb:somehash
  • claim:claimsignaturehash
  • mediachain:somehash
  • isbn:0451450523
  • isan:0000-0000-9E59-0000-O-0000-0000-2
  • btih:c12fe1c06bba254a9dc9f519b335aa7c1367a88a
  • ethereum:0x4564567890abcdef...abc
  • bitcoin:0x4afebcdef...123

Additional fields

Depending on type array additional keys might be present in claim object. See Types for supported types.

signature

This field is generated to denote ownership of claim and can be cryptographic signature or a pointer to cryptographically secure origin of claim.

type

Describes what type of signature we are dealing with. It could be ecdsa.secp256r1 for elliptic curve signature or ethereum.transaction for claim origination from Ethereum blockchain.

Supported Signature Types
ecdsa.prime192v1
In python: ecdsa.NIST192p
ecdsa.secp256r1 / ecdsa.prime256v1
In python: ecdsa.NIST256p
ecdsa.secp224r1
In python: ecdsa.NIST224p
ecdsa.secp384r1
In python: ecdsa.NIST384p
ecdsa.secp521r1
In python: ecdsa.NIST521p
ecdsa.secp256k1
In python: ecdsa.SECP256k1
ethereum.transaction
Claims posted on ethereum blockchain will be verified by comparing blockchain content with claim content.

creator

This identifies public key or address that signed claim.

Format: identifier

  • hex:04861127b14bf0036e...ef7127b114988057
  • rinkeby:0x1234567890abcdef...1456
  • ethereum:0x1235...145
  • bitcoin:0x123456...1234

signatureValue

This key holds raw signature value as produced by signing algorithm, or it can be transaction hash or any valid identifier of externally verifiable origin of claim.

Types

Basic

Basic claim:

{
  "claim": {
    "target": "http://some.url/path/"
  },
  "context": "ethereum:0x4564567890abcdef....abc",
  "signature": {
    "creator": "94d1aa6655d931294d524cf52b0df866976f89774bac38a730cf20e2d51dd24d34efc2bbb4d5bba91a7a6582511491dde1803dcdf7fd55550cf3132aae16077a",
    "signatureValue": "304402203dac2176721d7e05cd8c580a27a504b64b0a8ee171b18a07630201cbed979ac7022013faf8735f90b957ca4656efb17349856ac22894aab553db136b7dfc2b03ede4",
    "type": "ecdsa.prime256v1"
  }
}

With acknowledgment of interface from which claim was created:

{
  "claim": {
    "target": "http://some.url/path/"
  },
  "context": "ethereum:0x4564567890abcdef....abc",
  "credits": [
    {
      "type": "interface",
      "value": "http://blog.example.com/path/"
    }
  ],
  "signature": {
    "creator": "0df1d4915347bcae90a0696c9efd6300e33b610d31130c3049d329fa61af138de7a7ee55f99057fd8d39c4664be9f1c34361c237433b34c8f523c5858f9fb9a0",
    "signatureValue": "304502206c243684007c9e412612b5d1a371b20eb146652e4b149bb1fc0e6da437e7f728022100b8c77983949feac478de449751587be82d5b37ff30b257da04f2352aab5f8793",
    "type": "ecdsa.prime256v1"
  }
}

labels

Additional keys:

  • labels array of string
{
  "claim": {
    "labels": [
      "Good",
      "Book",
      "Cats"
    ],
    "target": "http://some.url/path/"
  },
  "context": "rinkeby:0xfe5da6ae3f65e7d5ce29121a9f5872ffd83b45e6",
  "signature": {
    "creator": "de9965ce03cf6f960a7efe423633409a0052ad8f9f2100e27026ad94551d4d69058c0a263dbd0cacf999ca3e97ddcc0afae5051e91dc42c4ca008e4c7c5c0ddb",
    "signatureValue": "3044022069457927f1fc06b26467a7cc93c99085efea4d8811c6979ffab9ba2196be5ad702201587d3f88d2e9058d6ce48708ddf8713b07017a311ce713b566a1829ea516e41",
    "type": "ecdsa.prime256v1"
  },
  "type": [
    "labels"
  ]
}

Value Transfer

Along with claims Userfeeds Database contains normalized data about transfer of assets (tokens and other)

If transfer of assets was accompanying a claim they will be connected with TRANSFER relation.