1. Introduction

HyFi Blockchain uses the Multichain framework with distributed consensus between identified block validators. It's close in spirit to PBFT (Practical Byzantine Fault Tolerance), but instead of multiple validators per block, there is one validator per block, working in a round-robin fashion.

It's described in detail in the 'Mining in MultiChain' section beginning on page 7 of the Multichain white paper.

Also see the MultiChain JSON-RPC API commands and various Multichain developer tutorials and guides

2. Setting up a node

There are 3 HyFi Networks:

  1. HyFi mainNet is the primary HyFi Network with real-value assets.
  2. Haddock is the test network that mirrors the HyFi mainNet in terms of the protocol version. It has a different genesis block and the data & assets are different from HyFi mainNet.
  3. Calculus is where new features are released for initial testing. This is highly experimental and you can expect regular outages, changes and restarts.

2.1 Haddock nodes

Haddock is the test network that mirrors the HyFi mainNet in terms of the protocol version. It has a different genesis block and the data & assets are different from HyFi mainNet.

Setup a server with the following minimum config:

  • Linux: 64-bit, supports Ubuntu 12.04+, CentOS 6.2+, Debian 7+, Fedora 15+, RHEL 6.2+.
    Windows: 64-bit, supports Windows 7, 8, 10, Server 2008 or later.
    Mac: 64-bit, supports OS X 10.11 or later.
  • 512 MB of RAM
  • 1 GB of disk space

Login as root and run these commands:

You will see something like this:

Email it to team@hyfiblockchain.com

When we confirm, login to the node and run

You should get this response: Node ready.

Now run:

Now you can create addresses, assets, transactions, signatures and more.

Also see the MultiChain JSON-RPC API commands and various Multichain developer tutorials and guides

2.2 Blockchain Explorer

You can use the explorer at http://206.189.139.80:2750/

Instructions for setting it up on Ubuntu 20.04:

2.3 Calculus

Calculus is where new features are released for initial testing. This is highly experimental and you can expect regular outages, changes and restarts. Access to Calculus is currently not available.

2.4 mainNet

mainNet is the primary HyFi Network with real-value assets. Access to mainNet is currently not available.

3. Addresses

For details on permissions management, see: https://www.multichain.com/developers/permissions-management/

For MultiChain JSON-RPC API commands, see: https://www.multichain.com/developers/json-rpc-api/

3.1 Address permissions

Each address can have one or more of the following 8 permissions:

  1. connect – to connect to other nodes and see the blockchain’s contents.
  2. send – to send funds, i.e. sign inputs of transactions.
  3. receive – to receive funds, i.e. appear in the outputs of transactions.
  4. issue – to issue assets, i.e. sign inputs of transactions that create new native assets.
  5. create – to create streams, i.e. sign inputs of transactions which create new streams.
  6. mine – to create blocks, i.e. to sign the metadata of coinbase transactions.
  7. activate – to change connect, send, and receive permissions for other users, i.e. sign transactions which change those permissions.
  8. admin – to change all permissions for other users, including issue, mine, activate, and admin.

When you create a testNet node, your primary address has connect, send, receive, issue permissions. Since HyFi has 100% KYC compliance, every address you create must be given permissions by an admin. Create a few addresses and email them to team@hyfiblockchain.com along with details on what all permissions (send, receive, issue) should be given to each address.

3.2 Address types

Addresses can be custodial (the private key is stored in the node) or non-custodial (the private key is not stored in the node.)

3.3 Creating a custodial address

getnewaddress returns a new address whose private key is added to the wallet. This is a custodial address.

The output is an address.

3.4 Creating a non-custodial address

createkeypairs generates one or more public / private key pairs, which are not stored in the wallet or drawn from the node’s key pool, ready for external key management. These are non-custodial addresses.

For each key pair, the address, public key (as embedded in transaction inputs) and private key (used for signatures) is provided.

3.5 Creating a multi-sig address

Addmultisigaddress creates a pay-to-scripthash (P2SH) multisig address and adds it to the wallet.

Funds sent to this address can only be spent by transactions signed by nrequired of the specified keys. Each key can be a full public key, or an address if the corresponding key is in the node’s wallet.

Output is the P2SH address

4. Assets

When an asset is created, the following parameters can be customized:

  1. the address which is creating the asset
  2. address to which the assets are to be sent on creation
  3. asset name
  4. whether additional units can be created
  5. whether it has per-asset send and/or receive permissions
  6. the smallest transact-able unit
  7. optional custom-fields parameter to provide extra information

