veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::AuthenticatedContextInfoContainer Struct Reference

Contains ContextInfoContainer and merkle path which authenticates hash of ContextInfoContainer to a block header. More...

Detailed Description

auto tlmr = getTopLevelMerkleRoot(header);
auto r = sha256d(stateRoot, context.getHash());
if(r == tlmr) {
// valid!
} esle {
// invalid!
}

Definition at line 59 of file context_info_container.hpp.

#include <context_info_container.hpp>

+ Collaboration diagram for altintegration::AuthenticatedContextInfoContainer:

Public Member Functions

bool operator== (const AuthenticatedContextInfoContainer &other) const
 
void toVbkEncoding (WriteStream &w) const
 
size_t estimateSize () const
 
uint256 getTopLevelMerkleRoot () const
 

Static Public Member Functions

static AuthenticatedContextInfoContainer createFromPrevious (const uint256 &stateRoot, const BlockIndex< AltBlock > *prev, const AltChainParams &p)
 
static AuthenticatedContextInfoContainer createFromPrevious (const std::vector< uint8_t > &txRoot, const uint256 &popDataRoot, const BlockIndex< AltBlock > *prev, const AltChainParams &p)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Public Attributes

ContextInfoContainer ctx {}
 
uint256 stateRoot {}
 

Member Function Documentation

◆ createFromPrevious()

static AuthenticatedContextInfoContainer altintegration::AuthenticatedContextInfoContainer::createFromPrevious ( const uint256 stateRoot,
const BlockIndex< AltBlock > *  prev,
const AltChainParams p 
)
static
Parameters
stateRootequals to sha256d(merkle root || pop data merkle root)
previs a pointer to previous block
pparams

◆ operator==()

bool altintegration::AuthenticatedContextInfoContainer::operator== ( const AuthenticatedContextInfoContainer other) const
inline

Definition at line 82 of file context_info_container.hpp.

82 {
83 return ctx == other.ctx && stateRoot == other.stateRoot;
84 }

Member Data Documentation

◆ ctx

ContextInfoContainer altintegration::AuthenticatedContextInfoContainer::ctx {}

Definition at line 60 of file context_info_container.hpp.

◆ stateRoot

uint256 altintegration::AuthenticatedContextInfoContainer::stateRoot {}

Definition at line 65 of file context_info_container.hpp.


The documentation for this struct was generated from the following file: