Structs

Enums

  • | util/error.h is a common place for definitions | of simple error types and string functions. | Types and functions defined here should | not require any outside dependencies. | | Error types defined here can be used | in different parts of the codebase, | to avoid the need to write boilerplate | code catching and translating errors | passed across wallet/node/rpc/gui | code boundaries. |

Constants

Traits

Functions

  • | Get a destination of the requested type | (if possible) to the specified script. | | This function will automatically add | the script (and any other necessary | scripts) to the keystore. |
  • | Check a descriptor checksum, and update | desc to be the checksum-less part. |
  • | Extract signature data from a transaction | input, and insert it. |
  • | Get all destinations (potentially) | supported by the wallet for the given | key. |
  • | Get the checksum for a descriptor. | | - If it already has one, and it is correct, | return the checksum in the input. | | - If it already has one that is wrong, | return “”. | | - If it does not already have one, return | the checksum that would need to be added. |
  • | Get a destination of the requested type | (if possible) to the specified key. | | The caller must make sure LearnRelatedScripts | has been called beforehand. |
  • | Return the CKeyID of the key involved | in a script (if there is a unique one). |
  • | Find a descriptor for the specified | script, using information from provider | where possible. | | A non-ranged descriptor which only | generates the specified script will | be returned in all circumstances. | | For public keys with key origin information, | this information will be preserved | in the returned descriptor. | | - If all information for solving script | is present in provider, a descriptor | will be returned which is IsSolvable() | and encapsulates said information. | | - Failing that, if script corresponds | to a known address type, an “addr()” | descriptor will be returned (which | is not IsSolvable()). | | - Failing that, a “raw()” descriptor | is returned. |
  • | Check whether a scriptPubKey is known | to be segwit. |
  • | Check whether we know how to sign for | an output like this, assuming we have | all private keys. While this function | does not need private keys, the passed | provider is used to look up public keys | and redeemscripts by hash. | | Solvability is unrelated to whether | we consider this output to be ours. |
  • | Get the OutputType for a TxDestination |
  • | Parse a descriptor string. Included | private keys are put in out. | | If the descriptor has a checksum, it | must be valid. If require_checksum | is set, the checksum is mandatory - otherwise | it is optional. | | If a parse error occurs, or the checksum | is missing/invalid, or anything else | is wrong, nullptr is returned. |
  • | Parse a key path, being passed a split | list of elements (the first element | is ignored). |
  • | Parse a public key including origin | information (if enabled). |
  • | Parse a public key that excludes origin | information. |
  • | Interprets c as 8 groups of 5 bits which | are the coefficients of a degree 8 polynomial | over | | GF(32), multiplies that polynomial | by x, computes its remainder modulo | a generator, and adds the constant term | val. | | This generator is G(x) = x^8 + {30}x^7 | + {23}x^6 + {15}x^5 + {14}x^4 + {10}x^3 | + {6}x^2 + {12}x + {9}. | | It is chosen to define an cyclic error | detecting code which is selected by: | | - Starting from all BCH codes over GF(32) | of degree 8 and below, which by construction | guarantee detecting 3 errors in windows | up to 19000 symbols. | | - Taking all those generators, and for | degree 7 ones, extend them to degree | 8 by adding all degree-1 factors. | | - Selecting just the set of generators | that guarantee detecting 4 errors in | a window of length 512. | | - Selecting one of those with best worst-case | behavior for 5 errors in windows of length | up to 512. | | The generator and the constants to implement | it can be verified using this Sage code: | | ———– | @code | | B = GF(2) # Binary field | BP. = B[] # Polynomials over the binary field | F_mod = b5 + b3 + 1 | F. = GF(32, modulus=F_mod, repr=‘int’) # GF(32) definition | FP. = F[] # Polynomials over GF(32) | E_mod = x3 + x + F.fetch_int(8) | E. = F.extension(E_mod) # Extension field definition | alpha = e2743 # Choice of an element in extension field | for p in divisors(E.order() - 1): # Verify alpha has order 32767. | assert((alphap == 1) == (p % 32767 == 0)) | G = lcm([(alphai).minpoly() for i in [1056,1057,1058]] + [x + 1]) | print(G) # Print out the generator | for i in [1,2,4,8,16]: # Print out {1,2,4,8,16}(G mod x^8), packed in hex integers. | v = 0 | for coef in reversed((F.fetch_int(i)(G % x**8)).coefficients(sparse=True)): | v = v*32 + coef.integer_representation() | print(“0x%x” % v) |
  • | Produce a script signature using a generic | signature creator. |
  • | Produce a script signature for a transaction. |
  • | Sign scriptPubKey using signature | made with creator. | | Signatures are returned in scriptSigRet | (or returns false if scriptPubKey can’t | be signed), unless whichTypeRet is | TxoutType::SCRIPTHASH, in which case | scriptSigRet is the redemption script. | | Returns false if scriptPubKey could | not be completely satisfied. |
  • | Sign the CMutableTransaction |

Type Definitions