website logo
WebsiteTry DashboardContact Sales
โŒ˜K
๐Ÿ‘‹Welcome to mintBlue!
โ“Why Use mintBlue?
๐ŸงงmintBlue Products
โ›“๏ธEnterprise Bitcoin
๐Ÿš€Introduction
๐Ÿ‘‰mintBlue Quick Start Guide
๐Ÿ”—Setting up Zapier & mintBlue
๐ŸŽ‡mintBlue SDK
๐Ÿ‘‰SDK Quick Start Guide
๐Ÿ—๏ธSDK Encryption
๐Ÿ–ฅ๏ธSDK Server
๐Ÿ“ฉEnvelopes
๐Ÿ“SDK Scripts
๐Ÿ“–mintBlue API
โน๏ธBlockchain API
๐Ÿ–ฅ๏ธmintBlue Console
๐Ÿ‘‚Event Listeners
๐Ÿ†Examples of Building with mintBlue
๐Ÿ”‘password manager
๐Ÿ“ƒNotary Express App
Docs powered by
Archbee
mintBlue SDK
Envelopes

Doc

6min

The Doc envelope allows storing data on chain with some great aditional features:

  • Double encryption for added security.
  • Add multiple recipients to an encrypted payload.
  • Add multiple signers.
  • Ability to add metadata within a protected header.
  • Payload deterministic encryption keys.

By making use of these features, mintBlue users can:

  • Save and retrieve files on chain.
  • Own their own data by determining who gets access to the documents, using encryption.
  • Authenticate data by adding one or more digital signatures
  • Double encryption allows for selective disclosure of data. The first encryption layer can be disclosed by selected recipients while keeping the document private, stored in a second encryption layer.
  • Encryption secrets are deterministic based on payload (sha256). This means you either have to have the data to decrypt it or the secret needs to be shared, allowing users to authenticate a document with the blockchain by having acces to the original document.

The maximum file size is 50MB per transaction.

๏ปฟ

Creating a Doc Envelope

Creating a new Doc envelope to be stored on chain, can be achieved by adding a specific output object of type doc and add it to the createTransaction outputs argument.

This output type requires the following properties:

Property

Type

Description

data (required)

Uint8Array

Raw file contents.

signers (required)

Array<jose.JWK>

Array of JWK signing private keys.

options

Object

Optional metadata to store with the envelope. See properties below.

options.filename (optional)

String

Document's filename.

options.mimetype (optional)

String

Document's mimetype.

options.meta (optional)

Object

Any additional metadata provided as an object.

receivers (optional)

Array<jose.JWK> | Array<String>

Array of JWK public keys or hexadecimal public keys. Used to encrypt data for third parties.

iterations(optional)

Number

๏ปฟPBKDF2 iterations to perform (defaults to 200 000).

Example

JS
|
const data = new Uint8Array(Buffer.from('My file contents'));

const outputs = [
  {
      type: 'doc',
      data: data,
      options: {
        filename: 'my-file.pdf',
        mimetype: 'application/pdf',
      },
      signers: [jwkSignKey],
      iterations: 200000,
      receivers: [jwkReceiverKey],
  },
];

// Replace [PROJECT_ID] below with yours.
const { txid, rawtx } = await client.createTransaction({project_id: '[PROJECT_ID]', outputs});
๏ปฟ

OP_RETURN

The following OP_RETURN arguments are created when a Hash envelope is published on a Blockchain transaction.

Index

Description

Value

0

Protocol ID

"doc"

1

Envelope

Serialized JWE/JWS

๏ปฟ

Updated 21 Aug 2023
Did this page help you?
PREVIOUS
Token API Reference
NEXT
Hash
Docs powered by
Archbee
TABLE OF CONTENTS
Creating a Doc Envelope
Example
OP_RETURN
Docs powered by
Archbee