Web Credits/Examples

From Web Payments
Jump to: navigation, search

As URL

Simple Web Credit with comment and timestamp

   {
     "@id": "#1234567890",
     "@type": "https://w3id.org/commerce#Credit",
     "https://w3id.org/cc#source": "http://melvincarvalho.com/#me",
     "https://w3id.org/cc#amount": "5.00",
     "https://w3id.org/cc#currency": "EUR",
     "https://w3id.org/cc#destination": "http://webr3.org/nathan#me",
     "https://w3id.org/cc#comment": "Just a test IOU",
     "https://w3id.org/cc#created": "2011-12-20T15:42:41.030Z"
   }

Open in playground: http://bit.ly/1ssuKaf

Crypto currency transfer with named hash

  {
    "@id": "ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522",
    "@type": "https://w3id.org/cc#Credit",
    "https://w3id.org/cc#source": { "@id" : "bitcoin:n3LaNorTreXuKaCgqibEpm7GzgRycyZ7bQ" },
    "https://w3id.org/cc#destination": { "@id" : "bitcoin:miJHHEv94TWjGH6UDbPPf5RQ3LR9sfYHf7" },
    "https://w3id.org/cc#amount": { "@value" : "0.5" , "@type" : "http://www.w3.org/2001/XMLSchema#decimal" },
    "https://w3id.org/cc#currency": { "@id" : "http://coin.data.fm/rwwcoin#this" }  ,
    "https://w3id.org/cc#timestamp":     {
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
      "@value" : "2014-04-14T17:43:22.000Z"
    }
  }

Signed with PEM

   -----BEGIN BITCOIN SIGNED MESSAGE-----
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <https://w3id.org/cc#created> "2014-04-14T17:43:22.000Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://w3id.org/commerce#Credit> .
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <https://w3id.org/cc#amount> "0.5"^^<http://www.w3.org/2001/XMLSchema#decimal> .
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <https://w3id.org/cc#currency> <http://coin.data.fm/rwwcoin#this> .
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <https://w3id.org/cc#destination> <bitcoin:miJHHEv94TWjGH6UDbPPf5RQ3LR9sfYHf7> .
   <ni:///sha-256;b55be329d380416148577d826b5a5274ad39e757477f50642c4f349a01b76522> <https://w3id.org/cc#source> <bitcoin:n3LaNorTreXuKaCgqibEpm7GzgRycyZ7bQ> .
   -----BEGIN SIGNATURE-----
   n3LaNorTreXuKaCgqibEpm7GzgRycyZ7bQ
   G9Rv2T5uNzpdeBeOz36EeleB/H+aqr1nHv87YT4ibzKouTXhgFoO7xbVejGtJLzGTk2EvKNZIUgp2+/yb77l9IA=
   -----END BITCOIN SIGNED MESSAGE-----

JSON LD Signature

    "https://w3id.org/security#signature":
    {
      "@id" : "#sig",
      "@type": "https://w3id.org/security#GraphSignature2012",
      "http://purl.org/dc/terms/creator": { "@id" : "bitcoin:n3LaNorTreXuKaCgqibEpm7GzgRycyZ7bQ" },
      "https://w3id.org/security#signatureAlgorithm": "ecdsa-secp256k1",
      "https://w3id.org/security#signatureValue": "n3LaNorTreXuKaCgqibEpm7GzgRycyZ7bQG9Rv2T5uNzpdeBeOz36EeleB/H+aqr1nHv87YT4ibzKouTXhgFoO7xbVejGtJLzGTk2EvKNZIUgp2+/yb77l9IA="    
    }

Crypto currency style transfer

   {
     "@id" : "https://testcoin.data.fm/tx/1",
     "@type": "https://w3id.org/commerce#Credit",
     "https://w3id.org/commerce#source": { "@id" : "bitcoin:1234" },
     "https://w3id.org/commerce#destination": { "@id" : "bitcoin:2345" },
     "https://w3id.org/commerce#amount": "1" ,
     "https://w3id.org/commerce#currency": { "@id" : "https://testcoin.data.fm/trinity#this" } 
   }

Crypto currency style transfer with signature

   {
     "@id" : "https://testcoin.data.fm/tx/1",
     "@type": "https://w3id.org/commerce#Credit",
     "https://w3id.org/commerce#source": { "@id" : "bitcoin:1234" },
     "https://w3id.org/commerce#destination": { "@id" : "bitcoin:2345" },
     "https://w3id.org/commerce#amount": "1" ,
     "https://w3id.org/commerce#currency": { "@id" : "https://testcoin.data.fm/trinity#this" } ,
     "https://w3id.org/security#signature":
     {
       "@id" : "https://testcoin.data.fm/tx/1#sig",
       "@type": "https://w3id.org/security#GraphSignature2012",
       "http://purl.org/dc/terms/creator": { "@id" : "bitcoin:mtKEq24xVay5mGQ45MXZCokX2MyfrunDkR" },
       "https://w3id.org/security#signatureAlgorithm": "ecdsa-secp256k1",
       "https://w3id.org/security#signatureValue": "H+yLvisQr24ySAwh1yGfkql1DKHxZ2s9TKJ0dXv6QkfqmDbJKrcGBEpsAasttpDwOWxTKlPwBlM+dUQgoFjHJk0="
     }
   }