Signing transactions locked with OP_CHECKLOCKTIMEVERIFY #15807

issue nkostoulas opened this issue on April 12, 2019
  1. nkostoulas commented at 4:02 PM on April 12, 2019: contributor

    I've been trying to send and sign a transaction paying to a multisig locked with <locktime> OP_CHECKLOCKTIMEVERIFY OP_DROP and noticed that this is considered nonstandard in bitcoin and thus not possible.

    Are there any plans or interest in implementing something like this?

    I've implemented this in a fork using a new transaction type (TX_LOCKED_MULTISIG), where the Solver first checks for the lock script above and then proceeds to "MatchMultisig". Similarly this new type can be recognised when signing the transaction by simply ignoring the preceding lock script, which is checked when verifying the script anyway.

    It would be quite straightforward to implement for the remaining standard transaction types as well or maybe even better with some manipulation use a single transaction type if possible.

  2. sipa commented at 4:25 PM on April 12, 2019: member

    Is your problem that (a) the signing logic doesn't support such transactions or (b) such outputs are nonstandard? These are independent things.

    For (a), sure, signing more things is perfectly reasonable. I'm working myself on support a much larger class of scripts in the signing logic (I talked about it at SBC'19: https://www.youtube.com/watch?v=XM1lzN4Zfks).

    For (b), you should just use P2SH/P2WSH, where such scripts are already standard. In raw scripts I doubt they'll ever be made standard.

  3. nkostoulas commented at 4:34 PM on April 12, 2019: contributor

    Problem is mostly (a), I am not able to sign it with the bitcoin wallet. How can you do (a) without doing (b) though, since with the current wallet API, nonstandard transactions cannot be signed?

  4. sipa commented at 4:45 PM on April 12, 2019: member

    @nkostoulas That's a currently implementation detail; it's not hard to add more supported scripts to the signer without affecting mempool policy.

  5. nkostoulas commented at 8:36 AM on April 15, 2019: contributor

    @sipa Cool I'd be willing to do that. Would this be an extension to the signing step to handle the non-standard case or were you thinking of a different implementation?

    What would be the reason though for allowing signing such transactions if they are going to be rejected anyway?

  6. sipa commented at 3:52 PM on April 15, 2019: member

    @nkostoulas They aren't nonstandard inside P2SH and P2WSH (as the "only known script templates are allowed" rule doesn't apply to them).

  7. MarcoFalke added the label Questions and Help on Apr 15, 2019
  8. MarcoFalke added the label Wallet on Apr 15, 2019
  9. nkostoulas commented at 4:17 PM on April 15, 2019: contributor

    @sipa right of course thanks :) I'll have a go

  10. sipa commented at 4:43 PM on April 15, 2019: member

    @nkostoulas I'm working on a larger project called miniscript that includes expanding signer's abilities to support more complex scripts, including ones with locktimes.

    There is a demo for part of it on http://bitcoin.sipa.be/miniscript/miniscript.html; the idea is that any script you can construct using that simple policy language described there would be trivial to build a signer for.

  11. nkostoulas commented at 4:57 PM on April 15, 2019: contributor

    @sipa ah ok interesting! So I guess it wouldn't make much sense to add some specialised cases just for lock time right now?

  12. MarcoFalke commented at 3:52 PM on April 26, 2020: member

    The feature request didn't seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Closing due to lack of interest. Pull requests with improvements are always welcome.

  13. MarcoFalke closed this on Apr 26, 2020

  14. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me