Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.82k stars 2.03k forks source link

[Bug] Cannot move NFT to DID. DID blocked (unspendable) #14081

Closed Ganbin closed 1 year ago

Ganbin commented 1 year ago

What happened?

Description

GUI

Since few weeks I try to move NFT to my DID but couldn't. I get this error :

NFT Move Failed
The NFT move failed: Error: Can't select 1, from spendable 0 for wallet id 2

CLI

I have tried with CLI chia wallet did get_did -i 2 and get this error : Failed to get DID: 'coin_id'

RPC

With RPC I can do those calls : did_get_info and did_get_did without issues.

did_get_current_coin_info return me an error:

Request failed: {'error': "Can't select 1, from spendable 0 for wallet id 2", 'success': False}

Version

1.6.1 and 1.7.0rc2

What platform are you using?

macOS

What ui mode are you using?

GUI & CLI

Relevant log output

2022-12-08T11:39:00.010 wallet chia.wallet.did_wallet.did_wallet: WARNING  Can't select 1, from spendable 0 for wallet id 2
2022-12-08T11:39:00.011 wallet chia.rpc.rpc_server        : WARNING  Error while handling message: Traceback (most recent call last):
  File "chia/rpc/rpc_server.py", line 329, in safe_handle
  File "chia/rpc/rpc_server.py", line 320, in ws_api
  File "chia/rpc/wallet_rpc_api.py", line 2224, in nft_set_nft_did
  File "chia/wallet/nft_wallet/nft_wallet.py", line 1112, in set_nft_did
  File "chia/wallet/nft_wallet/nft_wallet.py", line 316, in get_did_approval_info
  File "chia/wallet/did_wallet/did_wallet.py", line 763, in create_message_spend
  File "chia/wallet/did_wallet/did_wallet.py", line 329, in select_coins
ValueError: Can't select 1, from spendable 0 for wallet id 2

2022-12-08T11:46:45.773 wallet chia.wallet.did_wallet.did_wallet: WARNING  Can't select 1, from spendable 0 for wallet id 2

2022-12-08T11:51:55.879 wallet chia.wallet.did_wallet.did_wallet: WARNING  Can't select 1, from spendable 0 for wallet id 2
2022-12-08T11:51:55.879 wallet chia.rpc.util              : WARNING  Error while handling message: Traceback (most recent call last):
  File "chia/rpc/util.py", line 18, in inner
  File "chia/rpc/wallet_rpc_api.py", line 2076, in did_get_current_coin_info
  File "chia/wallet/did_wallet/did_wallet.py", line 951, in get_info_for_recovery
  File "chia/wallet/did_wallet/did_wallet.py", line 329, in select_coins
ValueError: Can't select 1, from spendable 0 for wallet id 2
Ganbin commented 1 year ago

The coin ID : 0xa569f67e7cadb91c064903c353f5cd80ca8f8de02faa4bb686754a2b67ba49b5

paninaro commented 1 year ago

@Ganbin can you check the wallet balance for your DID wallets using the following CLI?

chia wallet show -w decentralized_id

If you see output like the following:

   -Total Balance:         0.0
   -Pending Total Balance: 1.0
   -Spendable:             0.0
   -Type:                  DECENTRALIZED_ID
   -DID ID:                did:chia:1ak0d75meng2mmn5vwj8xxwugmcm38pfwc3ljjrwsh8f4uthcrqdqwufxdj
   -Wallet ID:             25

Where the pending total balance is non-zero, then your DID hasn't been confirmed on-chain.

Ganbin commented 1 year ago

@paninaro

It shows me that:

   -Total Balance:         0.0  
   -Pending Total Balance: 0.0  
   -Spendable:             0.0  
   -Type:                  DECENTRALIZED_ID
   -DID ID:                did:chia:1220cmlvtcy8aghqudaadw57kal6wyh9rh0xevly3k38575whaglspmaq6v
   -Wallet ID:             2
Ganbin commented 1 year ago

I have also made chia wallet delete_unconfirmed_transactions -i 2 many times. Tried to delete unconfirmed transactions on other NFT And even looked into the mempool to see if I can find the coin, but it is not in the mempool.

DrakoPensulo commented 1 year ago

I have the same problem. Namely, my DID is blocked. I cannot mint. I have resynced the wallet (from 0) several times using different versions of chia (including 1.5.1, 1.6.1, 1.6.2rc2.dev78, and 1.7.0rc3). The command 'chia wallet show' gives -Total Balance: 0.0
-Pending Total Balance: 0.0
-Spendable: 0.0
-Type: DECENTRALIZED_ID -DID ID: did:chia:19tjf2lqqgss46l24cfc359s9z5ysen8w0ydcwgxu7p2lkmrp754qexeh6l -Wallet ID: 3

'chia rpc wallet did_get_current_coin_info '{"wallet_id": 3}' returns

Request failed: {'error': "Can't select 1, from spendable 0 for wallet id 3", 'success': False}

'chia rpc wallet did_get_did '{"wallet_id": 3}' returns { "my_did": "did:chia:19tjf2lqqgss46l24cfc359s9z5ysen8w0ydcwgxu7p2lkmrp754qexeh6l", "success": true, "wallet_id": 3 }

(Note: there is no coin_id, which I do not know how to obtain at this point).

'chia rpc wallet did_get_metadata '{"wallet_id": 3}' returns { "metadata": {}, "success": true, "wallet_id": 3 }

That is incorrect, because I set up some metadata (for namesdao).

While executing the above commands, debug.log contains (note the DOUBLE_SPENDs):

2022-12-29T21:07:52.893 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0x4c78fad69580f3c08a1256c0f973b7b9cc48efecba9bbd84509feb2833d8e88d'} 2022-12-29T21:07:53.251 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0x81783791aebcca5c03c99638d90274ee833ee9ca3f6becf75fce31bd62130b97'} 2022-12-29T21:07:57.561 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0xf69df18eb698627449a1228a3cb9cab2d57e88fc6c990fd6235fe48b39258bd8'} 2022-12-29T21:07:57.631 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0xb36f11a685b1108ff5e93c7aab6a58b688a4530a46eae2ef399af2d6e822dfe3'} 2022-12-29T21:29:13.615 wallet chia.wallet.did_wallet.did_wallet: WARNING Can't select 1, from spendable 0 for wallet id 3 2022-12-29T21:34:43.880 wallet chia.wallet.did_wallet.did_wallet: WARNING Can't select 1, from spendable 0 for wallet id 3 2022-12-29T21:34:43.881 wallet chia.rpc.util : WARNING Error while handling message: Traceback (most recent call last): File "/home/pi/chia-blockchain/chia/rpc/util.py", line 18, in inner res_object = await f(request_data) File "/home/pi/chia-blockchain/chia/rpc/wallet_rpc_api.py", line 1918, in did_get_current_coin_info did_coin_threeple = await did_wallet.get_info_for_recovery() File "/home/pi/chia-blockchain/chia/wallet/did_wallet/did_wallet.py", line 944, in get_info_for_recovery coins = await self.select_coins(uint64(1)) File "/home/pi/chia-blockchain/chia/wallet/did_wallet/did_wallet.py", line 323, in select_coins raise ValueError(error_msg) ValueError: Can't select 1, from spendable 0 for wallet id 3

2022-12-29T21:37:13.013 wallet chia.wallet.did_wallet.did_wallet: WARNING Can't select 1, from spendable 0 for wallet id 3 2022-12-29T21:38:33.096 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0xf69df18eb698627449a1228a3cb9cab2d57e88fc6c990fd6235fe48b39258bd8'} 2022-12-29T21:38:33.157 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0x81783791aebcca5c03c99638d90274ee833ee9ca3f6becf75fce31bd62130b97'} 2022-12-29T21:38:37.899 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0x4c78fad69580f3c08a1256c0f973b7b9cc48efecba9bbd84509feb2833d8e88d'} 2022-12-29T21:38:37.960 wallet chia.wallet.wallet_node : WARNING SpendBundle has been rejected by the FullNode. {'error': 'DOUBLE_SPEND', 'status': 3, 'txid': '0xb36f11a685b1108ff5e93c7aab6a58b688a4530a46eae2ef399af2d6e822dfe3'} 2022-12-29T21:44:40.907 wallet chia.wallet.did_wallet.did_wallet: WARNING Can't select 1, from spendable 0 for wallet id 3

Ganbin commented 1 year ago

Hi @DrakoPensulo,

Thanks for your feedback.

We have something in common, is that we both have set the metadata for Namesdao for our DID.

However on my side, I can see the metadata and I have set it up twice, like recommended in the Namesdao tutorial.

I wonder if the issue may be related to the metadata.

I totally forgot to point it out

ytx1991 commented 1 year ago

You can try 1.6.2. We added a new wallet RPC API did_find_lost_did. It can recover the missing did coin. example command: chia rpc wallet did_find_lost_did '{"coin_id":"YOUR_DID_ID_OR_COIN_ID"}'

matholamew commented 1 year ago

I was getting this issue in 1.6.1 and just updated to 1.6.2 . Still getting the same error as above, did I need to run the 'did_find_lost_did' command?

ytx1991 commented 1 year ago

Yes, the upgrade will not automatically fix this issue for you.

Ganbin commented 1 year ago

It seems to work. Yes!!!

I haven't try yet to move an NFT to the DID, but the command return me "success": true. Also after the command I got

   -Total Balance:         1.0  
   -Pending Total Balance: 1.0  
   -Spendable:             1.0  
   -Type:                  DECENTRALIZED_ID
   -DID ID:                did:chia:1220cmlvtcy8aghqudaadw57kal6wyh9rh0xevly3k38575whaglspmaq6v
   -Wallet ID:             2

And no error when doing chia wallet did get_did -i 2 so I assume it is ok. Love you!

Ganbin commented 1 year ago

It will be the best time to try the bulk move NFT to DID:P

Ganbin commented 1 year ago

@ytx1991 I would be interested to know what happen to the coin, technically.

matholamew commented 1 year ago

It seems to work. Yes!!!

I haven't try yet to move an NFT to the DID, but the command return me "success": true. Also after the command I got

   -Total Balance:         1.0  
   -Pending Total Balance: 1.0  
   -Spendable:             1.0  
   -Type:                  DECENTRALIZED_ID
   -DID ID:                did:chia:1220cmlvtcy8aghqudaadw57kal6wyh9rh0xevly3k38575whaglspmaq6v
   -Wallet ID:             2

And no error when doing chia wallet did get_did -i 2 so I assume it is ok. Love you!

Worked for me as well, thanks!

ytx1991 commented 1 year ago

It's because the DID transaction memo was set in a wrong way which caused the wallet doesn't recognize the DID. You still have the actual control of the DID coin.

DrakoPensulo commented 1 year ago

Unfortunately, it did not work for me. I get the message: Request failed: {'error': 'This DID 2ae4957c0044215d7d55c2711a160515090cccee791b8720dcf055fb6c61f52a is not belong to the connected wallet', 'success': False}

Spacescan.io correctly directs 2ae4957c0044215d7d55c2711a160515090cccee791b8720dcf055fb6c61f52a to my profile.