Documentation ¶
Overview ¶
Package evidences defines blockchainfossilizer evidence types.
Index ¶
Constants ¶
View Source
const ( // BlockchainFossilizerName is the name used as the blockchain proof backend. BlockchainFossilizerName = "blockchainfossilizer" // Version1_0_0 uses canonical-JSON to serialize a timestamped hash along // with a transaction ID. Version1_0_0 = "1.0.0" // Version used for new blockchain proofs. Version = Version1_0_0 )
Variables ¶
View Source
var ( ErrInvalidBackend = errors.New("backend is not blockchain") ErrUnknownVersion = errors.New("unknown evidence version") )
Errors used by the blockchain evidence.
Functions ¶
This section is empty.
Types ¶
type BlockchainProof ¶
type BlockchainProof struct { Data []byte `json:"data"` Timestamp int64 `json:"timestamp"` TransactionID types.TransactionID `json:"txid"` }
BlockchainProof implements the chainscript.Proof interface. It contains the data that was stored on the blockchain and the ID of the transaction that stored that data. It also includes a server timestamp (not trusted).
func UnmarshalProof ¶
func UnmarshalProof(e *chainscript.Evidence) (*BlockchainProof, error)
UnmarshalProof unmarshals the blockchain proof contained in an evidence.
func (*BlockchainProof) Evidence ¶
func (p *BlockchainProof) Evidence(provider string) (*chainscript.Evidence, error)
Evidence wraps the proof in a versioned evidence.
func (*BlockchainProof) Time ¶
func (p *BlockchainProof) Time() uint64
Time returns the server timestamp.
func (*BlockchainProof) Verify ¶
func (p *BlockchainProof) Verify(data interface{}) bool
Verify returns true if the proof is correct for the given data.
Click to show internal directories.
Click to hide internal directories.