Documentation ¶
Index ¶
- Constants
- Variables
- func Prove(txid Hash256Digest, merkleRoot Hash256Digest, intermediateNodes []byte, ...) bool
- func VerifyHash256Merkle(proof []byte, index uint) bool
- type Hash256Digest
- type Merkle
- type Proof
- func (*Proof) Descriptor() ([]byte, []int)
- func (m *Proof) GetIndex() uint32
- func (m *Proof) GetPath() []byte
- func (m *Proof) GetTxBytes() []byte
- func (m *Proof) Marshal() (dAtA []byte, err error)
- func (m *Proof) MarshalTo(dAtA []byte) (int, error)
- func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Proof) ProtoMessage()
- func (m *Proof) Reset()
- func (m *Proof) Size() (n int)
- func (m *Proof) String() string
- func (m *Proof) Unmarshal(dAtA []byte) error
- func (m *Proof) XXX_DiscardUnknown()
- func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Proof) XXX_Merge(src proto.Message)
- func (m *Proof) XXX_Size() int
- func (m *Proof) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const BitcoinBlockHeaderLen = 80
Variables ¶
Functions ¶
func Prove ¶
func Prove(txid Hash256Digest, merkleRoot Hash256Digest, intermediateNodes []byte, index uint) bool
Prove checks the validity of a merkle proof
func VerifyHash256Merkle ¶
VerifyHash256Merkle checks a merkle inclusion proof's validity. Note that `index` is not a reliable indicator of location within a block.
Types ¶
type Hash256Digest ¶
func Hash256 ¶
func Hash256(in []byte) Hash256Digest
Hash256 implements bitcoin's hash256 (double sha2)
func Hash256MerkleStep ¶
func Hash256MerkleStep(a []byte, b []byte) Hash256Digest
Hash256MerkleStep concatenates and hashes two inputs for merkle proving
type Merkle ¶
type Merkle struct {
// contains filtered or unexported fields
}
Merkle is a wrapper around "github.com/btcsuite/btcd/blockchain" merkle tree. Additionally, it provides a method to generate a merkle proof for a given transaction.
type Proof ¶
type Proof struct { TxBytes []byte `protobuf:"bytes,1,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"` Path []byte `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` }
func (*Proof) Descriptor ¶
func (*Proof) GetTxBytes ¶
func (*Proof) ProtoMessage ¶
func (*Proof) ProtoMessage()
func (*Proof) XXX_DiscardUnknown ¶
func (m *Proof) XXX_DiscardUnknown()
func (*Proof) XXX_Marshal ¶
func (*Proof) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.