windingtree / videre-contracts

Videre Protocol smart contracts 📃
GNU General Public License v3.0
0 stars 2 forks source link

feat: SVG booking stub hook #1

Closed mfw78 closed 2 years ago

mfw78 commented 2 years ago

Currently the smart contract generates the tokenURI and then stores this in state. This is inefficient as all the state can be determined from on chain data and allows us to do on-chain generated booking stubs (as SVG graphics).

Therefore, we would design a small booking stub (similar to how an airline does their booking stub) which shows:

Name of accommodation facility Owner: 0x3847...3837

By parting out tokenURI to an external NFTDescription contract this could be upgradeable as design parameters change.

mfw78 commented 2 years ago

With the implementation of the Videre protocol, as only the ERC712 typed hash of the booking is stored on chain, extensive details pertaining to the state of a voucher are not directly available. The only data that is available is:

  1. The service provider the voucher relates to.
  2. What line the voucher relates to (ie. industry, such as stays, flights etc).
  3. Who owns the voucher (Ethereum address)
  4. The voucher state hash.

This opens up branding opportunities from an NFT perspective, something like 'NFT Inception' where we can have an NFT within an NFT. When generating the tokenURI SVG we can:

  1. Have a main 'industry' template, ie. a 'Stays' template.
  2. Do a call to a service provider's NFT SVG generator that generates a small logo / maybe selects a background. If viewed from outside the dapp, stop here only displaying part of the state hash and the owner.
  3. If viewed from within the dapp, by the owner or service provider, it would lookup the local state storage for the details and show voucher / industry specific details (like check-in, check-out, number of adults etc).
kostysh commented 2 years ago

this issue will be recreated later