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

Error -4 reissuing default asset with anyone-can-spend reissuance token #457

Closed
wintercooled opened this issue Nov 7, 2018 · 2 comments
Closed

Comments

@wintercooled
Copy link
Contributor

Not sure if related to Issue #259

If you create a chain with initialfreecoins=0 and initialreissuancetokens > 0 and then use the reissuancetoken as the feeasset and try to reissue the asset before claiming the anyone-can-spend token you get an error -4: "Unable to blind the transaction properly. This should not happen"

I can see this set up occurring if someone was using as a standalone blockchain, setting up with 0 initial asset amount and then trying to issue some later. It does not occur if the tokens are fist 'claimed' by sending to another address or if the initialfreecoins are > 0.

Bash to reproduce:

# To get the error:
# Happens when you issue 0 initialfreecoins and some reissuance tokens and try to reissue before claiming the anyone can spend RITs
# If you claim the rit it doesn't happen every time - but it does sometimes, this may be a sync issue.
# If you assign > 0 initialfreecoins it doesn't happen

#!/bin/bash
set -x
cd

shopt -s expand_aliases

alias e1-dae="$HOME/elements/src/elementsd -datadir=$HOME/elementsdir1"
alias e1-cli="$HOME/elements/src/elements-cli -datadir=$HOME/elementsdir1"

alias e2-dae="$HOME/elements/src/elementsd -datadir=$HOME/elementsdir2"
alias e2-cli="$HOME/elements/src/elements-cli -datadir=$HOME/elementsdir2"

echo "The following 2 lines may error - that is fine."

e1-cli stop
e2-cli stop
sleep 5

rm -r $HOME/elementsdir1 ; rm -r $HOME/elementsdir2
mkdir $HOME/elementsdir1 ; mkdir $HOME/elementsdir2
cp $HOME/elements/contrib/assets_tutorial/elements1.conf $HOME/elementsdir1/elements.conf
cp $HOME/elements/contrib/assets_tutorial/elements2.conf $HOME/elementsdir2/elements.conf

ASSET="mynewasset"

e1-dae -initialreissuancetokens=100000000 -initialfreecoins=0 -defaultpeggedassetname=$ASSET -validatepegin=0
e2-dae -initialreissuancetokens=100000000 -initialfreecoins=0 -defaultpeggedassetname=$ASSET -validatepegin=0
sleep 5

BALANCE=$(e1-cli getwalletinfo | jq '.balance')
TOKEN=$(echo $BALANCE | jq 'keys[0]' | tr -d '"') #Should be at [0] but just to be sure:
if [ "$ASSET" = "$TOKEN" ]; then
  TOKEN=$(echo $BALANCE | jq 'keys[1]' | tr -d '"')
fi

echo $TOKEN
echo $ASSET

e1-cli stop
e2-cli stop
sleep 5

e1-dae -initialreissuancetokens=100000000 -initialfreecoins=0 -defaultpeggedassetname=$ASSET -validatepegin=0 -feeasset=$TOKEN
e2-dae -initialreissuancetokens=100000000 -initialfreecoins=0 -defaultpeggedassetname=$ASSET -validatepegin=0 -feeasset=$TOKEN
sleep 5

#THESE NEXT LINES WILL ERROR: 
#  error code: -4
#  error message:
#  Unable to blind the transaction properly. This should not happen.
e1-cli reissueasset $ASSET 50
e2-cli reissueasset $ASSET 50

@instagibbs
Copy link
Collaborator

instagibbs commented Nov 7, 2018 via email

@wintercooled
Copy link
Contributor Author

duplicate of #259 so closing

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

No branches or pull requests

2 participants