Documentation ¶
Index ¶
- func BlockHash(block *externalapi.DomainBlock) *externalapi.DomainHash
- func CalculateSignatureHashECDSA(tx *externalapi.DomainTransaction, inputIndex int, hashType SigHashType, ...) (*externalapi.DomainHash, error)
- func CalculateSignatureHashSchnorr(tx *externalapi.DomainTransaction, inputIndex int, hashType SigHashType, ...) (*externalapi.DomainHash, error)
- func HeaderHash(header externalapi.BaseBlockHeader) *externalapi.DomainHash
- func TransactionHash(tx *externalapi.DomainTransaction) *externalapi.DomainHash
- func TransactionID(tx *externalapi.DomainTransaction) *externalapi.DomainTransactionID
- func TransactionIDs(txs []*externalapi.DomainTransaction) []*externalapi.DomainTransactionID
- type SigHashType
- type SighashReusedValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockHash ¶
func BlockHash(block *externalapi.DomainBlock) *externalapi.DomainHash
BlockHash returns the given block's hash
func CalculateSignatureHashECDSA ¶ added in v0.10.0
func CalculateSignatureHashECDSA(tx *externalapi.DomainTransaction, inputIndex int, hashType SigHashType, reusedValues *SighashReusedValues) (*externalapi.DomainHash, error)
CalculateSignatureHashECDSA will, given a script and hash type calculate the signature hash to be used for signing and verification for ECDSA. This returns error only if one of the provided parameters are consensus-invalid.
func CalculateSignatureHashSchnorr ¶ added in v0.10.0
func CalculateSignatureHashSchnorr(tx *externalapi.DomainTransaction, inputIndex int, hashType SigHashType, reusedValues *SighashReusedValues) (*externalapi.DomainHash, error)
CalculateSignatureHashSchnorr will, given a script and hash type calculate the signature hash to be used for signing and verification for Schnorr. This returns error only if one of the provided parameters are consensus-invalid.
func HeaderHash ¶
func HeaderHash(header externalapi.BaseBlockHeader) *externalapi.DomainHash
HeaderHash returns the given header's hash
func TransactionHash ¶
func TransactionHash(tx *externalapi.DomainTransaction) *externalapi.DomainHash
TransactionHash returns the transaction hash.
func TransactionID ¶
func TransactionID(tx *externalapi.DomainTransaction) *externalapi.DomainTransactionID
TransactionID generates the Hash for the transaction without the signature script and payload field.
func TransactionIDs ¶ added in v0.11.0
func TransactionIDs(txs []*externalapi.DomainTransaction) []*externalapi.DomainTransactionID
TransactionIDs converts the provided slice of DomainTransactions to a corresponding slice of TransactionIDs
Types ¶
type SigHashType ¶ added in v0.10.0
type SigHashType uint8
SigHashType represents hash type bits at the end of a signature.
const ( SigHashAll SigHashType = 0b00000001 SigHashNone SigHashType = 0b00000010 SigHashSingle SigHashType = 0b00000100 SigHashAnyOneCanPay SigHashType = 0b10000000 // SigHashMask defines the number of bits of the hash type which is used // to identify which outputs are signed. SigHashMask = 0b00000111 )
Hash type bits from the end of a signature.
func (SigHashType) IsStandardSigHashType ¶ added in v0.10.0
func (sht SigHashType) IsStandardSigHashType() bool
IsStandardSigHashType returns true if sht represents a standard SigHashType
type SighashReusedValues ¶ added in v0.10.0
type SighashReusedValues struct {
// contains filtered or unexported fields
}
SighashReusedValues holds all fields used in the calculation of a transaction's sigHash, that are the same for all transaction inputs. Reuse of such values prevents the quadratic hashing problem.