Repository navigation
Add native TypeScript wallet and transaction library - #1
Merged
Merged
Conversation
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.
Provide a native TypeScript Nockchain V1 library as
@swpsco/nockchain, with ESM and bundled declarations for Node and browsers. Protocol amounts, heights, digest limbs and atoms use bigint; private keys use private fields and explicit exports.Includes wallets and BIP39 recovery; public derivation; Cheetah Schnorr and TIP5; bounded immutable nouns and jam/cue; transaction inspection; complete input-note commitments; coin selection, fees and change; multisig, inclusive timelocks, partial signing and merging. Signature and authenticated input/height validation are explicit separate operations.
The noun design references urbit/nockjs: frozen cells share immutable children, JavaScript GC owns lifetime, equality memoizes pairs, and iterative traversal limits logical expansion. No Go, WASM or Nock VM runtime is required.
The source of truth is Nockchain's Hoon engine at
1eac02083a053c104b6a1299e80a8a51447017dc; the port follows nockchain-go v0.1.0. Public Rust/BIP39 fixtures check 35 wallets, 105 signatures, hashes, nouns and six transactions with exact partial/signed bytes. The separate Hoon corpus checks IDs, complete input commitments and fees.Validation: all 15 test groups pass; strict TypeScript and formatting checks pass. Includes malformed keys with valid checksums, backreference expansion bounds, immutable reviews, timelock boundaries and wallet/fee cases. A browser bundle executes derivation, transaction verification and random recovery generation without Node globals. The npm tarball installs and derives the expected address in a fresh project. CI covers Node 22 and 24, packing and installation.
Private-key arithmetic is variable-time. The package performs no chain access or broadcasting. Includes documentation, source/declaration maps, security scope and wordlist attribution.