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

Add BIP370 fields #36

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add BIP370 fields #36

wants to merge 1 commit into from

Conversation

Nesopie
Copy link
Contributor

@Nesopie Nesopie commented Apr 13, 2024

This PR adds support to BIP370.

A couple of questions:

  • For the input fields pertaining to hashes (eg, RIPEMD160) should I check if the preimage is the same as the hash?
  • For PrevTxId - should I take the input as string or Buffer? And should I assume that the txid is already in reverse byte/little-endian order?
  • should I check for correctness in general? For example, check if height locktime is less than 500 million, or hash(preimage) === hash etc or is the check function simply for type safety?
  • There's a util function for writing or reading from/to Uint64. But now that Buffer has a util for performing that operation, wondering if I can use that instead?
  • A lot of the existing code uses Buffer.allocUnsafe(), any reason why?

TODOS:

  • Add test vectors from BIP370
  • Support for a couple more global key value pairs
  • Support for proprietary key value pairs
  • Migrate to Uint8Array

@Nesopie Nesopie marked this pull request as draft April 13, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant