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

Hash

4min

The Hash envelope allows storing a document hash on the blockchain. It does not store the document.

By storing the document hash, a user can implement file tampering prevention, allowing other users to be able to validate that the document contents are equal to the original.

Creating a Hash Envelope

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

This output type requires the following properties:

Property

Type

Description

data (required)

Uint8Array

Raw file contents. Used to generate the hash. Not stored on chain.

algorithm (required)

String

Hashing algorithm. It can be either 'SHA-256' or 'SHA-512'.

sign (optional)

Boolean

Specify true if the envelope is going to be signed. If this is the case, a signing key needs to be specified. See: key property below.

encrypt(optional)

Boolean

Specify true if the envelope is going to be encrypted. If this is the case, an encryption key needs to be specified. See: key property below.

key (required only if encrypt or signis true)

String | JWK

ES256 Public key of the receiver, either as JWK or as uncompressed hex string

metadata(optional)

Object

Any extra information to store within mintBlue. Not stored on chain.

Example

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

const outputs = [
        {
          type: 'hash',
          data: data,
          algorithm: 'SHA-256',
        },
];

// 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

"hash"

1

Envelope

Serialized JWE/JWS

2

Receiver key

Public key of the receiver

๏ปฟ

Updated 10 Jul 2023
Did this page help you?
PREVIOUS
Doc
NEXT
Peppol v1
Docs powered by
Archbee
TABLE OF CONTENTS
Creating a Hash Envelope
Example
OP_RETURN
Docs powered by
Archbee