import { type Solution } from './satisfactions'; /** * An object containing the satisfier results. * * - nonMalleableSats: An array of {@link Solution} objects representing * the non-malleable sat() expressions. * - malleableSats: An array of {@link Solution} objects representing the * malleable sat() expressions. * - unknownSats: An array of {@link Solution} objects representing the sat() * expressions that contain some of the `unknown` pieces of information. * This property is only present when `computeUnknowns` is enabled. * * @see {@link Solution} */ export type SatisfierResult = { nonMalleableSats: Solution[]; malleableSats: Solution[]; unknownSats?: Solution[]; }; /** Options for the satisfier. * * The satisfier runs the static analyzer before enumerating witnesses. * Miniscript validity depends on script context, so tapscript must be specified * when you are targeting tapscript rules. In tapscript, MINIMALIF is consensus, * which changes the behavior of `d:X` (it becomes unit) and multisig uses * `multi_a` (CHECKSIGADD) instead of `multi` (CHECKMULTISIG). * * If `tapscript` is omitted, the satisfier assumes legacy/segwit v0 rules. */ /** * Options for the satisfier. * * The satisfier runs the static analyzer before enumerating witnesses. * Miniscript validity depends on script context. In tapscript, MINIMALIF is * consensus, which changes the `d:X` wrapper (it becomes unit), and multisig * uses `multi_a` (CHECKSIGADD) instead of `multi` (CHECKMULTISIG). * * If `tapscript` is omitted, legacy rules are assumed. * * If `computeUnknowns` is true, satisfactions that require unknown signatures * or preimages are enumerated and returned in `unknownSats`. When it is false * (default), unknown satisfactions are pruned during enumeration. * * `maxSolutions` defaults to 1000 and limits the total number of enumerated * solutions (including dsats and intermediate combinations). Set it to `null` * to disable the limit. Passing 0 or a negative value throws. */ export type SatisfierOptions = { unknowns?: string[]; knowns?: string[]; tapscript?: boolean; computeUnknowns?: boolean; maxSolutions?: number | null; }; /** * Obtains the satisfactions of a miniscript. * * `options.unknowns` is an array with the pieces of information that cannot be * used to construct solutions because they are unknown. * * For example, if a honest user cannot sign with `key`, doesn't know the * preimage of `H` and the preimage of `e946029032eae1752e181bebab65de15cf0b93aaac4ee0ffdcfccb683c874d43` then `unknown` must be: * ``` * [ * '', * '', * '' * ] * ``` * * Note that an expression will allways be NOT sane if it is NOT sane at the the * miniscript top level as per {@link https://bitcoin.sipa.be/miniscript/ * Wuille's algorithm}. * * For example; if a miniscript is NOT sane at the top level because it can be * satisfyed using only preimages, then setting preimages as unknowns will not * change this behaviour. * * The reason for this limitation is that the satisfier uses an unmodified * version of Wuille's algorithm as an initial precondition before finding * solutions. If the miniscript is sane, then unknowns can be set to produce * more possible solutions, including preimages, as described above. * * `options.knowns` is an array with the only pieces of information that can be * used to build satisfactions. * This is the complimentary to unknowns. Only `knowns` or * `unknowns` must be passed. * * If neither knowns and unknowns is passed then it is assumed that there are * no unknowns, in other words, that all pieces of information are known. */ export declare const satisfier: ( /** A miniscript expression. */ miniscript: string, /** Satisfier options. */ options?: SatisfierOptions) => SatisfierResult;