WebOfTrustInfo / txref-conversion-js

Javascript library for converting txids to txrefs and back
MIT License
3 stars 7 forks source link

Add ability to encode and decode "extended txrefs" which enable referencing a specific UTXO in a transaction #8

Closed danpape closed 6 years ago

danpape commented 6 years ago

I updated the txrefEncode() and txrefDecode() functions to be able to deal with original size or extended size txrefs--based on whether or not a specific utxoIndex is passed in. I also added a bunch of tests.

I did NOT modify any of the other functions, like txidToTxref(), mainly because I'm not sure how that would affect any other projects that are using this code. I hope you can take a look and modify as needed.

peacekeeper commented 6 years ago

Is there a spec for those extended size txrefs? I'm interested in updating the Java implementation as well https://github.com/WebOfTrustInfo/txref-conversion-java.

danpape commented 6 years ago

Hi Markus, you can see the changes we want to make to the BIP 136 spec here: https://github.com/danpape/bips/blob/Bech32_Encoded_TxRef/bip-0136.mediawiki and here are the diffs from the previous version: https://github.com/veleslavs/bips/compare/Bech32_Encoded_TxRef...danpape:Bech32_Encoded_TxRef?expand=1

peacekeeper commented 6 years ago

I just updated txref-conversion-java to also support txrefextEncode and txrefextDecode,. Personally I think I like separate methods better than combined, but either way looks good to me. @kimdhamilton should review your PR since she's the original author.