protocol

package
v0.0.0-...-c6cf726 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BLOCK_HASH_LEN = 32
	HEIGHT_LEN     = 4
	//All fixed sizes form the Block struct are 254
	MIN_BLOCKSIZE           = 393 + crypto.COMM_PROOF_LENGTH + 1 // = 650 bytes
	MIN_BLOCKHEADER_SIZE    = 104
	BLOOM_FILTER_ERROR_RATE = 0.1
)
View Source
const (
	CONFIGTX_SIZE = 83

	BLOCK_SIZE_ID           = 1
	DIFF_INTERVAL_ID        = 2
	FEE_MINIMUM_ID          = 3
	BLOCK_INTERVAL_ID       = 4
	BLOCK_REWARD_ID         = 5
	STAKING_MINIMUM_ID      = 6
	WAITING_MINIMUM_ID      = 7
	ACCEPTANCE_TIME_DIFF_ID = 8
	SLASHING_WINDOW_SIZE_ID = 9
	SLASHING_REWARD_ID      = 10

	MIN_BLOCK_SIZE = 1000      //1KB
	MAX_BLOCK_SIZE = 100000000 //100MB

	MIN_DIFF_INTERVAL = 3 //amount in seconds
	MAX_DIFF_INTERVAL = 9223372036854775807

	MIN_FEE_MINIMUM = 0
	MAX_FEE_MINIMUM = 9223372036854775807

	MIN_BLOCK_INTERVAL = 3     //30 seconds
	MAX_BLOCK_INTERVAL = 86400 //24 hours

	MIN_BLOCK_REWARD = 0
	MAX_BLOCK_REWARD = 1152921504606846976 //2^60

	MIN_STAKING_MINIMUM = 5                   //minimum number of coins for staking
	MAX_STAKING_MINIMUM = 9223372036854775807 //2^60

	MIN_WAITING_TIME = 0 //number of blocks that must a new validator must wait before it can start validating
	MAX_WAITING_TIME = 100000

	MIN_ACCEPTANCE_TIME_DIFF = 0  //semi-synchronous time difference between local clock of validators
	MAX_ACCEPTANCE_TIME_DIFF = 60 //1min

	MIN_SLASHING_WINDOW_SIZE = 0     //window size where a node has to commit itself to a competing branch in case of a fork
	MAX_SLASHING_WINDOW_SIZE = 10000 //1000 Blocks (totally random)

	MIN_SLASHING_REWARD = 0                   // reward for providing a valid slashing proof
	MAX_SLASHING_REWARD = 1152921504606846976 //2^60
)
View Source
const (
	TRANSACTION_HASH_SIZE     = 32
	TRANSACTION_SENDER_SIZE   = 32
	TRANSACTION_RECEIVER_SIZE = 32
)
View Source
const (
	ACCOUNT_ADDRESS_SIZE = 64
)
View Source
const (
	ACCTX_SIZE = 169
)
View Source
const (
	AGGTX_SIZE = 85 //Only constant Values --> Without To, From & AggregatedTxSlice
)
View Source
const (
	FUNDSTX_SIZE = 246
)
View Source
const (
	STAKETX_SIZE = 106 + crypto.COMM_KEY_LENGTH
)
View Source
const UPDATE_TX_SIZE = 42

Variables

This section is empty.

Functions

func Decode

func Decode(encodedData []byte, sliceSize int) (data [][]byte)

func Encode

func Encode(data [][]byte, sliceSize int) []byte

func RandomBytes

func RandomBytes() []byte

func RandomBytesWithLength

func RandomBytesWithLength(length int) []byte

func SerializeHashContent

func SerializeHashContent(data interface{}) (hash [32]byte)

Serializes the input and returns the SHA3 hash function applied on ths input

Types

type AccTx

type AccTx struct {
	Header            byte
	Fee               uint64
	Issuer            [32]byte
	PubKey            [64]byte
	Sig               [64]byte
	Contract          []byte
	ContractVariables []ByteArray
	Parameters        *crypto.ChameleonHashParameters  // Chameleon hash parameters associated with this account.
	CheckString       *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data              []byte
}

