Repository navigation
Make Starknet a native account on OpenZeppelin AccountUpgradeable - #44
Merged
Merged
Conversation
Starknet now follows the Solana and Stellar model: the account key is a stark key ground from HKDF of the MasterDEK, and the account is the standard OZ AccountUpgradeable v4.0.1 (class 0x03013bf2...26144, pinned because the address derives from it). Recovery is off-chain through the enclave or a passkey, like the other chains. Removes the custom DeviceAccount model: the Starknet adapter, P-256 device signers, on-chain passkey approvers, on-chain social recovery, the backup signer, the device approval and revoke pages, and the React APIs built on them. signMessage on Starknet is SNIP-12 typed data. The kit refuses set_public_key on the account, since a rotated key would no longer be controlled by the DEK. Breaking, so 0.5.0.
The v4.0.1 class is only declared on Sepolia. v3.0.0 is declared on both networks, was audited (audits/2025-11-v3.0.0.pdf), and its account and SRC9 code differs from v4.0.1 only in a type conversion: same constructor, SRC9 V2 and upgrade.
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Starknet now works like Solana and Stellar: the key derives from the MasterDEK, recovery is off-chain (enclave or passkey PRF), and there is no on-chain device management. The account is the standard OpenZeppelin
AccountUpgradeablev3.0.0 instead of the custom Cairo DeviceAccount.HKDF(DEK, appSalt, "cavos-stark-starknet-v1")→grindKey(EIP-2645 rejection sampling) → stark key.calculateContractAddressFromHash(pubKey, OZ_ACCOUNT_CLASS_HASH, [pubKey], 0), the OZ convention from the starknet.js guide. The Cavos paymaster deploys through UDC withunique=0, which yields the same address.0x01d1777d…02381(OZ v3.0.0, Scarb 2.13.1--release, audited inaudits/2025-11-v3.0.0.pdf). It is declared on mainnet and Sepolia, and its ABI matches v4.0.1's: constructor(public_key), SRC-9 V2,upgrade. It is pinned forever, because the address derives from it. Later changes go through the account'supgrade, which keeps the address. That is also the path to post-quantum (OZ Falcon-512) later.execute(executePaymasterTransactionwithdeploymentData), same as before.signMessage: SNIP-12 revision 1 typed data, verifiable with the account'sis_valid_signature. Returnscurve: "stark"plus thetypedData.execute/signTransactionrefuseset_public_keyon the account itself, by name or selector. A rotated key would no longer be controlled by the DEK.resolveNativeStarknet, like Solana.signStarknetMessageis removed; messages go throughsignStarknetTypedData.SocialRecoveryCoordinator,HttpRecoveryClient,BackupSigner,identity.ts;addSigner,removeSigner,listDevices,resendDeviceApproval,enrollPasskey, andCavos.recover;CavosSolana.Released as 0.4.2. This is a breaking change shipped as a patch, so any app on
^0.4.xpicks it up on its next install.Trade-offs
Rollout notes
lib/vault/copyAssets.mjs), so it must be redeployed with 0.4.2 before apps use 0.4.2 on Starknet. Any cavos-web redeploy picks up 0.4.2 through^0.4.1./api/devices/*routes and the enclave'sChainAuthorization::Starknetare now unused. Their cleanup is a separate change.Test plan
tsc --noEmitclean.jest: 57 suites, 381 passed, 2 skipped.deploymentDatashape on the first execute;is_valid_signatureon a deployed account.