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 get v r s from signatures? #61

Open
sultana-mnw opened this issue Nov 28, 2018 · 7 comments
Open

how to get v r s from signatures? #61

sultana-mnw opened this issue Nov 28, 2018 · 7 comments
Assignees

Comments

@sultana-mnw
Copy link

sultana-mnw commented Nov 28, 2018

Description: I have follow the web3 methods in this link ( https://github.com/aionnetwork/aion_web3/wiki/web3-eth-accounts ) to get signature and v r s but i only get signature not v r s.

Web3 version: 1.0.3

Command(s) triggering the issue: web3.eth.accounts.sign(message,privatekey);

API output:

{
message:
'0x2c80807145a8a3688266c415da8a02b30ae8864180dbf23a4a43c63369a1a82d',
messageHash:
'0x3ca080ec9581ed002b1a43216c211aab4a7093927f6f60ab29ab4ed4ed38db44',
signature: '0x140b7b7027473c964344bb7837c13ee1650d5b8a1faae1ca14fe630d784586a7e85a90b2bb2a88f1ee699ae7b3b6471b99565d1b56d9fc0e49295493118f7eeb49f8ba3d115bc2f697ddaf1ecd5ab44db1a60f1fc57a6a07c3d41d84703e9302'
}

@aion-kelvin
Copy link
Contributor

Hi,

That is a mistake in the documentation... the signature is given not as (r, s), but simply as one hex string. We will update our docs.

@aion-kelvin aion-kelvin self-assigned this Nov 28, 2018
@sultana-mnw
Copy link
Author

sultana-mnw commented Nov 29, 2018

Hello,
Ok. But how could I get that (v r s) from that signature.

@aion-kelvin
Copy link
Contributor

aion-kelvin commented Nov 29, 2018

(v, r, s) is given by Ethereum's signing scheme. We use a different scheme (Ed25519 instead of ECDSA), which does not have (v, r, s). May I ask what how/why you want (v, r, s)?

Edit: typo in sig scheme name

@sultana-mnw
Copy link
Author

sultana-mnw commented Nov 29, 2018 via email

@aion-kelvin
Copy link
Contributor

Are you signing/recovering transactions? Or arbitrary messages?

@sultana-mnw
Copy link
Author

sultana-mnw commented Nov 29, 2018 via email

@aion-kelvin
Copy link
Contributor

aion-kelvin commented Nov 29, 2018

web3.eth.accounts.recover can be used to recover the address of signatures created by web3.eth.accounts.sign. Unfortunately, we do not support recovering the address of signed transactions right now.

API References:
https://docs.aion.network/docs/web3-eth-accounts#section-sign
https://docs.aion.network/docs/web3-eth-accounts#section-recover

(Don't use web3.eth.accounts.recover to recover a signature created by eth.accounts.signsignTransaction, as it will not give the correct result)

edit: fixed typo (see strikethrough above)

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

2 participants