Categorygithub.com/beyond-blockchain/bbclib-go
modulepackage
1.6.0
Repository: https://github.com/beyond-blockchain/bbclib-go.git
Documentation: pkg.go.dev

# README

bbclib-go

License Build Status Go Report Card Coverage Status Maintainability

Golang implementation of bbc1.core.bbclib and bbc1.core.libs modules in https://github.com/beyond-blockchain/bbc1. This reposigory is originally from https://github.com/quvox/bbclib-go

Features

Usage

import "github.com/beyond-blockchain/bbclib-go"

An example source code is in example/.

Install (step by step)

go get -u github.com/beyond-blockchain/bbclib-go

NOTE: example/ directory includes a sample code for this module.

# Packages

No description provided by the author

# Functions

AddEventAssetBodyObject sets an object (map[string]interface{}) to a BBcAsset object in a BBcEvent object and then, add it in a BBcTransaction object (old style, only for backward compatibility).
AddEventAssetBodyString sets a string to a BBcAsset object in a BBcEvent object and then, add it in a BBcTransaction object (old style, only for backward compatibility).
AddEventAssetFile sets a file digest to a BBcAsset object in a BBcEvent object and then, add it in a BBcTransaction object (old style, only for backward compatibility).
AddPointerInRelation creates and includes a BBcPointer object in BBcRelation (old style, only for backward compatibility).
AddReference creates and includes a BBcReference object in a BBcTransaction object (old style, only for backward compatibility).
AddRelationAssetBodyObject sets an object (map[string]interface{}) in BBcAsset in BBcRelation, convert the info into msgpack, and add it in a BBcTransaction object (old style, only for backward compatibility).
AddRelationAssetBodyString sets a string in BBcAsset in BBcRelation and add it to a BBcTransaction object (old style, only for backward compatibility).
AddRelationAssetFile sets a file digest to BBcAsset in BBcRelation and add it to a BBcTransaction object (old style, only for backward compatibility).
AddRelationAssetHash sets assetIDs in BBcAssetHash in BBcRelation and add it to a BBcTransaction object (old style, only for backward compatibility).
AddRelationAssetRawBody sets a data in BBcAssetRaw in BBcRelation and add it to a BBcTransaction object (old style, only for backward compatibility).
AddRelationPointer creates and includes a BBcPointer object in BBcRelation and then, add it in a BBcTransaction object (old style, only for backward compatibility).
Configure various ID length.
Configure all kind of ID length with the same value.
Deserialize BBcTransaction data with header.
GenerateKeypair generates a new Key pair object with new private key and public key.
Get2byte returns a uint16 value from the buffer.
Get4byte returns a uint32 value from the buffer.
Get8byte returns a int64 value from the buffer.
GetBigInt returns a ID data from the buffer.
GetBytes returns binary data with specified length from the buffer.
GetIdentifier returns a random byte data with specified length (seed string ais used).
GetIdentifierWithTimestamp returns a random byte data with specified length (seed string and timestamp are used).
GetRandomValue returns a random byte data with specified length.
MakeRelationWithAsset is a utility for making simple BBcTransaction object with BBcRelation with BBcAsset (old style, only for backward compatibility).
MakeTransaction is a utility for making simple BBcTransaction object with BBcEvent, BBcRelation or/and BBcWitness.
Put2byte sets uint16 in the buffer for packing.
Put4byte sets a uint32 in the buffer for packing.
Put8byte sets a int64 in the buffer for packing.
PutBigInt sets a ID data in the buffer for packing.
RecoverSignatureObject is a utility for recovering signature data into BBcSignature object.
Serialize BBcTransaction object into packed data formatType = 0x0000: Packed data is simply used for serialized data.
SignToTransaction signs the transaction and append the BBcSignature object to it (old style, only for backward compatibility).
Copy new config in refer to main.
VerifyBBcSignature verifies a given digest with BBcSignature object.
ZlibCompress compresses the given data using zlib.
ZlibDecompress decompresses the given data using zlib.

# Constants

Supported ECC curve type is Prime-256v1 only.
The length of DomainID must be 256-bit in any domain.
Header values for serialized data.
Header values for serialized data.
KeyTypeEcdsaSECP256k1 = 1 // unsported.
Supported ECC curve type is Prime-256v1 only.

# Variables

No description provided by the author

# Structs

BBcAsset definition "IDLength" and "digestCalculating" are not included in a packed data.
BBcAssetHash definition "IDLength" is not included in a packed data.
BBcAssetRaw definition "IDLength" is not included in a packed data.
BBcCrossRef definition CrossRef stands for CrossReference, which holds information in other domain for inter-domain collaboration of transaction authenticity.
BBcEvent definition BBcEvent expresses an output of UTXO (Unspent Transaction Output) structure.
No description provided by the author
BBcPointer definition BBcPointer(s) are included in BBcRelation object.
BBcReference definition The BBcReference is an input of UTXO (Unspent Transaction Output) structure and this object must accompanied by a BBcEvent object because it is an output of UTXO.
BBcRelation definition The BBcRelation holds the asset (by BBcAsset) and the relationship with the other transaction/asset (by BBcPointer).
BBcSignature definition The BBcSignature holds public key and signature.
BBcTransaction definition BBcTransaction is just a container of various objects.
BBcWitness definition The BBcWitness has the mapping info between the userIDs and BBcSignature objects.
KeyPair definition A KeyPair object hold a pair of private key and public key.