Bitcoin-com / slp-sdk

Simple Ledger Protocol SDK powered by BITBOX
https://developer.bitcoin.com/slp
MIT License
20 stars 32 forks source link

TokenType1.mint does not support array for fundingAddress and fundingWif #93

Closed BytesOfMan closed 4 years ago

BytesOfMan commented 4 years ago

To support the BCH and SLP spec of BCH utxos living on 145' and SLP utxos living on 245', it could be necessary to use a fundingAddress and fundingWif as arrays pulling fundingAddresses and fundingWifs from both paths. This is currently the approach used by mint.bitcoin.com, which relies on a fork of slp-sdk proposed here in #91

Per @thr0wn:

slp-sdk master does not accept an array of values for the parameter 'fundingAddress' and 'fundingWifs'. Even if you pass only path 145' as the single funding address, you will not be able to mint, as path 145' does not have the baton. If you pass only the path 245' you will not have enough funds, as it has only slp utxos.

91 was tabled with this comment from @SpendBCH:

Thank you for the PR @thr0wn, it's a bit big for us to consider right now though. There may be some more single -> array cases that can be solved with small changes like the ones in #90 , for more elaborate changes or more advanced use cases it may be best to use SLPJS.

In response, I'm looking into a simpler PR to solve the same issue.

In the meantime, mint.bitcoin.com has already diverged from the Bitcoin-com/master repo of slp-sdk. We are looking to ensure that we don't spin off too far on another version going forward. If it's a feature that mint needs, it's probably also a feature that should be added to slp-sdk, and we can assist for dev work and review.

BytesOfMan commented 4 years ago

Closing as saw this issue is already open, will comment there