Skip to content

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
@andrewtoth
Copy link

Is this still in progress? The PSBT_OUT_SCRIPT field is needed for silent payments.

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.

2 participants