Web3.swift
Web3.swift copied to clipboard
Update cryptoswift 1.5.1 and fix EthereumPublicKey initializer
Updated dependency and fixed bug in the public key initializer
It would be good if there was a test to prove the public key recovery fix (the fix is good, just missing the test) :)
What does not work with the public key recovery process right now? Why did you change it?
@wainglaister ok, will add a test.
@koraykoska it recovers to a wrong address because it uses hash of a wrong preimage: it was hashing a signature instead of a message, which is nonsense to me 😊
I think it's a typo, but without the fix the method produces wrong values
Relates to this issue: https://github.com/Boilertalk/Web3.swift/issues/12
@DmitryBespalov Can you please add test cases from official specifications so we avoid future regressions
@koraykoska sorry, I'm overloaded with the day job tasks at the moment, I won't have time to look at it till the middle of next week
I need this in production, could someone release this please?
@proggeramlug CryptoSwift was updated and released. I still fail to find official examples about the recovery of the public key and I think the implementation in this PR is wrong. If you can, please add test cases and link to official docs so I can get it merged.
I would suggest this as a trustworthy source: https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L53
Tests: https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/test/signature.spec.ts#L101
Reference: Yellow Paper, see page 26, Appendix F, line (314)