-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support P2SH Style MultiSign Script #46
Comments
Suggest change the We can easily extend it to support check tx For example We can support a few basic
|
I think System scripts is used for most of users. If they use addresses with |
the lock script can also constraint when a cell can be spent by verify tx https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki#escrow-with-timeout
Most time, users will ignore the |
Background
In Bitcoin, a multisign script is written like this:
M <Public Key 1> <Public Key 2> ... <Public Key N> N CHECKMULTISIG
One can embed this script in a TX's output, and provide enough legal signatures to unlock. However, the most popular multisign method in Bitcoin is P2SH. P2SH allows users embed the Hash160 of multisign script in an UTXO, and provide original script and signatures to unlock it later.
P2SH reduces the script size to a 20bytes hash, and thus it is easy to be encoded to a multisign address.
Multisign Script Support on CKB
Current multisign script on CKB is plain mode, which means the lock script has to embed and exposure all of the PKs. It costs more capacity, lack of security and privacy, and hard to be encoded to a short address.
So i suggest we follow Bitcoin's P2SH multisign method. Lock script only includes the script hash, and we use witness to provide full script.
Demo Implement
Keep multisign_script simple, like "2/3",and "3/5!1!4". Where "n/m" means at least n of m signature should be provided, and "!i" means one of signature must match the i-th PK.
The text was updated successfully, but these errors were encountered: