Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm, core: implement keychain rotation for external key #131

Merged
merged 7 commits into from
Dec 24, 2024

Conversation

sehyunc
Copy link
Contributor

@sehyunc sehyunc commented Dec 24, 2024

Purpose

This PR implements keychain rotation for externally managed keys. It uses the Renegade key type to decide whether to rotate the key internally or use the public key provided by the SDK consumer. In both cases, it will increment the nonce if the public key has been rotated.

Testing

  • Tested locally
  • Tested in testnet

@sehyunc sehyunc changed the base branch from main to feat/external-key-impl December 24, 2024 02:12
@sehyunc sehyunc changed the base branch from feat/external-key-impl to sehyun/pre-http-helpers December 24, 2024 02:13
@sehyunc sehyunc changed the title wasm, core: impelment keychain rotation for external key wasm, core: implement keychain rotation for external key Dec 24, 2024
@sehyunc sehyunc force-pushed the sehyun/key-rotation branch from 49480b5 to 1d3df13 Compare December 24, 2024 02:39
Base automatically changed from sehyun/pre-http-helpers to feat/external-key-impl December 24, 2024 03:02
@sehyunc sehyunc force-pushed the sehyun/key-rotation branch from 73bdabb to 93bf808 Compare December 24, 2024 03:06
@sehyunc sehyunc requested a review from joeykraut December 24, 2024 03:07
new_wallet.key_chain.rotate(seed);

// Get the next public key based on key type
let next_public_key = match key_type {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably break this out into a helper since it appears a few times

@sehyunc sehyunc merged commit d66fd34 into feat/external-key-impl Dec 24, 2024
@sehyunc sehyunc deleted the sehyun/key-rotation branch December 24, 2024 03:29
sehyunc added a commit that referenced this pull request Dec 27, 2024
* core: add external key config (#129)

core: add external config, modify BaseConfig

* core: add symmetric key getter to config (#130)

* core: add symmetric key getter to config

* core: ingest changes into websocket

* wasm, core: implement keychain rotation for external key (#131)

* wasm, core: implement keychain rotation for external key

* wasm, core: impl key rotation for withdraw;

* wasm, core: impl key rotation for create order

* wasm, core: impl key rotation for cancel order

* core: format

* wasm: cleaner rotation

* wasm: abstract key rotation logic into helper

* wasm, core: impl external key deposit action (#132)

* wasm: add sign callback invocation helper

* wasm, core: impl external key deposit action

* wasm, core: impl external key withdraw action (#133)

* wasm, core: impl external key withdraw action

* wasm: simplify signing fns

* wasm: organize signing fn

* wasm, core: impl external key create order action (#134)

* wasm, core: impl external key create order action

* wasm, core: impl external key cancel order action (#135)

* wasm, core: remove need for key_type in Rust context (#136)

* wasm, core: remove need for key_type in Rust context

* core: add safety checks to actions

* wasm, core: impl external key get pk scalars (#137)

* wasm: do not prehash message when using external signer (#138)

wasm: remove prehash assumption

* chore: lint

* core: impl await task completion for externally managed keys (#139)

* core: impl get order + pay fees for external keys (#140)

core: impl get order + pay fees for externally managed keys

* wasm, core, node: impl external wallet key generation script (#141)

* node: export GeneratedSecrets type

* wasm, core: impl external key create wallet (#142)

* wasm, core: impl external key create wallet

* wasm, core: impl external key lookup wallet (#144)

* wasm, core: impl external key refresh wallet (#143)

core: impl refresh wallet for externally managed keys

* core: add public key getter and setter fns to external config (#145)

core: add public key getter and setter in external config

* core: fix create order in matching pool args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants