1

In Cardano's Alonzo CDDL (Concise Data Definition Language) specification, it seems that the value of an asset could be negative. Is it correct?

If the above assumption is correct, I am wondering how will the ledger work in the following scenario:

Alice has a native asset named "X" with negative quantity of -1000. Then, she send this asset X=-1000 to Bob, who has the same asset but a positive quantity of 2000. If this transaction is valid and successfully included in the blockchain, does it mean Bob will end up having only 1000 token X (2000-1000=1000) left?

It sounds weird that Alice could burn anybody's token by simply sending a negative quantity of tokens. If I have to guess an explanation for this scenario, it could be that Alice is granted with the power of "burning" by the token issuer, therefore she could burn anybody's token by sending negative values to their addresses. Therefore, token issuers should be extremely cautious about minting and issuing negative quantity tokens to any third party.

Update:

After taking a careful look at the ledger spec, the quantity of an asset can only be uint, specified as multiasset<uint> in this line. Only the minting amount could be negative, specified as multiasset in this line. This also verified Andy's answer below.

2 Answers 2

2

Official documentation unambiguously says about it:

The minting parameter is now called with a negative value, therefore destroying one token.

cardano-cli transaction build --mainnet --alonzo-era 
                              --tx-in $txhash#$txix 
                              --tx-out $address+$burnoutput 
                              --mint="-1 $policyid.$tokenname" 
                              --minting-script-file $script 
                              --change-address $address 
                              --invalid-hereafter $slot 
                              --witness-override 2 
                              --out-file burning.raw

One obvious thing about burning tokens is: an owner can't burn any token if there's nothing to burn.

cardano-cli transaction build-raw \
                        --fee $burnfee \
                        --tx-in $txhash#$txix \
                        --tx-out $address+$burnoutput+"9999998 $policyid.$tokenname1 + 9995000 $policyid.$tokenname2"  \
                        --mint="-5000 $policyid.$tokenname2" \
                        --minting-script-file policy/policy.script \
                        --out-file burning.raw


For more details, read this post please.

1
  • 1
    Thanks for the answer! After taking another careful look at the ledger spec, I found that the asset quantity should be an unsigned int, as specified here, which verifies your answer. I will update this information in the question as well.
    – Jerry
    Jan 22, 2022 at 20:55
-1

The amount of an asset is allowed to be negative because, in the minting field of a transaction, burning tokens is defined as negative minting. This does not mean that you can send negative amounts to an address i.e. that a UTxO is allowed to contain a negative amount of assets. Allowing this would effectively mean that anybody could print tokens by sending a positive amount and simultaneously a negative amount such that in sum no token apparently would be minted. It is clear that this cannot be true.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.