For details, see: https://www.multichain.com/developers/asset-reissuancehttps://www.multichain.com/developers/asset-reissuance

4.1 Creating a stablecoin

A stablecoin is a blockchain-based token that is valued by reference to an underlying fiat currency or basket of assets. Fiat-backed Stablecoins are blockchain assets that are backed 1:1 with fiat currency. For details, see: https://www.hyfiblockchain.com/stablecoins.php

A HyFi Stablecoin can be issued using: issuefrom fromAddress toAddress name|params qty (units=1) (customFields)

On successful creation, a transaction id will be generated.

Information about an asset can be obtained using getassetinfo asset-name

4.2 Creating a wrapped token

A wrapped token is a blockchain asset pegged to the value of an asset – gold, cryptocurrency, equity share, real-estate, etc.

It’s called a "wrapped" token because the original asset (e.g., bitcoin) is put in a "wrapper" or "digital vault" that enables the wrapped version to be created on another blockchain e.g. Ethereum.

For details, see: https://www.hyfiblockchain.com/wrapped_tokens.php

A HyFi wrapped token can be issued using: issuefrom fromAddress toAddress name|params qty (units=1) (customFields)

On successful creation, a transaction id will be generated.

Information about an asset can be obtained using getassetinfo asset-name

4.3 HyFi NFT Lifecycle Management

A Non-Fungible Token (NFT) is a unique token on a blockchain. It can be attached to any asset (tangible or not) to verify its authenticity and ownership.

For details and categories, see: https://www.hyfiblockchain.com/nfts.php

A HyFi NFT can be issued using issuefrom fromAddress toAddress name|params qty (units=1) (customFields)

On successful creation, a transaction id will be generated.

 

4.3.1 Creating a HyFi NFT

 

4.3.2 JSON output of a HyFi NFT

Information about an asset can be obtained using getassetinfo assetref

 

4.3.3 Managing a HyFi NFT

JSON-RPC API commands

See the following sections on the MultiChain JSON-RPC API commands page
1. Asset management
2. Querying wallet balances and transactions
3. Sending one-way payments
4. Atomic exchange transactions – tutorial
5. Managing stream and asset subscriptions
6. Querying subscribed assets
7. Smart filters and upgrades

4.4 Creating an Open Blockchain Token

A brand new way of fundraising is through Open Blockchain Tokens as defined under the laws of the US state of Wyoming (W.S. 17‑4‑206).

For details, see: hhttps://www.hyfiblockchain.com/fund_raising.php

An Open Blockchain Token can be issued using: issuefrom fromAddress toAddress name|params qty (units=1) (customFields)

On successful creation, a transaction id will be generated.

Information about an asset can be obtained using getassetinfo asset-name

5. Transactions

Transactions can be one-way payments or atomic exchange transactions.

5.1 Sending one-way payments

One-way payments can be sent using sendassetfrom fromAddress toAddress asset quantity

On success, a transaction id will be generated.

You can get a list of all the asset balances for an address using getaddressbalances address

5.2 Atomic exchange transactions

Atomic exchange transactions are used to safely swap assets between counterparties.

Any MultiChain transaction can have multiple inputs and outputs, and each one can relate to a different address on the blockchain. This enables a single transaction to perform an asset exchange between two or more parties, for example sending a dollar-denominated asset from Alice to Bob, while simultaneously sending a Euro-denominated asset from Bob to Alice.

Because the exchange takes place in a single transaction, it comes with a guarantee of atomicity, meaning that all of the asset transfers take place simultaneously, or none take place at all. In the finance world, this type of transaction is termed delivery-versus-payment, or DvP for short.

See:

  1. https://www.multichain.com/developers/atomic-exchange-transactions
  2. https://www.multichain.com/developers/raw-transactions
  3. https://www.multichain.com/developers/json-rpc-api

6. Electronic Signatures

Electronic Signatures can be generated using custodial and non-custodial addresses.

6.1 Signing by a custodial address

A message (text or hash) can be electronically signed by a custodial address using signmessage addressOfSigner "message"

The output will be the electronic signature.

An electronic signature can be verified using verifymessage addressOfSigner electronicSignature "message"

The output will be true or false.

6.2 Signing by a non-custodial address

A message (text or hash) can be electronically signed by a non-custodial address using signmessage privateKeyOfSigner "message"

The output will be the electronic signature.

An electronic signature can be verified using verifymessage addressOfSigner electronicSignature "message"

The output will be true or false.