Comments (10)
Come to think of it, a lot of the information here is already accessible runtime from a &{MetadataViews.Resolver}
reference like id, type and uuid. So maybe this could just boil down to a Minter
or Source
view that discriminates who really minted this, if the contract supports multiple minters.
On the other hand, what if the resource in question here is a wrapper, how do you then expose the data from the underlying resource it wraps?
from flow-nft.
Come to think of this even more, I do not belive id is present in &{MetadatViews.Resolver}
so i still think this is a good idea.
from flow-nft.
@bjartek this is an interesting nut to crack here. How do other chains solve this problem if at all? Or if there is no technical solution a given other chain, how does the community have some consensus on the correct minter?
from flow-nft.
Well on chains that are not resource oriented a shared contract would give bad resource isolatiob, but on flow resources are owned by users not contracts. So i guess the problem is not there.
from flow-nft.
I was thinking like on an evm chain if someone were to clone and deploy a contract, who is to say which one is the 'correct minter'? Maybe that's what the 'discriminator' field here would do?
from flow-nft.
Wondering if this should contain a nounce and the path an item is stored at. Like this maybe?
/// This view is there to display the Identity of this resource or the resource it has wrapped.
/// $param id: The id of the resource
/// $param uuid: The universal id of the resource that is guaranteed to be unique
/// $param type: The type of the resource, type+id is useful to map to uuid
/// $param typeIdentifier: A more human readable version of type
/// $param discriminator: If this resource is a multi tenant like resource like starly/rarible discriminator can be used to discriminate it
/// $param nounce: A nounce that increases if a item is moved so that you can verify that a pointer to it was made for the given nounce
/// $param path: The path a resource is stored in. Very useful if you want to send a resource to somebodies storage.
pub struct Identity{
pub let id:UInt64
pub let uuid: UInt64
pub let type:Type
pub let typeIdentifier:String
pub let discriminator: String
pub let nounce: UInt64
pub let path: PublicPath
init(id:UInt64, uuid:UInt64, type:Type, discriminator:String, nounce: UInt64, path: PublicPath) {
self.id=id
self.uuid=uuid
self.type=type
self.typeIdentifier=type.identifier
self.discriminator=discriminator
self.nounce=nounce
self.path=path
}
}
from flow-nft.
@bjartek Can you elaborate a bit more on the discriminator? I'm not sure how that is used to differentiate?
Also, what is stopping someone from faking the discriminator and the nonce?
for path
, you're saying that if you had a random generic NFT, you could get the path from it to deposit it without knowing the actual contract it came from?
from flow-nft.
Discriminator could be used to discriminate things like
- the minter of a starly card
- the kind of nft in gaia
- the kind of nft in mintstore
- the minter in rarible
Basically all shared contracts that can be grouped on something besides where they happend to be stored.
from flow-nft.
Nobody is stopping anybody from faking anything no matter the view. I do not see what makes it relevant.
from flow-nft.
If you know the path you can try to borrow the NFT.Receiver or NFT.CP on that path (not everybody kink them :( )
and deposit the item to somebody else. In things like alchemy and find this is now hard coded everywhere.
from flow-nft.
Related Issues (20)
- Update flow-nft contracts to comply with Stable Cadence changes HOT 1
- Developer Portal broken link HOT 2
- Normalize flow.json HOT 3
- Adequate comments to docgen tool and include generated docs in repo HOT 3
- Create an example of an NFT burner HOT 5
- MetadataViews.getXXX functions does not work with INFT HOT 4
- Adding support in MetadataViews to support viewing nested resources HOT 17
- Packs Metadata Standard HOT 11
- Add a view to capture constraints that IP rights holders may require consumers of their IP to observe HOT 19
- Add new `attributes` field and associated views. HOT 11
- View to Describe Actions that can be taken on an NFT HOT 6
- Extended Edtition view HOT 6
- Flow NFT contracts do not implement a standard way to name their public collection path HOT 3
- ERC 1155 like NFTs are not properly supported by metadata views HOT 16
- Contracts not deployed to emulator by default, update docs to provide guidance
- Update MetadataViews Collection views to include more flexible public & private types HOT 17
- Fetch NFT metadata with storage iteration HOT 1
- Create a Document for the docs site that explains what each metadata view is for and how to use it
- Destroying an NFT should trigger an event HOT 3
- Impossible to count number of NFTs in large collections and get the IDs HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow-nft.