Add user defined script as part of multisig#17
Conversation
Changed demo scripts for bitcoin regtest. Elements versions are broken now
|
|
||
| set -e | ||
|
|
||
| # Make sure bitcoind is running |
There was a problem hiding this comment.
Can we catch that bitcoind connection is absent and give appropriate error with this message?
|
It's tricky to finalize generic user's script, so finalization is handled only for multisignature path. CLI provides tooling for manual finalization of CSV script for demo purposes. |
| /// OP_IF | ||
| /// OP_2 <cosigner_pk(33)> <user_pk(33)> OP_2 OP_CHECKMULTISIG | ||
| /// OP_ELSE | ||
| /// <locktime> OP_CSV OP_DROP <user_pk(33)> OP_CHECKSIG |
There was a problem hiding this comment.
Cleanup the timelock related staff from this the core, and move it into cli if it is used there.
| let program = Program::<CoreExtension>::from_str(program, witness) | ||
| .map_err(RunnerError::ProgramParse)?; | ||
|
|
||
| let env = UnchainedEnv::new(redeem_script, ()); |
There was a problem hiding this comment.
The same logic used previously for P2SH and P2WSH should apply here as well. We place the redeem script of our leaf here.
| length(min = 1), | ||
| custom(function = "validation::validate_user_leaf_script") | ||
| )] | ||
| pub user_leaf_script_hex: String, |
There was a problem hiding this comment.
We don't really care what users put in their leaf, we should just accept TapLeafHash, it is enough to build control block.
| } | ||
|
|
||
| #[cfg(test)] | ||
| /*#[cfg(test)] |
Changes
Redesigns P2TR flow to hold 2-of-2 multisig from previous versions and user defined recovery path as leafs of taptree (key path unspendable); removes p2sh, p2wsh types.