You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears we didn't end up implementing that recommendation, but I also don't see any conversation in GitHub about it or why and so I suspect we missed the recommendation. This is the interface we have today:
This is the function exposed in the Soroban SDK with the recovery ID collected in a separate parameter:
/// Recovers the ECDSA secp256k1 public key.////// The public key returned is the SEC-1-encoded ECDSA secp256k1 public key/// that produced the 64-byte signature over a given 32-byte message digest,/// for a given recovery_id byte.pubfnsecp256k1_recover(&self,message_digest:&BytesN<32>,signature:&BytesN<64>,recorvery_id:u32,) -> BytesN<65>
The main concerns I can see with the separate recovery ID are:
A signature is two pieces of information that developers need to pass around in some form, and it's possible folks will use different inconsistent encoded forms for that.
In other ecosystems, like Ethereum, combining them into a single form is the norm, and we're diverging from that practice for unclear benefit. With Soroban we've tried to lean into Ethereum practices where there was no value in diverging.
During the original development of the secp256k1 interface @kwantam recommended that we specify ecdsa signatures as including the recovery id inline.
Ref: #839 (comment)
It appears we didn't end up implementing that recommendation, but I also don't see any conversation in GitHub about it or why and so I suspect we missed the recommendation. This is the interface we have today:
This is the function exposed in the Soroban SDK with the recovery ID collected in a separate parameter:
Ref: https://github.com/stellar/rs-soroban-sdk/blob/349cd57fc7f20c67730ff89762e99e64e280e4d5/soroban-sdk/src/crypto.rs#L50-L60
These are the args of the function defined in the Soroban Environment host interface also showing the recovery ID collected separately:
rs-soroban-env/soroban-env-common/env.json
Lines 1947 to 1958 in 8e593ab
It may be too late to change this interface, but I wanted to surface this regardless because this is a crypto interface.
Related issue:
The text was updated successfully, but these errors were encountered: