-
Notifications
You must be signed in to change notification settings - Fork 236
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
Multisig transaction validation issues #4788
Comments
if index == 7 || index == 8 {
continue
} Why do you skip 7 and 8 in |
In order to verify whether skipping checks 7 and 8 (skipping 1 and 5 and others will also fail) causes the validation failure, I am trying the verification rules of multisig transactions, because I haven't found the verification rules in the source code yet. |
|
I tried skipping |
I guess the the
|
All private keys should be correct, because the private keys for generating the multisig address and the private keys for signing are the same slice. When I have time, I will check the source code to find the verification rules. Currently, the verification rules are not yet clear. |
The multisig contract deployed in the genesis block contains a bug that, under certain conditions, may fail to verify valid signatures. However, how to upgrade contracts deployed in the genesis block via a hard forrk is not converged on consensus yet. In PR 98, we addressed the issue and deployed a new multisig contract. As a workaround, we recommend transitioning to this new contract.The transaction construction and signing steps are same as the genesis deployed contract, the only difference is cell deps, please refer to this deployment info. I'm sorry for the inconvenience. |
Thanks, then I should be able to resolve this by recreating the multisig address using the updated contract codeHash, is that right? |
yes, please let us know if there is a problem. |
I'd like to know how I should replace this data. testnetContracts[Secp256k1Blake160MultisigAll] = &Info{
CodeHash: types.HexToHash("0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8"),
HashType: types.HashTypeType,
OutPoint: &types.OutPoint{
TxHash: types.HexToHash("0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37"),
Index: 1,
},
DepType: types.DepTypeDepGroup,
} I see that the deployment information doesn't include code_hash. deployed on testnet:
|
Also update the DepType to the other value: not group (which I don't know the exact name in Go). Something like below:
|
Thank you. I attempted to modify the data as you recommended. It seems DepType has two possible values, both of which I've tested. Changing DepType doesn't change the multisig address. const (
DepTypeCode DepType = "code"
DepTypeDepGroup DepType = "dep_group"
) An error was returned when submitting the transaction:
|
It seems that you used mainnet config:
on testnet. |
I used the testnet configuration, and when cellDepType was
When cellDepType was
So far, I'm still not sure what the problem is. Are there any changelog notes or available SDK examples? transaction:
|
You should also include previous dep_group. So the final tx should be like below:
The |
It's successful. Thank you very much. This issue can be closed now |
I used these 15 private keys to generate a 9/15 multisig address:
ckt1qpw9q60tppt7l3j7r09qcp7lxnp3vcanvgha8pmvsa3jplykxn32sqvmqu29rxgzm0f7hur9y3xmq87m0nzffxg4dcd30
However, I found that broadcasting the transaction sometimes results in an error:
TransactionFailedToVerify: Verification failed Script(TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure: see error code -52 on page secp256k1-blake160-multisig-all (via type hash) | ckb-script-error-codes })
I have checked and all signatures are correct. I don't understand where my problem is. I couldn't find the -52 error code in the CKB node source code. I know this error code means either the signature result didn't provide enough signatures, or the signature and public key verification failed. I also provided the multisigScript in the transaction.
Here is my transaction structure:
Environment
SDK: ckb-sdk-go
my code:
The text was updated successfully, but these errors were encountered: