-
Notifications
You must be signed in to change notification settings - Fork 261
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
Issuemorefrom spends wrong UTXO #58
Comments
The transaction is legitimate, but as you say it doesn't leave another unspent output available for the next transaction. There are many ways to solve this but the easiest is to use the createrawsendfrom API. This also will allow you to built the transaction, add data, sign and send in a single API call. |
Thanks for your response, I created the issue mainly because I expected Also the tutorial for raw transactions contains a section about issuing assets. After using the approach described there this issue occurs. |
There are two versions of the raw transactions tutorials. The first uses |
If I try to send a transaction that spends the same output that
failed with error 500 Internal Server Error: {"result":null,"error":{"code":-26,"message":"64: Asset transfer script rejected - mismatch in input/output quantities"},"id":"bo5ae191309efb3"} I expect the same to happen for issuemorefrom. |
Can you please explain this point again, I couldn't understand it because you cannot spend the same output more than once, in any circumstances. |
as far as I understand
I was trying to replicate the behavior of |
I was able to add an empty output to spend on further asset issues to my raw transaction via |
The If you want to resurrect the ability to call
|
okay, thanks for your help. This is mainly about confusing behavior. If you want to fix |
Can you please explain what you expected issuemorefrom to do, that it didn't do? We're not clear on what it can do if it has no unspent outputs to spend. |
As far as I see, it currently takes an asset output from another transaction and produces two outputs:
It should ideally also fix the current situation and create a new empty output that can be spent for further issues. |
Also the tutorial should be fixed by adding a note that adding an empty output is needed to allow further issuremore calls. |
But |
I understand that, but it should create an empty output in any case. Otherwise the structure of the blockchain becomes confusing in my opinion. As I said, it's all working but it's confusing, so I suggest to make sure an empty output is created in all cases. If you think nothing needs to be changed, I'm fine with that too, feel free to close the issue then. |
Background
I am trying to create raw transactions with
issuemorefrom
. I am not using theissuemorefrom
api call because I want to store some information in the application that creates the transation before sending it.The problem
issuemorefrom
transactions do not have an output that could be spent on new asset issues as it is the case with the transactions generated byissuemorefrom
api call. I have not figured out what is the problem here, but that could be my own fault.issuemorefrom
api call after my incorrect transaction is in the network it will spend asset outputs for generating new transactions, making these assets unusable.How to reproduce
connect
,send
,receive
.listaddresses
-> my admin address is 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8issue 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8 '{"name":"cointest","open":true}' 1 0.00000001
issuemorefrom 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8 cointest 5
The relevant transactions in the network are now:
now I create my transaction:
appendrawdata hex-from-above '{"details":{"origin":"us","stage":"two"}}'
This transaction has only the output of the asset issue and the meta data.
now make api call
issuemorefrom 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8 1RuottrEKTyLbi9EARtppJEwXLwUzPz48eB5s8 cointest 5
This transactions spends the asset issued in step 4! As far as I see this is a major issue and such a transaction should never be accepted on the network.
The text was updated successfully, but these errors were encountered: