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

Can a fee estimate method be implemented without private key? #250

Closed
kss-espeo opened this issue Jan 24, 2020 · 2 comments
Closed

Can a fee estimate method be implemented without private key? #250

kss-espeo opened this issue Jan 24, 2020 · 2 comments
Assignees
Projects

Comments

@kss-espeo
Copy link

I have a question related to fee estimate method (https://github.com/Cryptonomic/ConseilJS/blob/master/src/chain/tezos/TezosNodeWriter.ts#L587)

It requires keyStore , specifically a privateKey that is used to actually sign a test transaction prior sending it to a Tezos node.
This is unusual - fee estimate methods in other blockchains do not require a private key. After all, this is just a fee estimate and we are not recording anything on blockchain.

Do you think it is necessary or could be potentially implemented without needing a private key? Does a chains/${chainid}/blocks/head/helpers/scripts/run_operation Tezos node controller actually require a signature to provide a fee estimate? I know it is in the call parameters but I just don't understand what it would need signature for.

Of course best case scenario would be if you provided such implementation but if we can confirm that this can be done, I'm happy to do that myself and submit a PR to ConseilJS .

Thanks,
Kris

@kss-espeo kss-espeo changed the title Can fee estimate method be implemented without private key? Can a fee estimate method be implemented without private key? Jan 24, 2020
@anonymoussprocket anonymoussprocket self-assigned this Jan 24, 2020
@anonymoussprocket anonymoussprocket added this to To do in 0.4 via automation Jan 24, 2020
@kss-espeo
Copy link
Author

kss-espeo commented Jan 30, 2020

Turns out it's possible! As long as you send any valid signature as input to chains/${chainid}/blocks/head/helpers/scripts/run_operation , it's going to work. The way to go is probably to just always send some hardcoded signature.

This is obviously pretty dirty but still - it removes a need for public/private key. @anonymoussprocket would you like me to implement it that way?

@anonymoussprocket
Copy link
Contributor

Removing the signature field or making it blank causes the RPC call to fail. Instead the signature was hard-wired to a conforming value that is not related to the actual payload.

0.4 automation moved this from To do to Done Feb 14, 2020
anonymoussprocket added a commit that referenced this issue Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.4
  
Done
Development

No branches or pull requests

2 participants