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

invalid high s-value encountered in r1 signature at /v1/chain/send_transaction2 #2056

Closed
dev-dantealighieri opened this issue Jan 8, 2024 · 4 comments
Labels
more-info waiting for submitter to reply with more information

Comments

@dev-dantealighieri
Copy link

Hi

Once in a ~10 transaction, I am getting the following error:
"message": "invalid high s-value encountered in r1 signature at /v1/chain/send_transaction2", "stack": "exception: invalid high s-value encountered in r1 signature at /v1/chain/send_transaction2\n at APIClient.<anonymous> (/Users/dev-dante/Documents/Codes/eos/node_modules/@wharfkit/antelope/src/api/client.ts:139:19)\n at Generator.next (<anonymous>)\n at fulfilled (/Users/dev-dante/Documents/Codes/eos/node_modules/tslib/tslib.js:114:62)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)" } }

I looked through the code base but couldn't figure out what's the reason. The error is coming from this line.

PS:
I am using wharfkit/antelope library to send transaction.
My accounts public/private key is R1, not K1.

@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Jan 8, 2024
@bhazzard bhazzard added more-info waiting for submitter to reply with more information and removed triage labels Jan 9, 2024
@bhazzard
Copy link

bhazzard commented Jan 9, 2024

@dev-dantealighieri Are you using a custom signature provider implementation?

@aaroncox does this ring any bells for you?

@dev-dantealighieri
Copy link
Author

yes, I'm using secp256r1 implementation of elliptic javascript library, I'm not using antelope's own signer. (I am performing offline signing). I am using R1 public and private keys.

@spoonincode
Copy link
Member

You need to make sure the signature is in canonical format which for secp256r1 signatures in leap means the s value is less than the half order of the curve. If you're using elliptic it can do that for you by passing canonical: true. For example, how wharfkit passes that option when performing the signatur with elliptic,
https://github.com/wharfkit/antelope/blob/master/src/crypto/sign.ts#L22

@spoonincode
Copy link
Member

Closing due to inactivity for over a month, if you need more help on this topic feel free to reply

@github-project-automation github-project-automation bot moved this from Todo to Done in Team Backlog Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info waiting for submitter to reply with more information
Projects
Status: Done
Development

No branches or pull requests

4 participants