RGB-WG / rgb-node

RGB node - the official server-side implementation
https://rgb.tech
MIT License
148 stars 43 forks source link

cannot spend assets moved with Blank transitions #206

Closed zoedberg closed 1 year ago

zoedberg commented 1 year ago

Trying to spend an asset which has been incorporated in a Blank transition fails when calling rgb20::transitions::transfer() with an UnrelatedInput error. The issue seems to be that there is no method reading the DISCLOSURES table, which is where the blank transitons are stored (see here).

Looking at the transfer combine doc I read:

Once the txid is seen in blockchain, the node will enclose the disclosure to the stash automatically, updating the state of all smart contracts affected by the transfer

This automatic action is currently not happening and moreover I think that it's desirable to allow manual control of enclosing, since a wallet could prefer to enclose the disclosures only once the TX has reached a minimum number of confirmations.

I think we could add an API that gets the transfer TXID ad uses it to retrieve all associated disclosures that were part of that TX and encloses them. @dr-orlovsky what do you think?