docs: signing examples & secret management docs#550
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds new API for signing Algorand transactions using wrapped secrets (key-wrapping patterns), along with signing example scripts, documentation, and dependency updates. It introduces nobleEd25519SigningKeyFromWrappedSecret / ed25519SigningKeyFromWrappedSecret which can derive a public key and create a signer from a wrapped Ed25519 seed or HD extended private key. The HD account API is also refactored to return an accountGenerator closure instead of exposing peikertXHdAccountGenerator as a separate top-level function.
Changes:
- New
nobleEd25519SigningKeyFromWrappedSecretanded25519SigningKeyFromWrappedSecretfunctions inpackages/crypto/src/index.tssupporting bothWrappedEd25519SeedandWrappedHdExtendedPrivateKey - Refactored HD wallet API (
hd.ts):peikertXHdAccountGeneratoris removed;peikertXHdWalletGeneratornow returns anaccountGeneratorclosure instead - New signing examples (
examples/signing/) and updated documentation (docs/src/content/docs/concepts/core/secret-management.md), plus package-lock/dependency updates
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
packages/crypto/src/index.ts |
Core new API: nobleEd25519SigningKeyFromWrappedSecret, ed25519SigningKeyFromWrappedSecret, and internal rawSign/rawPubkey helpers for HD key signing |
packages/crypto/src/ed25519.ts |
New Ed25519SigningKey and WrappedEd25519Seed types |
packages/crypto/src/hd.ts |
Refactored HdWalletGenerator/HdAccountGenerator types; removed peikertXHdAccountGenerator; added WrappedHdExtendedPrivateKey type; accountGenerator now returned as closure |
packages/transact/src/signer.spec.ts |
New tests for wrapped seed/HD key signing, error handling, zeroing, and updated HD wallet usage |
examples/signing/01-ed25519-from-keyring.ts |
Example: sign using ed25519 seed from OS keyring |
examples/signing/02-hd-from-keyring.ts |
Example: sign using HD extended private key from OS keyring |
examples/signing/03-aws-kms.ts |
Example: sign using AWS KMS |
examples/signing/verify-all.sh |
Script to run and verify all signing examples |
examples/package.json |
Added @aws-sdk/client-kms and @napi-rs/keyring dependencies |
docs/src/content/docs/concepts/core/secret-management.md |
New documentation page covering secret management, KMS, wrapped secrets, multisig, key rotation |
docs/astro.config.mjs |
Registers the new documentation page in the sidebar |
package-lock.json, examples/package-lock.json |
Dependency version updates |
.nsprc |
Updated security advisory suppressions for updated dependencies |
Files not reviewed (1)
- examples/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e43f970 to
ef16f71
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.
Files not reviewed (1)
- examples/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- examples/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mrcointreau
left a comment
There was a problem hiding this comment.
Pushed a couple of commits for:
- adding signing in the sidebar config and signig examples to the astro docs
- updating the
README.mdwith the new signing examples - adding crypto package path mapping to
examples/tsconfig.json - including signing in the top-level
verify-all.shsuite list - adding eslint -> flatted vuln to
.nsprc
LGTM
|
🎉 This PR is included in version 10.0.0-alpha.45 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds 3 examples for working with ed25518 seed, xHD extended private key, and AWS KMS.
Also includes documentation for secret management which refers to these examples.
Based on conversations with Marco, we probably want to add a utiltiy function that does the wrap/unwrap, generate ed25519 signing key, generate algorand address with signers in one call but that will be in a follow-up PR