Waves icon indicating copy to clipboard operation
Waves copied to clipboard

Publick key

Open ShawnShoper opened this issue 6 years ago • 8 comments

Hi, we upgrade the waves to lastest. when we call calcfee api, the throw error,content={"error":199,"message":"requirement failed: invalid public key length: 0"}, But i do not found how to get public key

ShawnShoper avatar Sep 11 '20 08:09 ShawnShoper

Hi. Please check that json of transaction in your request body contains field "senderPublicKey" with correct value

msmolyakov avatar Sep 11 '20 09:09 msmolyakov

Json body,

{
type:4
sender:xxxx,
recipient:xxx,
amount:10000
fee:1000
senderPublicKey:""
}

I fill empty value for publick key, the old wallet version,can pass it . But we upgrade to lastest version,it's wrong. and i see the docs. No API was found to get the public key for the account

ShawnShoper avatar Sep 11 '20 09:09 ShawnShoper

@msmolyakov Can u help me

ShawnShoper avatar Sep 11 '20 09:09 ShawnShoper

It's impossible to calculate its public key from the address. "senderPublicKey" field is required, but "sender" isn't.

msmolyakov avatar Sep 11 '20 09:09 msmolyakov

umm,I can't get senderPublicKey from the address creation to the transfer. How should I do, how can i get the publickey

ShawnShoper avatar Sep 11 '20 09:09 ShawnShoper

It's impossible to calculate its public key from the address. "senderPublicKey" field is required, but "sender" isn't.

so is there an API or another way to get senderPublicKey for one address? @msmolyakov

past2017 avatar Sep 11 '20 10:09 past2017

If account owner has its seed phrase or private key, he can calculate public key from them. There're client libraries for many programming languages that can do it for you.

Please read this article for more details: https://medium.com/wavesprotocol/protect-your-funds-public-private-keys-and-seed-phrases-c52fe4c46fbf

msmolyakov avatar Sep 11 '20 10:09 msmolyakov

Thanks.

ShawnShoper avatar Sep 11 '20 11:09 ShawnShoper