Questions about asset descriptions

Two weeks ago when I changed asset description to 52 bytes (above) the transaction was multisig.

https://www.blocktrail.com/tBTC/tx/d893e5ee4cf3fb6ef72f9f8c6bfc09c7deb71f8f18b5f5fc62bd1c22ea6cf283

This asset description change was made in Counterwallet as shown on the screenshot above, so as long as one doesn’t run into the annoying insufficient BTC balance bug, Counterwallet can do it. (I haven’t had much time and success troubleshooting that bug yet.)

To your point, it could be that when OP_RETURN is used only 41 bytes are allowed.

So in theory maybe “forcing” MULTISIG could help. That’s something I’ve been planning to check in the CLI first (there’s a transaction type option in the client, but I’m not sure if it works, haven’t tried it yet. The default is “auto” and this has worked for me as well, because I successfully set 52 byte descriptions in the CLI as well, but not consistently - sometimes it fails and perhaps that’s when “auto” picks OP_RETURN). bytespersigop took effect in v9.54.

###Workaround for Incorrect "Error composing issuance transaction via API: ['insufficient funds']" Message during Issuance Attempt with Long (> 41 bytes) Asset Description

Firstly, there are correct “insufficient funds” messages. And there may be other incorrect “insufficient funds” messages.

This workaround is for one specific case (although it may apply to others), and that is when you issue an asset with more than 41 bytes in description and have sufficient funds, Counterwallet and the CLI may throw this message.

  • Cause: by default OP_RETURN is used and can’t fit more than 41 bytes in asset description
  • Workaround: use one of other choices from the documentation. Those are multisig and pubkeyhash and if you try the former you’ll also get an error saying it won’t work after 0.12.1, which means you need to try pubkeyhash. That does work.
  • Solution: a bug-free app would consider the length of issuance, and use appropriate encoding. I don’t know why Counterwallet doesn’t always do it (as I mentioned above I was able to change assets to 52-byte descriptions recently on testnet Counterwallet), but probably after multisig was removed it “mostly” worked and because most assets are issued via the API or 3rd party wallets and/or use Enhanced Asset Info, this stayed under the radar. If Counterparty starts using 80 bytes of OP_RETURN, then the default encoding should work (80 byte OP_RETURN seems enabled in the code, but apparently that’s not enough). A new issue existing for this in the counterwallet repo but maybe this will be improved in some other place in the code.

####How-To

  • If you use Web wallets, until changes in Counterwallet (or elsewhere in the code) fix this, use another wallet or the CLI or the API
    • You can also use 41 bytes, or - even better - consider using Enhanced Asset Info so that you only need a short URL in Description (CoinDaddy and Indiesquare Wallet provide these services, and you can also host Enhanced Asset Info on any other reliable server)
  • If you have the client, just use --encoding pubkeyhash.
  • If you use the API, in issuance parameters set "encoding": "pubkeyhash" instead of "encoding: "auto" (which now means OP_RETURN).