Repository navigation
v0.22.2
Highlights
- The request signing key is derivable as a key, not only as its EVM address:
deriveMidnightRequestSigningKeyreturns the public key the MPC signs a contract's requests with (#119). - Request records derive their own signer: two functions take an on-ledger request record and own the MPC's rendering of its
senderandpathinto the derivation string, which every consumer did by hand until now (#119).
New features
deriveMidnightRequestSigningKey(mpcSecp256k1PublicKey, contractAddress, path): the request signing public key as aSecp256k1Point, the request-side twin ofderiveMidnightResponseKey. Format it withformatSecp256k1PublicKey(#119).deriveSignBidirectionalEventSigningKey(mpcSecp256k1PublicKey, request)andderiveSignBidirectionalEventSignerEvmAddress(mpcSecp256k1PublicKey, request): the same key, and its EVM address, from a request record. The requester is the record'ssender, and the path is the lowercase hex of its full 32pathbytes, exactly as the MPC renders it. The address is theexpectedSignerthatverifySignatureRespondedEventtakes (#119).SignBidirectionalEventKeySelector: the two record fields (sender,path) that select a request signing key, so a caller can pass a whole record or just those two (#119).asciiUnpadded(bytes): the inverse ofasciiPadded, for the zero-padded text fields of a request record (caip2Id, the two schemas). Only trailing zero bytes are padding: a zero byte inside the text is kept (#119).
Refactoring
deriveEvmAddressis defined as the address ofderiveMidnightRequestSigningKey, so the key and its address cannot drift apart. Its golden vectors pass unchanged (#119).decodeSignetEventNamegoes throughasciiUnpadded, leaving the package one implementation of the unpadding (#119).- The new key functions are pinned to the existing independent golden addresses: a key whose EVM address matches a golden vector is the key that vector was constructed from, so no vector was generated from the code under test (#119).
Breaking changes
- None. The release is additive: no existing export changes its signature or its output.
Full Changelog: v0.22.1...v0.22.2