Skip to content

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

Open
@greimela

Description

@greimela

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:

if new_owner is None:
# If no new owner was specified and we're sending this to ourselves, let's not reset the DID
derivation_record: Optional[
DerivationRecord
] = await self.wallet_state_manager.puzzle_store.get_derivation_record_for_puzzle_hash(
payments[0].puzzle_hash
)
if derivation_record is not None:
new_owner = unft.owner_did
magic_condition = Program.to([-10, new_owner, trade_prices_list, new_did_inner_hash])

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

Metadata

Metadata

Assignees

Labels

GUIRelated to the Chia GUINFTWalletbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions