Claims¶
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
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"
}
}
link
¶
Additional keys:
title
stringsummary
string
{
"claim": {
"summary": "summary",
"target": "http://some.url/path/",
"title": "title"
},
"context": "rinkeby:0xfe5da6ae3f65e7d5ce29121a9f5872ffd83b45e6",
"credits": [
{
"type": "interface",
"value": "http://blog.example.com/path/"
}
],
"signature": {
"creator": "ffc8c2f39e8a302bf9ca37b06fa9014f0cd3c85900c3d8b771f31a91ce33c050948faedad14d73a4f6c41f5937c3a010b5af24055092c136b7a667fee2249f87",
"signatureValue": "304602210093c55c30be1868de005def995aefb391d7ff20f235457b37a01e6921427701f80221008e5fc2afc2c9124660a57f9a2c9f4be1187afe3bc4b3c67a30e9a4c52747f4f7",
"type": "ecdsa.prime256v1"
},
"type": [
"link"
]
}
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"
]
}
Transports¶
HTTP¶
You can send signed claims through Userfeeds Platform HTTP Gateway
Properties:
- In-transport secrecy
- the claim cannot be sniffed on transport thanks to HTTPS connection and will only be available to outside world after it’s incorporated into Userfeeds Platform through rankings APIs and database dumps.
- Independent distribution
- the claim exists only inside Userfeeds Platform database and will be distributed with Userfeeds Platform database dumps.
Example of posting claim directly to Userfeeds Platform through HTTP transport
$ curl \
-X POST https://api.userfeeds.io/storage/ \
-H "Content-Type: application/json" \
-H "Authorization: 59049c8fdfed920001508e2a03414df648e34ea665f544a17d5c113b" \
-d '{"claim":{"target":"http://some.url/path/"},"context":"ethereum:0x4564567890abcdef....abc","signature":{"creator":"82fb68fc14719b94b36e99e588c9988458ca187d4791463164285bb064458232c4bb5bb638158096f4ed957e275e2e1576d1b24cca81ceb3a53cd7493ae88474","signatureValue":"c675d123fb1e99ffe59e7626c655806ebe47ec1ca4100b953029731159c2e14f4461e2ebf7f43a071b847b57cbcbd66bd8fa9451a5e27c4db4bbaec3cdd16b02","type":"ecdsa.prime256v1"}}'
Ethereum Transaction¶
You can send claim through Ethereum Blockchain transaction.
Note
Userfeeds Platform does not yet monitor every transaction for potential claims
To send a claim through transaction you need to call special contracts that are monitored by Userfeeds Platform.
Properties:
- In-transport secrecy
- The claim is available from the moment it’s distributed through Ethereum network and can be sniffed before it reaches desired ranking.
- Independent distribution
- The claim will be a part of Etherum Blockchain and will be available from all copies of the blockchain.
Contracts¶
With value transfer
Code
pragma solidity ^0.4.11;
contract Userfeeds {
event Claim(address sender, address userfeed, string data);
function post(address userfeed, string data) payable {
userfeed.transfer(msg.value);
Claim(msg.sender, userfeed, data);
}
}
ABI
[
{
"constant":false,
"inputs":[
{ "name":"userfeed", "type":"address" },
{ "name":"data", "type":"string" }
],
"name":"post",
"outputs":[],
"payable":true,
"type":"function"
},
{
"anonymous":false,
"inputs":[
{ "indexed":false, "name":"sender", "type":"address" },
{ "indexed":false, "name":"userfeed", "type":"address" },
{ "indexed":false, "name":"data", "type":"string" }
],
"name":"Claim",
"type":"event"
}
]
Addresses
- Mainnet: ...
- Rinkeby: 0x0a48ac8263d9d79768d10cf9d7e82a19c49f0002
- Ropsten: 0xa845c686a696c3d33988917c387d8ab939c66226
- Kovan: 0xebe67ecee8f7a222e4451f04dca903cb2bfead7f
Without value transfer
Code
pragma solidity ^0.4.11;
contract Userfeeds {
event Claim(address sender, string data);
function post(string data) {
Claim(msg.sender, data);
}
}
ABI
[
{
"constant":false,
"inputs":[
{ "name":"data", "type":"string" }
],
"name":"post",
"outputs":[],
"payable":false,
"type":"function"
},
{
"anonymous":false,
"inputs":[
{ "indexed":false, "name":"sender", "type":"address" },
{ "indexed":false, "name":"data", "type":"string" }
],
"name":"Claim",
"type":"event"
}
]
Addresses
- Mainnet: ...
- Rinkeby: 0x09dcdf34e0c28b106fdfe51009cb71ae92bf8bbc
- Ropsten: 0x5c3fe6b94b57c1e294000403340f12f083e71b83
- Kovan: 0x7d9ab4747413f470306a9fb1dab4092cfbc3355e
Whisper Protocol¶
TODO: Direct message TODO: Broadcast
IPDB (BigchainDB)¶
TODO