CIPs
CIPs copied to clipboard
NFT DID Method specification
Discussion for CIP-94
This is awesome. What other components are needed to enable an NFT to own and control a Ceramic doc? A DID provider?
There needs to be an implementation of a DID Resolver. This is the first need.
Then possibly a separate provider. Although it would be nice if you could just use the provider of the DID that is the controller of the NFT DID. I think this should be possible.
Ah ok. I've been trying to figure out the difference between a provider and resolver. Is this right?
DID Resolver -> General DID standard for resolving a DID document from a DID DID Provider -> Basically EIP-2844? So something that allows a DID to authenticate, sign, and decrypt?
So if a NFT DID resolver existed we could go from a did:nft
-> DID document -> If the controller
of the DID document is did:key
or did:3
, use an existing DID provider?
Yes exactly @codynhat 👍
Cool. Thanks for helping me understand! This is definitely something we are interested in and may be an area we can contribute.
@codynhat Hacked together a quick prototype of the resolver. https://github.com/ceramicnetwork/nft-did-resolver
Feel free to contribute! Will likely pick it back up when I have more free time, but don't think I'll get much longer today :)
Awesome! I'll take a look.
Is this proposal still active? I was wondering if the DID should not include the chain-id to identify on which chain the NFT resides.
@RobertOttSWITCH it does include the caip-2 chain_id! This proposal is active and has an experimental implementation here: https://github.com/ceramicnetwork/nft-did-resolver
@RobertOttSWITCH it does include the caip-2 chain_id! This proposal is active and has an experimental implementation here: https://github.com/ceramicnetwork/nft-did-resolver
Oh, perfect, I didn't get that in the first place, thanks.
Is there any plan for the specification and implementations to support Polkadot/Kusama + parachains NFTs?
Can smart contracts that currently own NFTs also update the data stream or does it only work with user wallets?
how would this support solana. get owner of solana NFT seems more straightforward and doesn't require a offchain indexer like subgraph
https://github.com/ChainAgnostic/CAIPs/issues/107
Solana Mainnet
solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token:{the-token-mint-address}/{the-token-account-address}
Solana Devnet
solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K/spl-token:{the-token-mint-address}/{the-token-account-address}
import { Connection, PublicKey } from "@solana/web3.js";
(async () => {
const connection = new Connection("https://api.mainnet-beta.solana.com");
const tokenMint = "9ARngHhVaCtH5JFieRdSS5Y8cdZk2TMF4tfGSWFB9iSK";
const largestAccounts = await connection.getTokenLargestAccounts(
new PublicKey(tokenMint)
);
const largestAccountInfo = await connection.getParsedAccountInfo(
largestAccounts.value[0].address
);
console.log(largestAccountInfo.value.data.parsed.info.owner);
/*
PublicKey {
_bn: <BN: 6ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a9>
}
*/
})();
@qbig is it possible to get the owner of an NFT at a past moment in time? e.g. given a timestamp?
@oed I think you can.
- with the unique mint account for each NFT, you can find out all its token accounts(at any point of time, only one of them has quantity 1, the current owner)
- all accounts are mostly created when they receive that NFT for the first time. So we we could assume each owner only buy the same NFT once, it would be easy to figure out who owned it at a past moment by just sort the owner by their creation time.
- but it get more complicated when:
- someone manually created a token account with 0
- past owners has buy and sell the NFT multiple times Then we would have to sort all the transfer transactions and find out
@oed could you share why " owner of an NFT at a past moment in time" is important?
@qbig In order to validate historical commits that are signed by previous owners of the NFT we need to be able to resolve this owner. Otherwise the event log would be invalidated every time the NFT changes owner, meaning that all data would be lost.
@oed argh I see. So it's not just the current owner, but past owners of every commits in the past that are required. To obtain the info for Solana, we need to grab every past transfers https://github.com/solana-labs/solana/blob/edefaa437f136479774e556f4d429d653198a0b1/explorer/src/components/account/history/TokenTransfersCard.tsx#L248
Big update to reduce complexity of the NFT DID implementation: https://github.com/ceramicnetwork/CIP/pull/126