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
Signatures produced by the TEE Prover are now compatible with the
on-chain verifier that uses the `ecrecover` precompile.
Until now, we've been using _non-recoverable_ signatures in the TEE
prover with a compressed ECDSA public key in each attestation -- it was
compressed because there are only 64 bytes available in the report
attestation quote. That worked fine for off-chain proof verification,
but for on-chain verification, it's better to use the Ethereum address
derived from the public key so we can call ecrecover in Solidity to
verify the signature.
This PR goes hand in hand with matter-labs/teepot#228
let proof = "01000000c13bd882edb37ffbabc9f9e34a0d9789633b850fe55e625b768cc8e5feed7d9f7ab536cbc210c2fcc1385aaf88d8a91d8adc2740245f9deee5fd3d61dd2a71662fb6639515f1e2f3354361a82d86c1952352c1a81b";
235
+
let proof_bytes = hex::decode(proof).unwrap();
236
+
let msg = "216ac5cd5a5e13b0c9a81efb1ad04526b9f4ddd2fe6ebc02819c5097dfb0958c";
237
+
let msg_bytes = hex::decode(msg).unwrap();
238
+
let proof_addr = recover_signer_unchecked(
239
+
&proof_bytes[24..].try_into().unwrap(),
240
+
&Message::from_slice(&msg_bytes).unwrap(),
241
+
)
242
+
.unwrap();
243
+
let priv_key = "324b5d1744ec27d6ac458350ce6a6248680bb0209521b2c730c1fe82a433eb54";
244
+
let priv_key_bytes = hex::decode(priv_key).unwrap();
245
+
let priv_key = SecretKey::from_slice(&priv_key_bytes).unwrap();
246
+
let pubkey = PublicKey::from_secret_key_global(&priv_key);
0 commit comments