external

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package external fetches supplementary data from public blockchains (Stellar Horizon, Bitcoin block explorers) to corroborate proofs against real-world public records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyKeyring

func VerifyKeyring(signingKeys map[string]string, keyringURL string) error

VerifyKeyring checks that all signing keys in the proof match the published keyring.

Types

type BitcoinResult

type BitcoinResult struct {
	Height    int
	Timestamp string // ISO 8601 block timestamp from Blockstream
}

BitcoinResult holds the verification result from the Blockstream API.

func VerifyBitcoinBlock

func VerifyBitcoinBlock(blockHash, network string) (*BitcoinResult, bool, error)

VerifyBitcoinBlock checks the Blockstream API to confirm a Bitcoin block exists. Returns the block height and timestamp, or an error. For regtest, returns a skip indicator.

type KeyringKey

type KeyringKey struct {
	KeyID     string `json:"key_id"`
	PublicKey string `json:"public_key"`
	Sequence  int    `json:"sequence"`
	Active    bool   `json:"active"`
}

KeyringKey is a single entry in the keyring.

type KeyringResponse

type KeyringResponse struct {
	Version string       `json:"version"`
	Keys    []KeyringKey `json:"keys"`
}

KeyringResponse is the shape of /.well-known/keyring.json.

type StellarResult

type StellarResult struct {
	Ledger    int
	Timestamp string // ISO 8601 ledger close timestamp from Horizon
}

StellarResult holds the verification result from the Stellar Horizon API.

func VerifyStellar

func VerifyStellar(transactionHash, expectedMemoHash, network string, expectedLedger int) (*StellarResult, error)

VerifyStellar checks the Stellar Horizon API to confirm the transaction exists, the memo matches, and the ledger number matches the expected value. Returns the ledger number, the transaction timestamp, or an error.

Jump to

Keyboard shortcuts

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