Java API
HSM Dinamo
Loading...
Looking for...
No entries found
Blockchain

Detailed description

Operations to support the security of Blockchain-based structures.

The Blockchain module APIs are aimed at specific operations for processing blockchain network cryptography and BIP, EIP and SLIP specifications.

The ECDSA signature, for example, is specialized to avoid signature malleabilitywith the restriction of LOW-S.

Examples of operations available in the Blockchain module:

  1. Extended Private Key (XPrv) generation in the BIP32 standard.
  1. Child Key Derivation in the BIP32 and SLIP10 standards.
  1. Address recovery.
  1. ECDSA digital signatures, in SECG strict DER standards (BIP62/66 and BIP 146) and Schnorr in BIP340 standard;
  1. Digital signatures EdDSA curve 25519.
  1. Signature verification.
  1. Import and export of keys via various formats (WIF, Hex, Sec1, Xpriv etc).
  1. Recovery of the public key with different formats (BIP32 Xpub, Sec1 with and without compression, Schnorr BIP340 etc).
  1. Split and Recover secrets with M from N scheme using SSS (Shamir's Secret Sharing).
  1. Operations with the curve alt_bn128according to EIP-196.
Attention
The blockchain module does not handle or assemble the transaction details for each particular network; this must be left to the application. The function of the HSM is to protect the private key in a secure environment, generate and return a signature according to the parameters passed by the calling application.

Compatible networks

Below is the list of networks whose encryption is compatible with HSM:

Observation
The algorithms listed are those currently implemented in the HSM that allow transactions to be signed on the network and do not necessarily cover all the options defined in the network specification. If you have any questions, feel free to contact Dinamo Networks support and ask them.
Then Name Symbol Alg. Signature in HSM Curve Obs
Bitcoin BTC ECDSA secp256k1
Ethereum ETH ECDSA secp256k1
Tether USDT ECDSA secp256k1 token on various networks (e.g. Ethereum, Algorand)
Binance Coin BNB ECDSA secp256k1
image USD Coin USDC ECDSA secp256k1 token
Solana SUN EdDSA edwards25519
XRP XRP ECDSA, EdDSA secp256k1, edwards25519
Terra Classic LUNC ECDSA secp256k1
Cardano ADA EdDSA edwards25519
Avalanche AVAX ECDSA secp256k1
image Dogecoin DOGE ECDSA secp256k1
image Binance USD BUSD ECDSA secp256k1 token
Polkadot DOT ECDSA, EdDSA secp256k1, edwards25519
Shiba Inu SHIB ECDSA secp256k1 token
Wrapped Bitcoin WBTC ECDSA, EdDSA secp256k1, edwards25519 token
Polygon MATIC ECDSA secp256k1
Cronos CRO ECDSA secp256k1
Dai DAI ECDSA secp256k1 token
NEAR Protocol NEAR ECDSA secp256k1
Litecoin LTC ECDSA secp256k1
TRON TRX ECDSA secp256k1
image ApeCoin EPA ECDSA secp256k1 token
Cosmos ATOM ECDSA secp256k1
Bitcoin Cash BCH ECDSA secp256k1
Algorand SOMETHING EdDSA edwards25519
Brazilian Digital Token BRZ ECDSA secp256k1 token
Celo Brazilian Real CREAL ECDSA secp256k1 token
Celo Dollar CUSD ECDSA secp256k1 token
Axie Infinity AXS ECDSA secp256k1 token/coin
Fantom FTM ECDSA secp256k1
Uniswap UNI ECDSA secp256k1 token
Stellar XLM EdDSA edwards25519
Tezos XTZ ECDSA, EdDSA secp256k1, edwards25519
CELO CELO ECDSA secp256k1 token/coin
image Toncoin TON EdDSA edwards25519
Chainlink LINK ECDSA secp256k1 token

The HSM implementation complies with the standards defined in the documentation listed below:

Functions

byte[] bchainSignHash (byte bType, byte bHashMode, byte[] pbHash, String strPk) throws TacException
 Sign a hash using the blockchain module.
 
byte[] bchainGetPubKey (byte bType, String jszId) throws TacException
 Recover a public key from a private key using the blockchain module.
 

Functions

bchainSignHash()

byte[] bchainSignHash ( byte bType,
byte bHashMode,
byte[] pbHash,
String strPk ) throws TacException

Sign a hash using the blockchain module.

Parameters
bTypeType of subscription to be generated. It can be one of the values below.
Value Meaning
TacNDJavaLib.DN_BCHAIN_SIG_DER_ECDSA DER signature, in the format v || DER. SECG!SEC1 strict DER with low S as described in BIP62/66, BIP146, EIP2. With 'v' having a size of 1 byte. 'v' is the parity bit of 'r' and can have the values 0 or 1.
TacNDJavaLib.DN_BCHAIN_SIG_RAW_ECDSA RAW signature, in the format v || r || s. With 'v' having a size of 1 byte and 'r' and 's' each having a size of 32 bytes. 'v' is the parity bit of 'r' and can have the values 0 or 1.
TacNDJavaLib.DN_BCHAIN_SIG_BIP340 Signature BIP340 - Schnorr 64 bytes.
bHashModeHash type.
Value Meaning
TacNDJavaLib.DN_BCHAIN_HASH_BTC_H160 Bitcoin H160.
TacNDJavaLib.DN_BCHAIN_HASH_RIPEMD160 RIPEMD160.
TacNDJavaLib.DN_BCHAIN_HASH_SHA256 SHA256
TacNDJavaLib.DN_BCHAIN_HASH_BTC_SHA256_2X Bitcoin SHA256 2x.
TacNDJavaLib.DN_BCHAIN_HASH_KECCAK256 KECCAK256.
pbHashHash to be signed.
strPkPrivate key identifier.
Return
Signature in the format specified in bType.
Exceptions
TacException

bchainGetPubKey()

byte[] bchainGetPubKey ( byte bType,
String jszId ) throws TacException

Recover a public key from a private key using the blockchain module.

Parameters
bTypeFormat of the public key to be exported. Can be one of the values below.
Value Meaning
TacNDJavaLib.DN_BCHAIN_PBK_SEC1_UNCOMP ECDSA SEC1 uncompressed.
TacNDJavaLib.DN_BCHAIN_PBK_SEC1_COMP ECDSA SEC1 compressed.
TacNDJavaLib.DN_BCHAIN_PBK_BIP340 Schnorr, BIP-340.
TacNDJavaLib.DN_BCHAIN_PBK_ED25519 Ed25519.
TacNDJavaLib.DN_BCHAIN_PBK_AT_ALGORAND Algorand.
TacNDJavaLib.DN_BCHAIN_PBK_BIP32_XPUB BIP32 XPub.
TacNDJavaLib.DN_BCHAIN_PBK_AT_SOL Solana.
jszIdPrivate key identifier.
Return
Public key in the format specified in bType.
Exceptions
TacException