-
Notifications
You must be signed in to change notification settings - Fork 1
GitHub Attestations
Thom Ivy edited this page Apr 25, 2019
·
1 revision
A github attestation is simply the gist ID. An example of a valid gist should contain the following properties. It should first and foremost be public and have the stated description. It should then contain a proof with an encrypted blob of content defined below this current snippet.
{
public: true,
description: 'Edgeware Identity Attestation',
files: {
proof: {
content: encryptedContent,
}
},
...
}
The decrypted content should must contain the following data to be valid: the identityType (github), the github identity reported on-chain which must match that of the creator of the gist, the Edgeware base 58 encoded public address, and the Blake2 hash of the concatenated identity type and identity.
{
identityHash: "0x995e957d368c817e5d64eab9757991a10001d8c6f3733646824da2c006ecc64e",
identityType: "github",
identity: "drewstone",
sender: "5ERmnP13Gx8ybq64pi2LEGWVqF2AoRCM83UovE9537uRvLA8",
}
The has can be computed using the following snippet:
import { u8aConcat } from '@polkadot/util';
import { blake2AsHex } from '@polkadot/util-crypto';
let identityHash = blake2AsHex(
u8aConcat(
new Text(data.identityType).toU8a(),
new Text(data.identity).toU8a()
)
)