Documentation
¶
Index ¶
- type BitcoinAttestationVerifier
- func (v *BitcoinAttestationVerifier) BitcoinVerifications(t *opentimestamps.Timestamp) (res []BitcoinVerification)
- func (v *BitcoinAttestationVerifier) BitcoinVerificationsManual(t *opentimestamps.Timestamp) []BitcoinVerificationManual
- func (v *BitcoinAttestationVerifier) Verify(t *opentimestamps.Timestamp) (ret *time.Time, err error)
- func (v *BitcoinAttestationVerifier) VerifyAttestation(digest []byte, a *opentimestamps.BitcoinAttestation) (*time.Time, error)
- func (v *BitcoinAttestationVerifier) VerifyManual(t *opentimestamps.Timestamp) ([]BitcoinVerificationManual, error)
- type BitcoinVerification
- type BitcoinVerificationManual
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 ¶
func (v *BitcoinAttestationVerifier) VerifyManual( t *opentimestamps.Timestamp, ) ([]BitcoinVerificationManual, error)
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