NFT as a Wallet
Each NFT has its own unique NFT ID that also functions as an address on protocol level. The address can be deterministically generated from the ID as outlined in TIP-31, basically prepending NFT ID with the NFT Address Type and encoding it as a Bech32 string.
This means that any output (except for a foundry) can be locked to an NFT Address in the protocol. An NFT Address is a first class citizen on protocol level, just like an Ed25519 Address.
To unlock outputs locked under an NFT Address, the owner of the NFT must also unlock the NFT Output that defines it, hence proving ownership of the address. Note, that this is a significant difference compared to Ed25519 Addresses, where ownership is proved via a signing the transaction with a private key
Example Transactions
Unlock Funds Owned by the NFT
Transaction F shows how one can unlock an output locked to an NFT Address. Notice, that Basic Output #4 contains not only base tokens, but also native tokens. An NFT Output supports holding these native token directly in the output itself, but it would also be possible to place them in any output after Basic Output #4 is unlocked. It is the decision of the owner of the NFT to define what outputs to create in the transaction.
Just like any other output, an NFT Output supports holding up to Max Native Token Count (defined in TIP-22 for IOTA and TIP-32 for Shimmer). In case you need to store more native tokens, distribute them in Basic Outputs that are owned by the NFT.
Transfer an NFT owned by the NFT
So far in the examples the NFTs were always owned by a private key backed address, therefore they were unlocked via a signature. What happens when an NFT is owned by another NFT?
Similarly to Transaction F, the NFT that owns the other one must be unlocked in the transaction to prove the ownership. Transaction G shows how the "owner NFT" can unlock the "owned NFT" and transfer it to a new recipient.
It is possible to introduce circular ownership with NFT Addresses (and also with Alias Addresses). In such a case, NFT A is owned by NFT B, while NFT B is owned by NFT A. This would mean that unlocking them in a transaction doesn't require a signature, therefore anyone could unlock them that leads to race conditions on protocol level.
To prevent this undesired property, the protocol forces an NFT Unlock to only be able to reference a previous Unlock. As a result, circular ownership becomes a deadlock, as neither NFTs can be unlocked anymore.
Wallets and applications should implement mitigation strategies to prevent a deadlock: always perform circular ownership checks before sending an NFT to another NFT!