Skip to content

feat: algokit-crypto#521

Merged
joe-p merged 17 commits intodecouplingfrom
decoupling-feat/crypto
Jan 28, 2026
Merged

feat: algokit-crypto#521
joe-p merged 17 commits intodecouplingfrom
decoupling-feat/crypto

Conversation

@joe-p
Copy link
Contributor

@joe-p joe-p commented Jan 16, 2026

Adds new algokit-crypto package with interfaces and implementations of ed25519 and xHD account generation and signing. This is the only package in algokit that takes on crypto dependencies. The Algorand-specific logic in utils only works with the interfaces defined in this package and is agnostic to the underlying implementation.

This PR also migrates from js-sha512 to @noble/hashes sha512

@joe-p joe-p force-pushed the decoupling-feat/crypto branch from 469ecef to db17868 Compare January 16, 2026 16:03
Copy link
Contributor

@PatrickDinh PatrickDinh left a comment

Choose a reason for hiding this comment

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

Not sure if you are planning to export this package or not. If you are, you will need to add an entry to rolldown

    // Package re-exports
    'src/abi/index.ts',
    'src/algo25/index.ts',
    'src/transact/index.ts',
    'src/algod-client/index.ts',
    'src/indexer-client/index.ts',
    'src/kmd-client/index.ts',

const xhd = new XHDWalletAPI()

export const peikertXHdWalletGenerator: HdWalletGenerator = async (seed?: Uint8Array) => {
const seedArray = seed ?? new Uint8Array(32)
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: looks like this var isn't needed, you can return

const rootKey = fromSeed(Buffer.from(seed === undefined ? newSeedBytes : new Uint8Array(32)))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to intermediate seedArray because crypto.getRandomValues mutates the array. I was, however, able to get rid of the intermediate newSeedBytes in 1cab575

@joe-p joe-p merged commit 45676a3 into decoupling Jan 28, 2026
@joe-p joe-p deleted the decoupling-feat/crypto branch January 28, 2026 14:58
@engineering-ci
Copy link
Contributor

engineering-ci bot commented Feb 2, 2026

🎉 This PR is included in version 10.0.0-alpha.33 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants