CounterpartyXCP / counterparty-core

Counterparty Protocol Reference Implementation
http://counterparty.io
MIT License
287 stars 207 forks source link

MPMA Send unable to send multiple memos #2568

Closed jdogresorg closed 2 hours ago

jdogresorg commented 4 hours ago

Traditionally, MPMA Sends have allowed for a optional per-line memo, which can be either hex or not on a per-send basis.

According to the new /v2/ API docs, and the response from the /address/<address>/compose/mpma response, both memo and memo_is_hex fields are now only a SINGLE value rather than an array of values, as it has always been, and has been in the /v1/ API.

This forces the entire MPMA send to send one memo type, when an MPMA send can contain many memos, both hex and non-hex memos.

Necessary Updates :

I feel the following needs to be updated to be "backwards-compatible":

  1. API should be updated to allow specifying a comma separated list of text memos
  2. API should be udpated to allow specifying a comma separated list of boolean values for memo_is_hex
  3. API Documentation should be updated to indicate memos and memo_is_hex are comma separated values.

Usage Example:

User wants to distribute an MPMA send, and send a per-line memo, or a hexidecimal reference to the send

Example API Request:

https://api.counterparty.io:4000/v2/addresses/1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev/compose/mpma?address=1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev&destinations=1Lfm6jXgCQi8LvjpgFHa2F4hdr1uJVa5t4%2Cbc1q50kxp76j9l0k9jgwasvcz4mcz0v03fv2y5pdxx&assets=BACKINBLOOD%2CBACKINBLOOD&quantities=1%2C1&memo=Test%20Memo%201%2C1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev&memo_is_hex=false%2Ctrue&exact_fee=4096&allow_unconfirmed_inputs=true

image

image

image

adamkrellenstein commented 2 hours ago

First of all, v2 is not supposed to be backwards-compatible with v1. Second of all, the v1 API is still live. Third of all, MPMA is a terribly designed feature that will be completely obviated in the following upcoming protocol change which introduces an actually sane way to pack multiple sends into a single BTC transaction: https://github.com/CounterpartyXCP/counterparty-core/issues/2197