Skip to content

Conversation

@BlobMaster41
Copy link
Contributor

Swap bs58check for a @scure/base-based base58check implementation and add react-native-quick-crypto support for native hashing. Added src/io/base58check.ts and wired base58check exports/imports throughout address, p2pkh and p2sh. Introduced a crypto-hashes abstraction and a native react-native implementation (react-native-quick-crypto) while updating crypto imports to use the new module. Added base64 encoder (toBase64) and exported it, plus a minimal type declaration for react-native-quick-crypto. Adjusted package.json (dependencies/peers) to reflect these changes. Updated numerous tests and typings (null-checks, casts, asserts and signature type fixes) to satisfy stricter type/runtime checks.

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Performance improvement
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD changes
  • Dependencies update

Checklist

Build & Tests

  • npm install completes without errors
  • npm test passes all tests
  • npm run browserBuild completes without errors (if applicable)

Code Quality

  • Code follows the project's coding standards
  • No new compiler/linter warnings introduced
  • Error handling is appropriate
  • TypeScript types are properly defined

Documentation

  • Code comments added for complex logic
  • Public APIs are documented
  • README updated (if applicable)

Security

  • No sensitive data (keys, credentials) committed
  • No new security vulnerabilities introduced
  • Cryptographic operations reviewed (if applicable)

Bitcoin Specific

  • Transaction serialization/deserialization is correct
  • Script operations are properly validated
  • Network parameters are handled correctly
  • PSBT operations maintain compatibility

Testing

Related Issues


By submitting this PR, I confirm that my contribution is made under the terms of the project's license.

Swap bs58check for a @scure/base-based base58check implementation and add react-native-quick-crypto support for native hashing. Added src/io/base58check.ts and wired base58check exports/imports throughout address, p2pkh and p2sh. Introduced a crypto-hashes abstraction and a native react-native implementation (react-native-quick-crypto) while updating crypto imports to use the new module. Added base64 encoder (toBase64) and exported it, plus a minimal type declaration for react-native-quick-crypto. Adjusted package.json (dependencies/peers) to reflect these changes. Updated numerous tests and typings (null-checks, casts, asserts and signature type fixes) to satisfy stricter type/runtime checks.
Replace many non-null assertion usages (!) with explicit casts, undefined checks, and safer control flow across the codebase to improve TypeScript strictness and runtime safety. Added bounds/undefined guards (e.g. outputs, script bytes, witness data), converted index-based loops to safer iteration in several helpers, and clarified intermediate variables (e.g. firstByte, byte1/byte2, controlBlockFirstByte). Also fixed a few logic issues related to witness/coinbase handling, PSBT/transaction indexing casts, worker transferList buffer handling, and ensured presence of ecc.signSchnorr before calling it. Overall these changes reduce possible undefined accesses and make intent clearer for reviewers and the typechecker.
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.

1 participant