An open API service indexing awesome lists of open source software.

https://github.com/3box/3box-verifications

Verification service
https://github.com/3box/3box-verifications

Last synced: 11 months ago
JSON representation

Verification service

Awesome Lists containing this project

README

          

# ⚠️ ⚠️ Deprecated in favor of Ceramic ⚠️ ⚠️
> 3box.js and related tools built by 3Box Labs are deprecated and no loger supported. Developers are encurraged to build with https://ceramic.network which is a more secure and decentralized protocol for sovereign data.

# 3Box Verification service

# Overview

This service allows to associate a service handle (twitter, github, etc) to a [did](https://w3c-ccg.github.io/did-spec/). It outputs a [did-jwt](https://github.com/uport-project/did-jwt) claim containing a link that serves as proof that the service handle is linked to the did.

# API

## Get DID document

This enables us to use have the issuer DID `did:https:verifications.3box.io` in the claims we create.

**Endpoint:** `GET /.well-known/did.json`

### Response data

```js
{
"@context": "[https://w3id.org/did/v1](https://w3id.org/did/v1)",
"id": "did:https:verifications.3box.io",
"publicKey": [{
"id": "did:https:verifications.3box.io#owner",
"type": "Secp256k1VerificationKey2018",
"owner": "did:https:verifications.3box.io",
"ethereumAddress": ""
}],
"authentication": [{
"type": "Secp256k1SignatureAuthentication2018",
"publicKey": "did:https:verifications.3box.io#owner"
}]
}
```

## Create twitter verification

**Endpoint:** `POST /twitter`

### Body

```js
{
did: ,
twitter_handle:
}
```

### Response

The response data follows the [jsend](https://labs.omniti.com/labs/jsend) standard.

### Response data

```js
{
status: 'success',
data: {
verification:
}
}
```

**Verification claim format**

```js
{
iss: 'did:https:verifications.3box.io',
sub: ,
iat: ,
claim: {
twitter_handle: ,
twitter_proof:
}
}
```

## Verify email address

**Endpoint:** `POST /send-email-verification`

This endpoint sends an email to the email address in the body. This email contains the following:
* A code `C` that consists of six randum digits
* The `name` and `image` of the given DID.

Now the DID is saved along with the email address, code `C`, and a timestamp.

### Body

```js
{
did: ,
email_address:
}
```

### Response

The response data follows the [jsend](https://labs.omniti.com/labs/jsend) standard.

### Response data

```js
{
status: 'success'
}
```

**Endpoint:** `POST /email-verify`

This endpoint takes a JWT as an input, which contains the code `C`, and verifies that:
* The JWT signed by the saved DID
* The code `C` in the JWT is the same as the saved code `C`
* The stored timestamp is not older than 12h

### Body

```js
{
verification:
}
```

**Input verification claim format**

```js
{
iss: ,
sub: 'did:https:verifications.3box.io',
iat: ,
claim: {
code:
}
}
```

**Output verification claim format**

```js
{
iss: 'did:https:verifications.3box.io',
sub: ,
iat: ,
claim: {
email_address: ,
code:
}
}
```

### Response

The response data follows the [jsend](https://labs.omniti.com/labs/jsend) standard.

### Response data

```js
{
status: 'success',
data: {
verification:
}
}
```

## Maintainers
[@simonovic86](https://github.com/simonovic86)