client

package
v0.0.0-...-ce58374 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinAttestationVerifier

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

A BitcoinAttestationVerifier uses a bitcoin RPC connection to verify bitcoin headers.

func NewBitcoinAttestationVerifier

func NewBitcoinAttestationVerifier(
	c *rpcclient.Client,
) *BitcoinAttestationVerifier

func (*BitcoinAttestationVerifier) BitcoinVerifications

func (v *BitcoinAttestationVerifier) BitcoinVerifications(
	t *opentimestamps.Timestamp,
) (res []BitcoinVerification)

BitcoinVerifications returns the all bitcoin attestation results for the timestamp.

func (*BitcoinAttestationVerifier) BitcoinVerificationsManual

func (v *BitcoinAttestationVerifier) BitcoinVerificationsManual(
	t *opentimestamps.Timestamp,
) []BitcoinVerificationManual

BitcoinVerificationsManual returns all bitcoin attestation pairs (height, expected_merkle_root)

func (*BitcoinAttestationVerifier) Verify

func (v *BitcoinAttestationVerifier) Verify(
	t *opentimestamps.Timestamp,
) (ret *time.Time, err error)

Verify returns the earliest bitcoin-attested time, or nil if none can be found or verified successfully.

func (*BitcoinAttestationVerifier) VerifyAttestation

func (v *BitcoinAttestationVerifier) VerifyAttestation(
	digest []byte, a *opentimestamps.BitcoinAttestation,
) (*time.Time, error)

VerifyAttestation checks a BitcoinAttestation using a given hash digest. It returns the time of the block if the verification succeeds, an error otherwise.

func (*BitcoinAttestationVerifier) VerifyManual

Verify returns pairs (height, expected_merkle_root) or nil.

type BitcoinVerification

type BitcoinVerification struct {
	Timestamp       *opentimestamps.Timestamp
	Attestation     *opentimestamps.BitcoinAttestation
	AttestationTime *time.Time
	Error           error
}

A BitcoinVerification is the result of verifying a BitcoinAttestation

type BitcoinVerificationManual

type BitcoinVerificationManual struct {
	// Attestation time is the block header timestamp
	Height             uint64
	ExpectedMerkleRoot []byte
}

A BitcoinVerificationManual holds data needed for manual verification

Jump to

Keyboard shortcuts

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