aladinnetwork-blockstack
Version:
The Aladin Javascript library for authentication, identity, and storage.
234 lines (230 loc) • 7.19 kB
HTML
<html>
<head>
<title>Proofs Test</title>
<script src="../bundle.js"></script>
<script>
var naval = {
"@context": "http://schema.org/",
"@type": "Person",
"name": "Naval Ravikant",
"givenName": "Naval",
"familyName": "Ravikant",
"description": "Co-founder of AngelList",
"image": [
{
"@type": "ImageObject",
"name": "avatar",
"contentUrl": "https://pbs.twimg.com/profile_images/3696617328/667874c5936764d93d56ccc76a2bcc13.jpeg"
},
{
"@type": "ImageObject",
"name": "background",
"contentUrl": "https://pbs.twimg.com/profile_banners/745273/1355705777/web_retina"
}
],
"website": [
{
"@type": "WebSite",
"url": "angel.co"
}
],
"account": [
{
"@type": "Account",
"service": "facebook",
"identifier": "navalr",
"proofType": "http",
"proofUrl": "https://facebook.com/navalr/posts/10152190734077261"
},
{
"@type": "Account",
"service": "twitter",
"identifier": "naval",
"proofType": "http",
"proofUrl": "https://twitter.com/naval/status/486609266212499456"
},
{
"@type": "Account",
"service": "github",
"identifier": "navalr",
"proofType": "http",
"proofUrl": "https://gist.github.com/navalr/f31a74054f859ec0ac6a"
},
{
"@type": "Account",
"service": "bitcoin",
"role": "payment",
"identifier": "1919UrhYyhs471ps8CFcJ3DRpWSda8qtSk",
"proofType": "signature",
"proofMessage": "Verifying that +naval is my blockchain ID.",
"proofSignature": "ICuRA+Dq5Dn8AiY9P+mcLzGyibPgG0ec9CphtMk512uPdB5eAncDSHhQZY/7kycvl6PLFEuR+j3OM/K2Vey1+EU="
}
],
"worksFor": [
{
"@type": "Organization",
"@id": "angellist.id"
}
],
"knows": [
{
"@type": "Person",
"@id": "muneeb.id"
},
{
"@type": "Person",
"@id": "ryan.id"
}
],
"birthDate": "1973-01-01",
"taxID": "000-00-0000",
"address": {
"@type": "PostalAddress",
"streetAddress": "16 Maiden Ln",
"addressLocality": "San Francisco, CA",
"postalCode": "94108",
"addressCountry": "United States"
}
}
var larry = {
"@type": "Person",
"account": [
{
"@type": "Account",
"identifier": "larrysalibra",
"proofType": "http",
"service": "twitter"
},
{
"@type": "Account",
"identifier": "larrysalibra",
"proofType": "http",
"service": "github"
},
{
"@type": "Account",
"identifier": "1EyuZ8qxdhHjcnTChwQLyQaN3cmdK55DkH",
"role": "payment",
"service": "bitcoin"
},
{
"@type": "Account",
"contentUrl": "http://pgp.mit.edu/pks/lookup?op=get&search=0xDE3B5425164C4849",
"identifier": "B516CB7A08819697B25E4694DE3B5425164C4849",
"role": "key",
"service": "pgp"
},
{
"@type": "Account",
"identifier": "larry.salibra",
"proofType": "http",
"proofUrl": "https://www.facebook.com/larry.salibra/posts/10100341028448093",
"service": "facebook"
},
{
"@type": "Account",
"identifier": "blck-stck",
"proofType": "http",
"proofUrl": "https://www.linkedin.com/feed/update/urn:li:activity:6311587377647222784/",
"service": "linkedIn"
}
],
"address": {
"@type": "PostalAddress",
"addressLocality": "Hong Kong"
},
"description": "Blockchain, software, security. Decentralize the world (w/ #bitcoin)! \u8b58\u4e2d\u6587",
"image": [
{
"@type": "ImageObject",
"contentUrl": "https://s3.amazonaws.com/kd4/larry",
"name": "avatar"
},
{
"@type": "ImageObject",
"contentUrl": "https://s3.amazonaws.com/dx3/larry",
"name": "cover"
}
],
"name": "Larry Salibra",
"website": [
{
"@type": "WebSite",
"url": "https://www.larrysalibra.com"
}
]
}
var ken = {
"@type": "Person",
"account": [
{
"@type": "Account",
"identifier": "blckstcktest",
"proofType": "http",
"proofUrl": "https://twitter.com/blckstcktest/status/908420883177525249",
"service": "twitter"
},
{
"@type": "Account",
"identifier": "yknl",
"proofType": "http",
"proofUrl": "https://gist.github.com/yknl/37c763ab7bc6cf89b919212ef3f10676",
"service": "github"
},
{
"@type": "Account",
"identifier": "blckstcktest",
"proofType": "http",
"proofUrl": "https://www.instagram.com/p/BZCMqkUgJM5/",
"service": "instagram"
},
{
"@type": "Account",
"identifier": "blckstcktest",
"proofType": "http",
"proofUrl": "https://news.ycombinator.com/user?id=blckstcktest",
"service": "hackerNews"
},
{
"@type": "Account",
"identifier": "blck-stck",
"proofType": "http",
"proofUrl": "https://www.linkedin.com/feed/update/urn:li:activity:6311587377647222784/",
"service": "linkedIn"
}
],
"address": {
"@type": "PostalAddress"
},
"familyName": "Liao",
"givenName": "Ken",
"image": [
{
"@type": "ImageObject",
"contentUrl": "https://www.dropbox.com/s/f7ofcbimzq2c287/avatar-1?dl=1",
"name": "avatar"
}
]
}
</script>
<script>
aladin.validateProofs(larry, "1AtFqXxcckuoEN4iMNNe7n83c5nugxpzb5", "larry.id").then(function(proofs) {
var newDiv = document.createElement("div");
newDiv.appendChild(document.createTextNode(JSON.stringify(proofs)))
var targetDiv = document.getElementById("results")
document.body.insertBefore(newDiv, targetDiv)
})
aladin.validateProofs(ken, "1AtFqXxcckuoEN4iMNNe7n83c5nugxpzb5")
.then(function(proofs) {
var newDiv = document.createElement("div");
newDiv.appendChild(document.createTextNode(JSON.stringify(proofs)))
var targetDiv = document.getElementById("results")
document.body.insertBefore(newDiv, targetDiv)
})
</script>
</head>
<body>
<div id="results"></div>
</body>
</html>