Skip to content
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

how to multsign #6

Closed
CodeLion66 opened this issue Nov 26, 2020 · 5 comments
Closed

how to multsign #6

CodeLion66 opened this issue Nov 26, 2020 · 5 comments

Comments

@CodeLion66
Copy link

permissionId
image

I didn't see how to sign more signatures and get in touch with you further?

@CodeLion66
Copy link
Author

I hope to get a reply as soon as possible

@fbsobreira
Copy link
Owner

you just need to sign the same hash and append them all in signature slice... example:

rawData, _ := proto.Marshal(tx.GetRawData())
h256h := sha256.New()
h256h.Write(rawData)
hash := h256h.Sum(nil)

signature1, err := crypto.Sign(hash, privateKey1)
signature2, err := crypto.Sign(hash, privateKey2)
signature3, err := crypto.Sign(hash, privateKey3)
tx.Signature = append(tx.Signature, signature1)
tx.Signature = append(tx.Signature, signature2)
tx.Signature = append(tx.Signature, signature3)

result, err := c.Broadcast(tx)

@xellDart
Copy link

I try to sign transaction using:

`
pKey, err := crypto.HexToECDSA(*wallet.Private)
if err != nil {
return nil, err
}

for range contractList {
	signature, err := crypto.Sign(hash, pKey)

	if err != nil {
		return nil, err
	}

	tx.Transaction.Signature = append(tx.Transaction.Signature, signature)
}

result, err := trx.Client.Broadcast(tx.Transaction)

`

But I always get:
"result error: Validate signature error: 9ea75e9c4248e28e88e890111ab57aad3e4e64e58e8c9c931dbb92329e78eb7e048c303a9461cefe67b0576bfd4f96ab3573879bd3dd6ca17d41e9cf89ff510901 is signed by TEjz16wGkzu7LDX8D7VscezX25NZYSHhDa but it is not contained of permission."

@ming871
Copy link

ming871 commented Sep 28, 2023

I try to sign transaction using:

` pKey, err := crypto.HexToECDSA(*wallet.Private) if err != nil { return nil, err }

for range contractList {
	signature, err := crypto.Sign(hash, pKey)

	if err != nil {
		return nil, err
	}

	tx.Transaction.Signature = append(tx.Transaction.Signature, signature)
}

result, err := trx.Client.Broadcast(tx.Transaction)

`

But I always get: "result error: Validate signature error: 9ea75e9c4248e28e88e890111ab57aad3e4e64e58e8c9c931dbb92329e78eb7e048c303a9461cefe67b0576bfd4f96ab3573879bd3dd6ca17d41e9cf89ff510901 is signed by TEjz16wGkzu7LDX8D7VscezX25NZYSHhDa but it is not contained of permission."

I have the same error, May be there is no "permissionId" when ”CreateTransaction“.

@kangbingbing
Copy link

I also encountered this problem. I cannot use multi-signature to operate proxy energy permissions. If there is a solution, please contact me and I will pay you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants