feat: mee 3.0.0, stx validator support#184
Conversation
size-limit report 📦
|
| * ``` | ||
| */ | ||
| export const formatSignedPermitQuotePayload = ( | ||
| account_: MultichainSmartAccount, |
There was a problem hiding this comment.
These kind of functions (prepareSignable payload variant and formatSignedQuote) are intentionally designed for modularity and it should strictly avoid nexus account being passed as param.
If so, it loses its ability to work independently in backend system without nexus.
You can pass it as params instead of the whole account
There was a problem hiding this comment.
You can pass it as params instead of the whole account
by 'it' you mean what exactly?
p.s. do we even need this 'ability to work independently in backend system' yet?
There was a problem hiding this comment.
I mean what ever you're dependent on mcNexusAccount such as meeVersions and etc.. You can pass it as params
There was a problem hiding this comment.
Yeah we use this independently in STX api
vr16x
left a comment
There was a problem hiding this comment.
The core integration seems good, just added some questions and comments.
Co-authored-by: Filipp Makarov <fmc@Filipps-MacBook-Pro.local>
* chore: fix tests to use proper quote type * chore: fix import --------- Co-authored-by: Filipp Makarov <fmc@Filipps-MacBook-Pro.local>
Stx validator + p256 support
StxValidator Integration (MEE V3.0.0)
This PR integrates the new StxValidator from bcnmy/stx-contracts#18 into the SDK, introducing MEE version 3.0.0 with enhanced signature validation capabilities and P256 (secp256r1) signer support.
🎯 Overview
The StxValidator replaces MeeK1Validator in MEE V3.0.0, providing a more flexible and efficient validation system that supports multiple signature types and stateless validator architectures. This enables support for both traditional EOA signers and modern P256 signers used in passkeys and secure enclaves.
✨ Key Features
1. New StxValidator Module
toStxValidator()factory function supporting five signature modes:simple- Basic supertransaction modeno-stx- Regular userOps without supertransaction envelopepermit- ERC-2612 token permit approvalson-chain- Pre-approved on-chain transactionssafe-sa- Safe multisig integration2. P256 (secp256r1) Signer Support
toP256Signer()utility creates viem-compatible LocalAccount for P256 keys0x177eee12,0x177eee10) for P256 validationtoEthSignedMessageHashwrapping)x || ycoordinates from public key3. Ownership Management System
addOwnership()- Register new ownership on StxValidatorchangeOwnership()- Update existing ownership with validationcleanOwnership()- Remove ownership datagetOwnership()- Query current ownership stateeoa,p256,safe, or custom validator addresses4. Signature Format Changes
For MEE V3.0.0:
0x177eee12 + signaturesignMessage1271()method for pure 1271 flows (never uses 7739)(v,r,s)to rawsignaturebytesPR-Codex overview
This PR focuses on enhancing the
StxValidatorintegration, introducing support for P256 signers, and updating various modules and tests for improved functionality and compatibility across different MEE versions.Detailed summary
StxValidatorin multiple files.signUserOperationHashmethod for signing user operation hashes.toDefaultModuleto conditionally useStxValidator.StxValidator.toP256Signerutility.size-limit.json.package.jsonto include@noble/curves.