pybitcash / bitcash

BitCash: Python Bitcoin Cash Library (fork of ofek's Bit)
https://bitcash.dev
MIT License
97 stars 39 forks source link

Adds Cashtoken support #122

Closed yashasvi-ranawat closed 1 year ago

yashasvi-ranawat commented 1 year ago

Fixes #121, builds on #119.

Adds Cashtoken support to Bitcash.

yashasvi-ranawat commented 1 year ago

@merc1er I realised the CashToken spec has test vectors too, added them as well. Its ready for review. The final thing left is to update the CASHTOKEN_ACTIVATION_BLOCKHEIGHT to the block after 1684152000 MTP.

yashasvi-ranawat commented 1 year ago

This Cashtoken pull request is designed with the assumption that the utxo query from the BitcoinDotComAPI will fetch scriptcodes with attached token prefix. However, while refactoring PATFO check to the BitcoinDotComAPI, I realised the API sends only the locking script for all utxos (which makes sense). This implies that any token prefix attached to an individual utxo might be missed. Added cashtoken support through chaingraph.

merc1er commented 1 year ago

@yashasvi-ranawat: Does the CashToken sections shows for you in the index page of the docs? I tried building locally (cd docs; make html) but I am not seeing anything about tokens.

yashasvi-ranawat commented 1 year ago

@yashasvi-ranawat: Does the CashToken sections shows for you in the index page of the docs? I tried building locally (cd docs; make html) but I am not seeing anything about tokens.

Yes. I checked the changelog on this pull request, I do see the doc changes that should add it to the index page.

merc1er commented 1 year ago

Also if you don't mind I'll add you to the AUTHORS.md file as a contributor.

merc1er commented 1 year ago

For some reason tests won't pass on Python 3.7. That's not much of an issue (Python 3.7 was released over 5 years ago), but could you confirm we no longer support 3.7 with the newest changes?

If so I'll remove it in favor of 3.11, and release version 1.0.0 of BitCash.

yashasvi-ranawat commented 1 year ago

Could you please confirm that there no longer is anything not backwards compatible in this PR?

I tested with pre-merge tests, wallet and cashaddress are backwards compatible. The sanitised output format has been changed, so no backwards compatibility in the transactions.py. However, those I think are not directly used by any user, but via wallet.py. The old output (the one user makes, not the sanitised output) format still works.

For some reason tests won't pass on Python 3.7. That's not much of an issue (Python 3.7 was released over 5 years ago), but could you confirm we no longer support 3.7 with the newest changes?

Python 3.7 is already at its end-of-life

bitjson commented 1 year ago

@yashasvi-ranawat fantastic work, thanks for all you're doing on this library! Do you have a Twitter account I can follow/highlight?

yashasvi-ranawat commented 1 year ago

@bitjson Thanks a lot. My twitter handle: https://twitter.com/yashasviranawat