About

The Interplanetary Lockbox (IPLB) is an ongoing exploration to leverage the Interplanetary File System (IPFS) for distributed authentication and authorization.

It proposes a schema and a protocol for defining and enforcing access policies for resources published on the IPFS.


#Overview

The following diagram walks through a hypothetical scenario in which Alice publishes a πŸ–ΌοΈ on IPFS while only granting access to Bob through a Lockbox in the custody of a Gateway supporting the IPLB protocol.



Rotate your screen to display the diagram.
β”Œβ”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”                     β”Œβ”€β”€β”€β”
β”‚Aliceβ”‚            β”‚IPFSβ”‚           β”‚Gatewayβ”‚                     β”‚Bobβ”‚
β””β”€β”€β”¬β”€β”€β”˜            β””β”€β”¬β”€β”€β”˜           β””β”€β”€β”€β”¬β”€β”€β”€β”˜                     β””β”€β”¬β”€β”˜
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚Publishes Pictureβ”‚                  β”‚                           β”‚  
   │─────────────────>                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚ Requests Lockbox for Picture's CID β”‚                           β”‚  
   │────────────────────────────────────>                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  │────┐ Encrypts CID         β”‚  
   β”‚                 β”‚                  β”‚<β”€β”€β”€β”˜                      β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚       Responds with Lockbox        β”‚                           β”‚  
   β”‚<─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─                            β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚Publishes Lockboxβ”‚                  β”‚                           β”‚  
   │─────────────────>                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚               Shares Picture's Lockbox Address                 β”‚  
   │───────────────────────────────────────────────────────────────>β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚      Requests access      β”‚  
   β”‚                 β”‚                  β”‚ <─────────────────────────│  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚ Retrieves Lockboxβ”‚                           β”‚  
   β”‚                 β”‚ <─────────────────                           β”‚  
   β”‚                 β”‚  ─ ─ ─ ─ ─ ─ ─ ─ >                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  │────┐ Validates Lockbox    β”‚  
   β”‚                 β”‚                  β”‚<β”€β”€β”€β”˜                      β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚   Requests Credentials    β”‚  
   β”‚                 β”‚                  β”‚  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ >β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚   Provides Credentials    β”‚  
   β”‚                 β”‚                  β”‚ <─────────────────────────│  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  │────┐ Validates Credentialsβ”‚  
   β”‚                 β”‚                  β”‚<β”€β”€β”€β”˜                      β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  │────┐ Decrypts CID         β”‚  
   β”‚                 β”‚                  β”‚<β”€β”€β”€β”˜                      β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚ Retrieves Pictureβ”‚                           β”‚  
   β”‚                 β”‚ <─────────────────                           β”‚  
   β”‚                 β”‚  ─ ─ ─ ─ ─ ─ ─ ─ >                           β”‚  
   β”‚                 β”‚                  β”‚                           β”‚  
   β”‚                 β”‚                  β”‚     Forwards Picture      β”‚  
   β”‚                 β”‚                  β”‚  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ >β”‚  
β”Œβ”€β”€β”΄β”€β”€β”            β”Œβ”€β”΄β”€β”€β”             β”Œβ”€β”΄β”€β”€β”                      β”Œβ”€β”΄β”€β”
β”‚Aliceβ”‚            β”‚IPFSβ”‚             β”‚IPLBβ”‚                      β”‚Bobβ”‚
 β””β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”˜             β””β”€β”€β”€β”€β”˜                      β””β”€β”€β”€β”˜ 
    

A few key things to note:


In the initial phase of the exploration, the enforcement of access policies is delegated to trusted IPFS Gateways. A subsequent phase will focus on developing strategies to shift trust to credential verification proofs, where any IPFS node could help support enforcement for the whole network.


#The Lockbox

A JSON formatted access policy secured by cryptography that specifies the associated content's address, the credential requirements, and other metadata fields.


cat-pic-lockbox.json
{
  "schemaVersion": "1.2.3",
  "content": {
    "custodians": [
      {
        "custodian": "...",
        "cid": "...",
        ...
      }
    ]
  }, 
  "validations": [
    {
      "id": "ens-controller",
      "version": "1.0.2",
      "parameters": {
        "network": "mainnet",
        "ens": "bob.eth"
      }
    }
  ],
  "metadata": {
    "name": "Cat Picture",
    "description": "My most recent Cat picture, enjoy!",
    ...
  }
}

    

#Validations & Verifications

A Lockbox may require one or more Validations which are standardized definitions of the parameters consumed by child Verifications.

Verifications are interchangeable building blocks that allow composability and reusability across different types of Validations.

For example,

An "ERC-721 Token Validation" might require two Verifications:

A different "ETH Transaction Validation" may leverage the existing Ethereum Address Signature Verification as well as an on-chain transaction Verification with the specified arguments.

Verifications implement a standard interface and serve as an abstraction for the logic and dependencies.

Only after all of the child Verifications are successful is a parent Validation considered successful.


#Roadmap

The Interplanetary Lockbox exploration is on its early stages. Both code and specifications will be released once they become stable.

In the meantime, you can say πŸ‘‹ or follow the updates on twitter.