Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.47 KB

MSP_1000.md

File metadata and controls

62 lines (46 loc) · 2.47 KB
msp title author protocol version created
1000
Proof Transfer Standard
Scobru (@scobru1988)
v2.0.0
26-10-2023

Proofhash Standard

Abstract

This standard outlines how to encode data for transfering access to an mecenate data proof. Transfering access occurs when the creator of the proof allows an other party to access the data.

Specification

The encoding includes the following fields:

  • msp_version: The version of the standard which tracks the protocol version in which it was released.
  • proofhash: base58 ipld-sha2-256 proofhash being transfered.
  • sender: The ethereum address of the owner of the proof.
  • senderPubKey: The 32 byte nacl public key of the sender converted to a string.
  • senderVaultId: The 32 bytes commitment from sismo sender vault.
  • receiver: The ethereum address of the receiver of the proof.
  • receiverPubKey: The 32 byte nacl public key of the receiver converted to a string.
  • receiverVaultId: The 32 bytes commitment from sismo sender vault.
  • encryptedSymKey: The string representation of the symmetric key of the proof encrypted with the receiver's public key and signed with the sender's private key.
  • postId: The 32 Byte identifier of the post

These fields are stringified as a JSON and bufferized before being sent to the receiver client. An application can add additionaly arbitrary fields if additional data is required.

Note on asymmetric keypair generation: This standard does not restrict how nacl keypairs are generated. However, it is recommended to derive a deterministic keypair using pbkdf2 of a signed message and the address of the user.

Note on asymmetric encryption: The encryption of the recovery key uses the first 24 byte of the keyhash as a salt.

Buffer(JSON.stringify({
  msp_version: <v1.0.0>,
  proofhash: <ipld_sha2_256 proof>,
  sender: <0x1234...>,
  senderPubKey: <0x1234...>,
  senderVaultId: <0x1234...>,
  receiver: <0x1234...>,
  receiverPubKey: <0x1234...>,
  receiverVaultId: <0x1234...>,
  encryptedSymKey: ipld_sha2_256(Buffer(<raw data>))),
  postId: <0x1234...>,
  ... <extra fields>
}))

Motivation

Having a standard way to encode proof access transfers allows for cross client transfer of proofs.

Backwards Compatibility

This is the first version of this standard. Clients can infer compatibility by comparing msp_version field.

Reference Implementation

The reference implementation uses the tweetnacl javascript library for encryption.