Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Friends | List of all members
miniscript::internal::InputStack Struct Reference

An object representing a sequence of witness stack elements. More...

#include <miniscript.h>

Public Member Functions

 InputStack ()
 Construct an empty stack (valid). More...
 
 InputStack (std::vector< unsigned char > in)
 Construct a valid single-element stack (with an element up to 75 bytes). More...
 
InputStackSetAvailable (Availability avail)
 Change availability. More...
 
InputStackSetWithSig ()
 Mark this input stack as having a signature. More...
 
InputStackSetNonCanon ()
 Mark this input stack as non-canonical (known to not be necessary in non-malleable satisfactions). More...
 
InputStackSetMalleable (bool x=true)
 Mark this input stack as malleable. More...
 

Public Attributes

Availability available = Availability::YES
 Whether this stack is valid for its intended purpose (satisfaction or dissatisfaction of a Node). More...
 
bool has_sig = false
 Whether this stack contains a digital signature. More...
 
bool malleable = false
 Whether this stack is malleable (can be turned into an equally valid other stack by a third party). More...
 
bool non_canon = false
 Whether this stack is non-canonical (using a construction known to be unnecessary for satisfaction). More...
 
size_t size = 0
 Serialized witness size. More...
 
std::vector< std::vector< unsigned char > > stack
 Data elements. More...
 

Friends

InputStack operator+ (InputStack a, InputStack b)
 Concatenate two input stacks. More...
 
InputStack operator| (InputStack a, InputStack b)
 Choose between two potential input stacks. More...
 

Detailed Description

An object representing a sequence of witness stack elements.

Definition at line 289 of file miniscript.h.

Constructor & Destructor Documentation

◆ InputStack() [1/2]

miniscript::internal::InputStack::InputStack ( )
inline

Construct an empty stack (valid).

Definition at line 308 of file miniscript.h.

◆ InputStack() [2/2]

miniscript::internal::InputStack::InputStack ( std::vector< unsigned char >  in)
inline

Construct a valid single-element stack (with an element up to 75 bytes).

Definition at line 310 of file miniscript.h.

Member Function Documentation

◆ SetAvailable()

InputStack & miniscript::internal::InputStack::SetAvailable ( Availability  avail)

Change availability.

Definition at line 295 of file miniscript.cpp.

◆ SetMalleable()

InputStack & miniscript::internal::InputStack::SetMalleable ( bool  x = true)

Mark this input stack as malleable.

Definition at line 317 of file miniscript.cpp.

◆ SetNonCanon()

InputStack & miniscript::internal::InputStack::SetNonCanon ( )

Mark this input stack as non-canonical (known to not be necessary in non-malleable satisfactions).

Definition at line 312 of file miniscript.cpp.

◆ SetWithSig()

InputStack & miniscript::internal::InputStack::SetWithSig ( )

Mark this input stack as having a signature.

Definition at line 307 of file miniscript.cpp.

Friends And Related Function Documentation

◆ operator+

InputStack operator+ ( InputStack  a,
InputStack  b 
)
friend

Concatenate two input stacks.

Definition at line 322 of file miniscript.cpp.

◆ operator|

InputStack operator| ( InputStack  a,
InputStack  b 
)
friend

Choose between two potential input stacks.

Definition at line 336 of file miniscript.cpp.

Member Data Documentation

◆ available

Availability miniscript::internal::InputStack::available = Availability::YES

Whether this stack is valid for its intended purpose (satisfaction or dissatisfaction of a Node).

The MAYBE value is used for size estimation, when keys/preimages may actually be unavailable, but may be available at signing time. This makes the InputStack structure and signing logic, filled with dummy signatures/preimages usable for witness size estimation.

Definition at line 295 of file miniscript.h.

◆ has_sig

bool miniscript::internal::InputStack::has_sig = false

Whether this stack contains a digital signature.

Definition at line 297 of file miniscript.h.

◆ malleable

bool miniscript::internal::InputStack::malleable = false

Whether this stack is malleable (can be turned into an equally valid other stack by a third party).

Definition at line 299 of file miniscript.h.

◆ non_canon

bool miniscript::internal::InputStack::non_canon = false

Whether this stack is non-canonical (using a construction known to be unnecessary for satisfaction).

Note that this flag does not affect the satisfaction algorithm; it is only used for sanity checking.

Definition at line 302 of file miniscript.h.

◆ size

size_t miniscript::internal::InputStack::size = 0

Serialized witness size.

Definition at line 304 of file miniscript.h.

◆ stack

std::vector<std::vector<unsigned char> > miniscript::internal::InputStack::stack

Data elements.

Definition at line 306 of file miniscript.h.


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