Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructed transaction does not parse correctly #1119

Closed
jdogresorg opened this issue May 12, 2021 · 4 comments
Closed

Constructed transaction does not parse correctly #1119

jdogresorg opened this issue May 12, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@jdogresorg
Copy link
Contributor

It seems that we have an issue with transferring asset ownership to segwit (bech32) addresses, as the API throws an error indicating that the constructed transaction does not parse properly.

API Request:

{
	"method": "create_issuance",
	"params": {
		"source": "1DDEJ8E7qmeL2uvY8yaRSjrfHQb8wkrAvF",
		"asset": "RALPHBAKSHI",
                "transfer_destination": "bc1qljtsutdcc47jn4585l0xgqw4atdqkqvc92vqym",
		"quantity":0,
		"allow_unconfirmed_inputs": true
	},
	"jsonrpc": "2.0",
	"id": 0
}

API Response:

{
    "jsonrpc": "2.0",
    "id": 0,
    "error": {
        "message": "Error composing issuance transaction via API: Constructed transaction does not parse correctly: ('1DDEJ8E7qmeL2uvY8yaRSjrfHQb8wkrAvF', 'bc1qljtsutdcc47jn4585l0xgqw4atdqkqvc92vqym', b'\\x14\\x00\\x08\\x88\\xd7\\xd4V2\\xb6\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00') ≠ ('1DDEJ8E7qmeL2uvY8yaRSjrfHQb8wkrAvF', '', b'\\x14\\x00\\x08\\x88\\xd7\\xd4V2\\xb6\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00')",
        "code": -32001
    }
}

image

@jdogresorg jdogresorg changed the title Transfer asset ownership to segwit (bech32) address fails unable to parse transaction Aug 26, 2021
@jdogresorg
Copy link
Contributor Author

jdogresorg commented Aug 26, 2021

getting this error for other CP API transactions as well

API REQUEST

{
    "method" : "create_send",
    "params" : {
		"source": "1387Ze9HfexTm8zxZzt1xacSu6GtRkvNkS",
		"destination": "12fiPDaZ9Vij8woThLnd51KqPErCHRFt5X",
		"asset": "ETHEREUMCARD",
		"quantity": 100000000,
		"allow_unconfirmed_inputs": true,
		"fee": 1000
    },
    "jsonrpc" : "2.0",
    "id" : 0
}

API Response

{
    "error": {
        "code": -32001,
        "message": "Error composing send transaction via API: Constructed transaction does not parse correctly: ('1387Ze9HfexTm8zxZzt1xacSu6GtRkvNkS', '', b\"\\x02\\x00=\\xd3\\x82\\xde\\xf1\\xf9\\xcd\\x00\\x00\\x00\\x00\\x05\\xf5\\xe1\\x00\\x00\\x12Jz'G\\r\\xb4\\x13C\\xd6\\xc0\\x84\\x08\\xa5\\xaby_\\xa6\\xe33\") ≠ ('1GzasG2hy7Zaad5SvM5pFWpg6wbfqXqJxJ', '', b\"\\x02\\x00=\\xd3\\x82\\xde\\xf1\\xf9\\xcd\\x00\\x00\\x00\\x00\\x05\\xf5\\xe1\\x00\\x00\\x12Jz'G\\r\\xb4\\x13C\\xd6\\xc0\\x84\\x08\\xa5\\xaby_\\xa6\\xe33\")"
    },
    "id": 0,
    "jsonrpc": "2.0"
}

image

The error message has an address (1GzasG2hy7Zaad5SvM5pFWpg6wbfqXqJxJ) which is entirely not related to the original transaction... perhaps this is an internal issue with getting results from addrindexrs in counterparty? Have Javier look into it a bit deeper

@jdogresorg jdogresorg changed the title unable to parse transaction Constructed transaction does not parse correctly Nov 29, 2022
@adamkrellenstein adamkrellenstein added this to the v10.0.3 milestone Apr 11, 2024
@adamkrellenstein
Copy link
Member

adamkrellenstein commented Apr 11, 2024

We're still running into this, I think:

time curl -X POST https://api0.counterparty.io:4000/api/ --user rpc:rpc -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{
                                "method" : "create_send",
                                "params" : {
                            "source": "1CounterpartyXXXXXXXXXXXXXXXUWLpVr",
                            "destination": "1FwkKA9cqpNRFTpVaokdRjT9Xamvebrwcu",
                            "asset": "XCP",
                            "quantity": 100000000,
                            "allow_unconfirmed_inputs": true,
                            "fee": 1000
                                },
                                "jsonrpc" : "2.0",
                                "id" : 0
                            }'
{"error": {"code": -32001, "message": "Error composing send transaction via API: Constructed transaction does not parse correctly: ('1CounterpartyXXXXXXXXXXXXXXXUWLpVr', '', b'\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x05\\xf5\\xe1\\x00\\x00\\xa3\\xec`\\xfbR/\\xdfb\\xc9\\x0e\\xec\\x19\\x81Wx\\x13\\xd8\\xf8\\xa5\\x8a') \u2260 ('1JDogZS6tQcSxwfxhv6XKKjcyicYA4Feev', '', b'\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x05\\xf5\\xe1\\x00\\x00\\xa3\\xec`\\xfbR/\\xdfb\\xc9\\x0e\\xec\\x19\\x81Wx\\x13\\xd8\\xf8\\xa5\\x8a')"}, "id": 0, "jsonrpc": "2.0"}
________________________________________________________
Executed in    2.80 secs      fish           external
   usr time   27.31 millis   17.21 millis   10.10 millis
   sys time   12.54 millis    3.83 millis    8.71 millis

@jdogresorg
Copy link
Contributor Author

able to reproduce the issue/error consistently on testnet via the following request.

TESTNET
https://api.counterparty.io:14000

{
    "method": "create_send",
    "params": {
        "source": "mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt",
        "destination": "tb1q75dtzykyxwe80rn3mnv2hpxtl4zawuncyhk8t2",
        "asset": "BTC",
        "quantity": 1000000,
        "fee": 1000,
        "allow_unconfirmed_inputs": true
    },
    "jsonrpc": "2.0",
    "id": 0
}

telegram-cloud-photo-size-4-5824833676628833057-y

@adamkrellenstein
Copy link
Member

Fixed with #1647

> curl -X POST http://api3.counterparty.io:14000/api/ --user rpc:rpc -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{
                  "method": "create_send",
                  "params": {
                      "source": "mvThcDEbeqog2aJ7JNj1FefUPaNdYYGqHt",
                      "destination": "tb1q75dtzykyxwe80rn3mnv2hpxtl4zawuncyhk8t2",
                      "asset": "BTC",
                      "quantity": 1000000,
                      "fee": 1000,
                      "allow_unconfirmed_inputs": true
                  },
                  "jsonrpc": "2.0",
                  "id": 0
              }'
{"result": "0100000001680c6f5161dab4f86142eef5fe7434e9fa28744de1e3d04a55a18d234bce5536010000001976a914a3ec60fb522fdf62c90eec1981577813d8f8a58a88acffffffff0240420f0000000000160014f51ab112c433b2778e71dcd8ab84cbfd45d7727867a64a1c000000001976a914a3ec60fb522fdf62c90eec1981577813d8f8a58a88ac00000000", "id": 0, "jsonrpc": "2.0"}
>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants