feat: add getPublicKey across all chains#194
Open
teyrebaz33 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Open
feat: add getPublicKey across all chains#194teyrebaz33 wants to merge 1 commit intoopen-wallet-standard:mainfrom
teyrebaz33 wants to merge 1 commit intoopen-wallet-standard:mainfrom
Conversation
Adds derive_public_key() to ChainSigner trait and wires it through ows-lib, Node binding, Python binding, and CLI. Closes open-wallet-standard#157 Problem ------- TON wallet contract initialization (WalletContractV5R1) requires the raw Ed25519 public key. The only workaround was exportWallet() to get the mnemonic, re-derive externally, then zero the secret material — partially undermining key isolation. Solution -------- Add get_public_key(wallet, chain, index) that returns the raw public key hex without exposing any secret material. Return format: - Ed25519 chains (TON, Solana, Sui): 32-byte hex (64 chars) - secp256k1 chains (EVM, Bitcoin, Cosmos, Tron, XRPL, Filecoin, Spark): 33-byte compressed SEC1 hex (66 chars, starts with 02 or 03) Changes ------- - ows-signer: derive_public_key() added to ChainSigner trait - ows-signer: implemented for all 10 chains - ows-lib: get_public_key() with 8 unit tests (144 existing pass) - bindings/node: getPublicKey() exported via NAPI - bindings/python: get_public_key() exported via PyO3 - ows-cli: ows wallet public-key --wallet --chain [--index] [--json]
|
@teyrebaz33 is attempting to deploy a commit to the MoonPay Team on Vercel. A member of the Team first needs to authorize it. |
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
Adds
getPublicKey(walletName, chainId)to the Node SDK, Python SDK, and CLI. Eliminates the mnemonic round-trip workaround for public key access.Closes #157
Problem
TON wallet contract initialization (
WalletContractV5R1) requires the raw Ed25519 public key. The only workaround was callingexportWallet()to get the mnemonic, re-deriving the keypair externally, then zeroing secret material — partially undermining key isolation even with careful zeroing.Solution
# CLI ows wallet public-key --wallet my-wallet --chain ton ows wallet public-key --wallet my-wallet --chain evm --jsonReturn format
02/03prefix)Changes
ows-signer:derive_public_key()added toChainSignertrait, implemented for all 10 chainsows-lib:get_public_key(wallet, chain, index, vault_path)with 8 unit testsbindings/node:getPublicKey()exported via NAPIbindings/python:get_public_key()exported via PyO3ows-cli:ows wallet public-key --wallet --chain [--index] [--json]Tests
Security
Public keys are not secret — exposing them does not weaken the security model. Private key material never leaves the OWS signing core.