func ConstrAccTx

func ConstrAccTx(
	header byte,
	fee uint64,
	issuer [32]byte,
	address [64]byte,
	contract []byte,
	contractVariables []ByteArray,
	parameters *crypto.ChameleonHashParameters,
	checkString *crypto.ChameleonHashCheckString,
	data []byte,
) (tx *AccTx, err error)

func (*AccTx) ChameleonHash

func (tx *AccTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

Returns the chameleon hash but takes the chameleon hash parameters as input. This method should be called in the context of bazo-client as the client doesn't maintain a state holding the chameleon hash parameters of each account.

func (*AccTx) Decode

func (*AccTx) Decode(encoded []byte) (tx *AccTx)

func (*AccTx) Encode

func (tx *AccTx) Encode() []byte

func (*AccTx) GetCheckString

func (tx *AccTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*AccTx) GetData

func (tx *AccTx) GetData() []byte

func (*AccTx) Hash

func (tx *AccTx) Hash() [32]byte

func (*AccTx) Receiver

func (tx *AccTx) Receiver() [32]byte

func (*AccTx) SHA3

func (tx *AccTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*AccTx) Sender

func (tx *AccTx) Sender() [32]byte

func (*AccTx) SetCheckString

func (tx *AccTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*AccTx) SetData

func (tx *AccTx) SetData(data []byte)

func (*AccTx) SetSignature

func (tx *AccTx) SetSignature(signature [64]byte)

func (*AccTx) Size

func (tx *AccTx) Size() uint64

func (AccTx) String

func (tx AccTx) String() string

func (*AccTx) TxFee

func (tx *AccTx) TxFee() uint64

type Account

type Account struct {
	Address            [ACCOUNT_ADDRESS_SIZE]byte      // 64 Byte
	Issuer             [32]byte                        // 32 Byte
	Balance            uint64                          // 8 Byte
	TxCnt              uint32                          // 4 Byte
	IsStaking          bool                            // 1 Byte
	CommitmentKey      [crypto.COMM_KEY_LENGTH]byte    // represents the modulus N of the RSA public key
	StakingBlockHeight uint32                          // 4 Byte
	Contract           []byte                          // Arbitrary length
	ContractVariables  []ByteArray                     // Arbitrary length
	Parameters         *crypto.ChameleonHashParameters // Parameter set for chameleon hashing
}

func NewAccount

func NewAccount(
	address [ACCOUNT_ADDRESS_SIZE]byte,
	issuer [32]byte,
	balance uint64,
	isStaking bool,
	commitmentKey [crypto.COMM_KEY_LENGTH]byte,
	contract []byte,
	contractVariables []ByteArray,
	parameters *crypto.ChameleonHashParameters,
) Account

func (*Account) Decode

func (*Account) Decode(encoded []byte) (acc *Account)

func (*Account) Encode

func (acc *Account) Encode() []byte

func (*Account) Hash

func (acc *Account) Hash() [32]byte

func (Account) String

func (acc Account) String() string

type AggTx

type AggTx struct {
	Amount            uint64
	Fee               uint64
	From              [][32]byte
	To                [][32]byte
	AggregatedTxSlice [][32]byte
	Aggregated        bool
	Block             [32]byte //This saves the blockHashWithoutTransactions into which the transaction was usually validated. Needed for rollback.
	MerkleRoot        [32]byte
	CheckString       *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data              []byte
}

func ConstrAggTx

func ConstrAggTx(amount uint64, fee uint64, from [][32]byte, to [][32]byte, transactions [][32]byte) (tx *AggTx, err error)

func (*AggTx) ChameleonHash

func (tx *AggTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

As we don't use chameleon hashing on config tx, we simply return an SHA3 hash

func (*AggTx) Decode

func (*AggTx) Decode(encodedTx []byte) *AggTx

func (*AggTx) Encode

func (tx *AggTx) Encode() (encodedTx []byte)

when we serialize the struct with binary.Write, unexported field get serialized as well, undesired behavior. Therefore, writing own encoder/decoder

func (*AggTx) GetCheckString

func (tx *AggTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*AggTx) GetData

func (tx *AggTx) GetData() []byte

func (*AggTx) Hash

func (tx *AggTx) Hash() (hash [32]byte)

func (*AggTx) Receiver

func (tx *AggTx) Receiver() [32]byte

func (*AggTx) SHA3

func (tx *AggTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*AggTx) Sender

func (tx *AggTx) Sender() [32]byte

func (*AggTx) SetCheckString

func (tx *AggTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*AggTx) SetData

func (tx *AggTx) SetData(data []byte)

func (*AggTx) SetSignature

func (tx *AggTx) SetSignature(signature [64]byte)

func (*AggTx) Size

func (tx *AggTx) Size() uint64

func (AggTx) String

func (tx AggTx) String() string

func (*AggTx) TxFee

func (tx *AggTx) TxFee() uint64

type Block

type Block struct {
	//Header
	Header            byte
	Hash              [32]byte
	PrevHash          [32]byte
	HashWithoutTx     [32]byte //valid hash once all tx are aggregated
	PrevHashWithoutTx [32]byte //valid hash of ancestor once all tx are aggregated
	NrElementsBF      uint16
	BloomFilter       *bloom.BloomFilter //8 byte
	Height            uint32
	Beneficiary       [32]byte
	Aggregated        bool   //Indicates if All transactions are aggregated with a boolean.
	NrUpdates         uint16 // Indicates how many txs of this block were updated.

	//Body
	Nonce                          [8]byte
	Timestamp                      int64
	MerkleRoot                     [32]byte
	NrAccTx                        uint16
	NrConfigTx                     uint8
	NrFundsTx                      uint16
	NrStakeTx                      uint16
	NrAggTx                        uint16
	NrUpdateTx                     uint16
	SlashedAddress                 [32]byte
	CommitmentProof                [crypto.COMM_PROOF_LENGTH]byte
	ConflictingBlockHash1          [32]byte
	ConflictingBlockHash2          [32]byte
	ConflictingBlockHashWithoutTx1 [32]byte
	ConflictingBlockHashWithoutTx2 [32]byte
	StateCopy                      map[[32]byte]*Account //won't be serialized, just keeping track of local state changes

	AccTxData    [][32]byte
	FundsTxData  [][32]byte
	ConfigTxData [][32]byte
	StakeTxData  [][32]byte
	AggTxData    [][32]byte
	UpdateTxData [][32]byte
}

func NewBlock

func NewBlock(prevHash [32]byte, height uint32) *Block

func (*Block) Decode

func (block *Block) Decode(encoded []byte) (b *Block)

func (*Block) Encode

func (block *Block) Encode() []byte

func (*Block) EncodeHeader

func (block *Block) EncodeHeader() []byte

func (*Block) GetBloomFilterSize

func (block *Block) GetBloomFilterSize() uint64

func (*Block) GetBodySize

func (block *Block) GetBodySize() uint64

func (*Block) GetHeaderSize

func (block *Block) GetHeaderSize() uint64

func (*Block) GetSize

func (block *Block) GetSize() uint64

func (*Block) GetTxDataSize

func (block *Block) GetTxDataSize() uint64

func (*Block) HashBlock

func (block *Block) HashBlock() [32]byte

func (*Block) HashBlockWithoutMerkleRoot

func (block *Block) HashBlockWithoutMerkleRoot() [32]byte

func (*Block) InitBloomFilter

func (block *Block) InitBloomFilter(txPubKeys [][32]byte)

func (Block) String

func (block Block) String() string

type ByteArray

type ByteArray []byte

type Change

type Change struct {
	// contains filtered or unexported fields
}

func NewChange

func NewChange(index int, value []byte) Change

func (*Change) GetChange

func (c *Change) GetChange() (int, []byte)

type ConfigTx

type ConfigTx struct {
	Header      byte
	Id          uint8
	Payload     uint64
	Fee         uint64
	TxCnt       uint8
	Sig         [64]byte
	CheckString *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data        []byte
}

func ConstrConfigTx

func ConstrConfigTx(header byte, id uint8, payload uint64, fee uint64, txCnt uint8, rootPrivKey *ecdsa.PrivateKey) (tx *ConfigTx, err error)

func (*ConfigTx) ChameleonHash

func (tx *ConfigTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

As we don't use chameleon hashing on config tx, we simply return an SHA3 hash

func (*ConfigTx) Decode

func (*ConfigTx) Decode(encodedTx []byte) (tx *ConfigTx)

func (*ConfigTx) Encode

func (tx *ConfigTx) Encode() (encodedTx []byte)

func (*ConfigTx) GetCheckString

func (tx *ConfigTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*ConfigTx) GetData

func (tx *ConfigTx) GetData() []byte

func (*ConfigTx) Hash

func (tx *ConfigTx) Hash() (hash [32]byte)

func (*ConfigTx) Receiver

func (tx *ConfigTx) Receiver() [32]byte

func (*ConfigTx) SHA3

func (tx *ConfigTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*ConfigTx) Sender

func (tx *ConfigTx) Sender() [32]byte

func (*ConfigTx) SetCheckString

func (tx *ConfigTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*ConfigTx) SetData

func (tx *ConfigTx) SetData(data []byte)

func (*ConfigTx) SetSignature

func (tx *ConfigTx) SetSignature(signature [64]byte)

func (*ConfigTx) Size

func (tx *ConfigTx) Size() uint64

func (ConfigTx) String

func (tx ConfigTx) String() string

func (*ConfigTx) TxFee

func (tx *ConfigTx) TxFee() uint64

type Context

type Context struct {
	Account

	FundsTx
	// contains filtered or unexported fields
}

func NewContext

func NewContext(account Account, fundsTx FundsTx) *Context

func (*Context) GetAddress

func (c *Context) GetAddress() [64]byte

func (*Context) GetAmount

func (c *Context) GetAmount() uint64

func (*Context) GetBalance

func (c *Context) GetBalance() uint64

func (*Context) GetContract

func (c *Context) GetContract() []byte

func (*Context) GetContractVariable

func (c *Context) GetContractVariable(index int) ([]byte, error)

func (*Context) GetFee

func (c *Context) GetFee() uint64

func (*Context) GetIssuer

func (c *Context) GetIssuer() [32]byte

func (*Context) GetSender

func (c *Context) GetSender() [32]byte

func (*Context) GetSig1

func (c *Context) GetSig1() [64]byte

func (*Context) GetTransactionData

func (c *Context) GetTransactionData() []byte

func (*Context) PersistChanges

func (c *Context) PersistChanges()

func (*Context) SetContractVariable

func (c *Context) SetContractVariable(index int, value []byte) error

type FundsTx

type FundsTx struct {
	Header      byte
	Amount      uint64
	Fee         uint64
	TxCnt       uint32
	From        [32]byte
	To          [32]byte
	Sig1        [64]byte
	Sig2        [64]byte
	Aggregated  bool
	Block       [32]byte                         // This saves the blockHashWithoutTransactions into which the transaction was usually validated. Needed for rollback.
	CheckString *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data        []byte
}

func ConstrFundsTx

func ConstrFundsTx(
	header byte,
	amount uint64,
	fee uint64,
	txCnt uint32,
	from, to [32]byte,
	checkString *crypto.ChameleonHashCheckString,
	data []byte,
) (tx *FundsTx, err error)

func (*FundsTx) ChameleonHash

func (tx *FundsTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

Returns the chameleon hash but takes the chameleon hash parameters as input. This method should be called in the context of bazo-client as the client doesn't maintain a copy of the chameleon hash parameters of each account.

func (*FundsTx) Decode

func (*FundsTx) Decode(encodedTx []byte) *FundsTx

func (*FundsTx) Encode

func (tx *FundsTx) Encode() (encodedTx []byte)

when we serialize the struct with binary.Write, unexported field get serialized as well, undesired behavior. Therefore, writing own encoder/decoder

func (*FundsTx) GetCheckString

func (tx *FundsTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*FundsTx) GetData

func (tx *FundsTx) GetData() []byte

func (*FundsTx) Hash

func (tx *FundsTx) Hash() (hash [32]byte)

Returns the chameleon hash without chameleon hash parameters as input. This can be called in the context of bazo-miner as the miner keeps a state with the chameleon hash parameters of all accounts.

func (*FundsTx) Receiver

func (tx *FundsTx) Receiver() [32]byte

func (*FundsTx) SHA3

func (tx *FundsTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*FundsTx) Sender

func (tx *FundsTx) Sender() [32]byte

func (*FundsTx) SetCheckString

func (tx *FundsTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*FundsTx) SetData

func (tx *FundsTx) SetData(data []byte)

func (*FundsTx) SetSignature

func (tx *FundsTx) SetSignature(signature [64]byte)

func (*FundsTx) Size

func (tx *FundsTx) Size() uint64

func (FundsTx) String

func (tx FundsTx) String() string

func (*FundsTx) TxFee

func (tx *FundsTx) TxFee() uint64

type MerkleTree

type MerkleTree struct {
	Root *Node

	Leafs []*Node
	// contains filtered or unexported fields
}

MerkleTree is the container for the tree. It holds a pointer to the root of the tree, a list of pointers to the leaf nodes, and the merkle root.

func BuildAggTxMerkleTree

func BuildAggTxMerkleTree(txHashes [][32]byte) *MerkleTree

func BuildMerkleTree

func BuildMerkleTree(b *Block) *MerkleTree

func (*MerkleTree) MerkleRoot

func (m *MerkleTree) MerkleRoot() [32]byte

MerkleRoot returns the unverified Merkle Root (hash of the root node) of the tree.

func (*MerkleTree) String

func (m *MerkleTree) String() string

String returns a string representation of the tree. Only leaf nodes are included in the output.

func (*MerkleTree) VerifyTree

func (m *MerkleTree) VerifyTree() bool

VerifyTree verify tree validates the hashes at each level of the tree and returns true if the resulting hash at the root of the tree matches the resulting root hash; returns false otherwise.

type Node

type Node struct {
	Parent *Node
	Left   *Node
	Right  *Node

	Hash [32]byte
	// contains filtered or unexported fields
}

Node represents a node, root, or leaf in the tree. It stores pointers to its immediate relationships, a hash, the content stored if it is a leaf, and other metadata.

func GetIntermediate

func GetIntermediate(leaf *Node) (intermediate []*Node, err error)

VerifyContent indicates whether a given content is in the tree and the hashes are valid for that content. Returns true if the expected Merkle Root is equivalent to the Merkle root calculated on the critical path for a given content. Returns true if valid and false otherwise.

func GetLeaf

func GetLeaf(merkleTree *MerkleTree, leafHash [32]byte) *Node

type StakeTx

type StakeTx struct {
	Header        byte                             // 1 Byte
	Fee           uint64                           // 8 Byte
	IsStaking     bool                             // 1 Byte
	Account       [32]byte                         // 32 Byte
	Sig           [64]byte                         // 64 Byte
	CommitmentKey [crypto.COMM_KEY_LENGTH]byte     // the modulus N of the RSA public key
	CheckString   *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data          []byte
}

func ConstrStakeTx

func ConstrStakeTx(header byte, fee uint64, isStaking bool, account [32]byte, signKey *ecdsa.PrivateKey, commPubKey *rsa.PublicKey) (tx *StakeTx, err error)

func (*StakeTx) ChameleonHash

func (tx *StakeTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

As we don't use chameleon hashing on config tx, we simply return an SHA3 hash

func (*StakeTx) Decode

func (*StakeTx) Decode(encodedTx []byte) (tx *StakeTx)

func (*StakeTx) Encode

func (tx *StakeTx) Encode() (encodedTx []byte)

when we serialize the struct with binary.Write, unexported field get serialized as well, undesired behavior. Therefore, writing own encoder/decoder

func (*StakeTx) GetCheckString

func (tx *StakeTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*StakeTx) GetData

func (tx *StakeTx) GetData() []byte

func (*StakeTx) Hash

func (tx *StakeTx) Hash() (hash [32]byte)

func (*StakeTx) Receiver

func (tx *StakeTx) Receiver() [32]byte

func (*StakeTx) SHA3

func (tx *StakeTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*StakeTx) Sender

func (tx *StakeTx) Sender() [32]byte

func (*StakeTx) SetCheckString

func (tx *StakeTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*StakeTx) SetData

func (tx *StakeTx) SetData(data []byte)

func (*StakeTx) SetSignature

func (tx *StakeTx) SetSignature(signature [64]byte)

func (*StakeTx) Size

func (tx *StakeTx) Size() uint64

func (StakeTx) String

func (tx StakeTx) String() string

func (*StakeTx) TxFee

func (tx *StakeTx) TxFee() uint64

type Transaction

type Transaction interface {
	Hash() [TRANSACTION_HASH_SIZE]byte
	ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte
	SHA3() [32]byte

	Encode() []byte
	//Decoding is not listed here, because it returns a different type for each tx (return value Transaction itself
	//is apparently not allowed)
	TxFee() uint64
	Size() uint64
	Sender() [TRANSACTION_SENDER_SIZE]byte
	Receiver() [TRANSACTION_RECEIVER_SIZE]byte
	String() string
	SetData(data []byte) // Set the data field to the new value
	GetData() []byte
	SetCheckString(checkString *crypto.ChameleonHashCheckString)
	GetCheckString() *crypto.ChameleonHashCheckString
	SetSignature(signature [64]byte)
}

type UpdateTx

type UpdateTx struct {
	Fee                   uint64
	TxToUpdateHash        [32]byte                         // Hash of the tx to be updated.
	TxToUpdateCheckString *crypto.ChameleonHashCheckString // New Chameleon hash check string for the tx to be updated.
	TxToUpdateData        []byte                           // Holds the data to be updated on the TxToUpdate's data field.
	Issuer                [32]byte                         // Address of the issuer of the update request.
	Sig                   [64]byte                         // Signature of the issuer of the update request.
	CheckString           *crypto.ChameleonHashCheckString // Chameleon hash check string associated with this tx.
	Data                  []byte                           // Data field for user-related data.
}

func ConstrUpdateTx

func ConstrUpdateTx(
	fee uint64,
	txToUpdateHash [32]byte,
	txToUpdateCheckString *crypto.ChameleonHashCheckString,
	txToUpdateData []byte,
	issuer [32]byte,
	checkString *crypto.ChameleonHashCheckString,
	data []byte,
) (tx *UpdateTx, err error)

func (*UpdateTx) ChameleonHash

func (tx *UpdateTx) ChameleonHash(parameters *crypto.ChameleonHashParameters) [32]byte

Returns the chameleon hash but takes the chameleon hash parameters as input. This method should be called in the context of bazo-client as the client doesn't maintain a state holding the chameleon hash parameters of each account.

func (*UpdateTx) Decode

func (*UpdateTx) Decode(encodedTx []byte) *UpdateTx

func (*UpdateTx) Encode

func (tx *UpdateTx) Encode() (encodedTx []byte)

func (*UpdateTx) GetCheckString

func (tx *UpdateTx) GetCheckString() *crypto.ChameleonHashCheckString

func (*UpdateTx) GetData

func (tx *UpdateTx) GetData() []byte

func (*UpdateTx) Hash

func (tx *UpdateTx) Hash() (hash [32]byte)

func (*UpdateTx) Receiver

func (tx *UpdateTx) Receiver() [32]byte

func (*UpdateTx) SHA3

func (tx *UpdateTx) SHA3() [32]byte

Returns SHA3 hash over the tx content

func (*UpdateTx) Sender

func (tx *UpdateTx) Sender() [32]byte

func (*UpdateTx) SetCheckString

func (tx *UpdateTx) SetCheckString(checkString *crypto.ChameleonHashCheckString)

func (*UpdateTx) SetData

func (tx *UpdateTx) SetData(data []byte)

func (*UpdateTx) SetSignature

func (tx *UpdateTx) SetSignature(signature [64]byte)

func (*UpdateTx) Size

func (tx *UpdateTx) Size() uint64

func (UpdateTx) String

func (tx UpdateTx) String() string

func (*UpdateTx) TxFee

func (tx *UpdateTx) TxFee() uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL