Chia-Network / chia-blockchain

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

[Bug] NFT DID ownership association is handled incorrectly in some cases #13712

Open greimela opened 2 years ago

greimela commented 2 years ago

What happened?

There are some situations where the association of NFTs and DIDs is not handled correctly.

One issue seems to be this code in the wallet: https://github.com/Chia-Network/chia-blockchain/blob/e4d4c8f57d3486fd37563c58d17441320d532210/chia/wallet/nft_wallet/nft_wallet.py#L713-L722 It decides to keep the previous DID in the metadata if I transfer the NFT to one of my own addresses. However, in case I received that NFT directly on mint, by being the target_address, I actually don't own the currently attached DID.

The NFT ownership layer itself also has a condition where it only requires a DID announcement if I want to change the DID. But I can theoretically keep the minter DID attached forever, if I wanted to...

And since it's the wallet deciding whether it wants to keep the DID in the NFT, there could be one wallet in the ecosystem that handles it differently.

So I basically can't trust any DID assignment as soon as a change of the p2_puzhash occurs, e.g. when cancelling an offer on chain. But the Chia wallet will still show it as being attached to my DID.

Version

1.6.0

What platform are you using?

macOS

What ui mode are you using?

GUI

Relevant log output

No response

BrandtH22 commented 1 year ago

@ytx1991 Can we reopen this issue?? There is still a discrepancy based on the owner DID.

The Owner DID is not properly removed when performing a transfer to an xch address. This causes issues in the chia client when a project mints NFTs that have target addresses.

Also, a result of this issue has been reported under issue #14748