Itheum Docs
  • 👋Getting Started
  • Infrastructure
    • 🚆AI Data Workforce
      • Token Utility for the AI Data Workforce
      • Join the Workforce
      • Liveliness Staking Rewards
    • 🖼️Data NFT
      • Data NFT Types
        • Data NFT-FT
        • Data NFT-LEASE
        • Data NFT-PH (Plug-In Hybrid)
      • Data NFT Generative Image Tool
    • 🤖NFMe ID Vaults
    • 🔋Liveliness - On-Chain Reputation
      • Data Creator Liveliness Bonding
        • Liveliness Score States
      • Liveliness Staking
      • FAQ - Liveliness staking
    • 🔓Data Marshal Network
  • Apps
    • 🔥<BiTz> XP System
      • Bonus BiTz for protocol usage
    • 💹Data NFT Marketplace
      • Listing a Data NFT
      • Procuring a Data NFT
      • FAQ - Data NFT Marketplace
    • 📡Data DEX
      • Minting a Data NFT
        • Store Data and Mint a Data NFT - Step-by-Step Tutorial
        • Creator Donations For Community Airdrops
      • Using the claims Portal
      • CanaryNet Guardrails
        • Guardrail : Trading Data NFTs on 3rd Party NFT Marketplaces
    • 🔍Itheum Explorer
  • Integrators
    • 🔋Liveliness Staking Guides
      • Liveliness Staking Guide : Solana
      • Liveliness Staking Guide : MultiversX
    • 📙Data Streams Guides
      • Data Asset Storage Options
      • Data Stream URL Rules
      • Zedge Storage
        • Static File on IPFS
        • Dymamic File on IPFS + DNS Link
        • Dymamic File on IPFS + IPNS
        • Music Data NFT Compatible Dynamic Data Stream on IPFS + IPNS
        • Trailblazer Data NFT Compatible Dynamic Data Stream on IPFS + IPNS
      • Amazon Web Services (AWS)
        • Storage : AWS S3
          • Data NFT Streaming Automation - Multiple files
          • Manual upload of file to AWS for Data NFT Streaming
          • Data NFT Streaming Automation - Trailblazer
        • Hosting : AWS S3 + Cloudflare
          • Task 1: Use a domain name to "sit in front" of your AWS S3 Bucket Public URL
          • Task 2: Convert your AWS S3 Bucket into a "website"
          • Task 3: Use Cloudflare to connect your Domain Name to your S3 Bucket securely
          • Troubleshooting
      • Akord - Arweave blockchain
      • MultiversX Native Auth Protected API
    • 📗Data DEX Guides
      • MultiversX Blockchain
        • Guide 1 : Get Started with the Data DEX on MultiversX
          • Section 1: Setting up wallets on the MultiversX Blockchain - Devnet
          • Section 2: Getting xEGLD Gas tokens to pay for transactions - MultiversX Devnet
          • Section 3: Getting ITHEUM devnet tokens via the Data DEX - MultiversX Devnet
        • Guide 2: Get Started with Itheum Enterprise
        • Itheum Ecosystem Actions Catalogue
      • Astar Network
        • Guide 1 : Get Started with the Data DEX on Astar Network
          • Section 1: Setting up wallets on Astar Network - Shibuya Testnet
          • Section 2: Getting ITHEUM devnet tokens via the Data DEX - Shibuya Testnet
        • Guide 2 : Procure Data NFTs from the peer-to-peer Data NFT Marketplace on Astar Network
        • Guide 3: Use the “Web3 Gamer Passport” App on the Astar Network to trade your PlayStation Data
    • 💳Supported Wallets
      • MultiversX DeFi Wallet
      • Ledger Wallet
      • xPortal Wallet
      • xAlias (Login with Google)
    • 📕Trailblazer Guides
      • How to Acquire a Trailblazer
      • How to view a Trailblazer
      • How to List a Trailblazer
    • 📘Data Coalition DAOs (DC DAOs) Guides
      • Appointer > Delegator Pattern for Data NFT "Deputizing"
  • Developers
    • 👨‍💻Software Development Kits (SDKs)
      • Data NFT SDK
        • Guide 1 : Minting a Custom Data NFT Collection with Authenticated Data Streams (via SDK)
        • Guide 2 : Unlocking Data NFTs via MultiversX Native Auth
        • Guide 3 : Using Nested Streams to Access Nested Data Assets from a Primary Data Stream
        • Guide 4: Use the Data NFT "Deputy" Feature to delegate access of your Data NFTs to a Smart Contract
        • Guide 5: Preparing a Data Stream containing a password to protect a URL
      • Enterprise SDK
        • Guide 1 : Using Itheum Enterprise to Mint a Data NFT Collection (e.g. NFT Loyalty Card Solution)
      • Data Marshal Network SDK
        • Guide 1 : Make your Regular NFT Collection to be Data NFT-PH Compatible
    • 🥋Data Marshal Network
      • Data Marshal Node Gateway Endpoints
      • Data Marshal Transit Flags and Headers
    • 🛂Tech Support - Discord
      • Portal Bridge Support
    • 🛒Release Notes
      • Data DEX
      • Itheum Explorer
      • Data NFT SDK
      • Enterprise SDK
      • Data Marshal Network
    • 🔐Security
      • 🐞Bug Bounty
      • ℹ️Security Audit
  • Protocol
    • $ITHEUM Token
    • 🌉Token Bridge
      • FAQ - Omni-Chain Portal Bridge
      • $ITHEUM Token Multi-Chain Max Supply Rebalancing Transactions Audit
    • 🏆Token Rewards
      • Badges
    • 🧨Token Burning
      • Phase 1 : Token Burn Program
    • 🏛️Governance
      • Itheum Ecosystem DAO
        • Version 1: How it Works
      • Itheum xPand DAO
        • Itheum xPand Grants Program
          • Code Of Conduct
          • Announcement Guidelines
          • Cohorts vs Alpha Builders
        • Program 1: MultiversX Post-Hackathon Accelerator
        • Program 2: xPand DAO Music Data NFT Growth
    • 💪Hackathons and Dev Challenges
      • MultiversX xDay Hackathon
        • Project Ideas > MultiversX Dev Tooling and Infra
        • Project Ideas > Itheum
        • Test Data NFT Catalog
      • Community Test Events
        • Portal Traveler 🌀 : Test the Itheum Omni-Chain Portal (Bridge)
        • APR for Liveliness 🎖️: Test the Bonding + Staking Rewards Module
        • Minting and Bonding on Solana
  • R&D
    • 🏢Itheum Enterprise
    • 🗳️Data Coalition DAOs (DC DAOs)
    • 🎏Trailblazer
      • FAQ - Trailblazer
  • Legal
    • ⚖️Ecosystem Tools Terms
      • Datadex
        • Terms Of Use
        • Privacy Policy
      • Liveliness Bonding: Penalties and Slashing Terms
      • BiTz XP
        • Give BiTz
      • Omni-Chain Portal Bridge
      • Gamer Passport
        • Data Collection and Storage
    • 👮Content Guidelines
    • Itheum Data License
    • Terminology Disclaimer
    • Protocol Docs, Token Disclaimer
Powered by GitBook
On this page
  • This pattern enables some powerful new use cases for Data NFTs:
  • Step by Step Guide on How can we use this Pattern:
  1. Integrators
  2. Data Coalition DAOs (DC DAOs) Guides

Appointer > Delegator Pattern for Data NFT "Deputizing"

PreviousData Coalition DAOs (DC DAOs) GuidesNextSoftware Development Kits (SDKs)

Last updated 1 year ago

This pattern is core to how Data Coalition DAOs (DC DAOs)work, but fundamentally this pattern can be used by any Smart Contract to enable it to "manage" Data NFTs on behalf of someone else who owns the Data NFTs, whilst allowing an external (approved) entity to open the Data NFTs to view the Data Stream.

Data NFTs are minted by multiple entities; individuals, enterprises or 3rd party app developers using the Data NFT SDK. Ultimately, all these Data NFTs end up in "end-user wallets" (externally owned wallets). These Data NFTs can then be listed on NFT marketplaces and other NFT platforms by transferring your Data NFTs to these 3rd party Smart Contracts to give them "temporary ownership". However, given the specific method the Data Marshal Network uses to authenticate ownership of a Data NFT expects the "true" owner to make the "open this Data NFT" request, it's not possible for a Smart Contract with "temporary ownership" to open a Data NFT. It's also NOT useful for a Smart Contract to open a Data NFT as it cannot do anything with the data in its execution environment.

What would be useful is if the Smart Contract could specify a 3rd Party "end-user wallet" (externally owned wallet) to be able to open the Data NFT and do something useful with the Data. In this aspect, the Smart Contract "Appoints" an external "Deputy" addresses and appoints it to be able to open any Data NFT in the Smart contract possession.

This is exactly what is possible thanks to the Appointer > Delegator Pattern for "Deputizing"

This pattern enables some powerful new use cases for Data NFTs:

  • Data Coalition DAOs (DC DAOs) - DAOs that manage your data

  • Data Leasing platforms - Smart Contract platforms that can lease data for you (monthly subscriptions, pay-per-use, etc) by deputizing a 3rd party to use the data.

  • Complex Data NFT liquid staking/re-staking/fractionalization platforms - send your Data NFTs to a 3rd party Smart Contract which then delegates it to other Smart Contracts for nested usage of your Data NFTs (e.g. fractionalization of data ownership, liquid staking / re-staking of Data NFTs)

  • ... and many more.


Step by Step Guide on How can we use this Pattern:

Step 1: Setup Appointer Smart Contract (SC):

  • As detailed above, the system works in an "Appointer > Delegator" design. The Appointer is a Smart Contract that will hold Data NFTs. This is the Appointer Smart Contract.

  • The Appointer Smart Contract is ANY Smart Contract that exposes a specific public viewDeputyAddress method that returns an Address of an appointed "Deputy" that can Open the Data NFTs the Appointer Smart Contract holds (this is the ONLY requirement to make any Smart Contract an Appointer). Here is a basic Smart Contract you can use for reference or as a base to build on top of.

Step 2: Nominate a "Deputy"

  • The Deputy is just an end-user wallet" (externally owned wallet) that will be able to use the Data NFT SDKor other Itheum Protocol tooling to "open and view data" of the Data NFTs held inside the Appointer Smart Contract.

Step 3: The Deputy uses the Data NFT SDKto "open" the Data NFT

  • The deputy can now programmatically open a Data NFT that is stored inside the Appointer Smart Contract. It does this by using the Data NFT SDK. To understand this, let's go step-by-step on how to implement and test...

  1. Launch the Appointer SC as above.

  2. Move the test Data NFTs to your Appointer SC.

  3. You then use the wallet of deputyAddress to open the Data NFT of the Appointer SC.

  4. Install the latest version of the Data NFT SDK - and use this code sample for how to get your Deputy to open the Data NFT

// "@itheum/sdk-mx-data-nft": "2.7.0" (or above)
// "@multiversx/sdk-dapp": "2.28.0"

// import { DataNft, ViewDataReturnType } from "@itheum/sdk-mx-data-nft";
// import { useGetLoginInfo } from "@multiversx/sdk-dapp/hooks";
// const { tokenLogin } = useGetLoginInfo();

  async function fetchViaDeputyPersona() {
    const deputyAppointerSCAddress = "erd1qqqqqqqqqqqqqpgqd2y9zvaehkn4arsjwxp8vs3rjmdwyffafsxsgjkdw8";

    const _dataNfts = [];
    const nfts = await DataNft.ownedByAddress(deputyAppointerSCAddress, ["DATANFTFT-e0b917"]);

    _dataNfts.push(...nfts);

    const dataNft = _dataNfts[0]; // assuming we just had one Data NFT on the SC (for quick testing)

    if (!(tokenLogin && tokenLogin.nativeAuthToken)) {
      throw Error("No nativeAuth token");
    }

    const arg = {
      mvxNativeAuthOrigins: [decodeNativeAuthToken(tokenLogin.nativeAuthToken).origin],
      mvxNativeAuthMaxExpirySeconds: 3600,
      fwdHeaderMapLookup: {
        "authorization": `Bearer ${tokenLogin.nativeAuthToken}`,
      },
      asDeputyOnAppointerAddr: deputyAppointerSCAddress, // SC DOES expose viewDeputyAddress
    };

    const res = await dataNft.viewDataViaMVXNativeAuth(arg);

    if (!res.error) {
      if (res.contentType.search("application/json") >= 0) {
        const purifiedJSONStr = DOMPurify.sanitize(await (res.data as Blob).text());
        res.data = JSON.stringify(JSON.parse(purifiedJSONStr), null, 4);
      }

      console.log("WORKS! +++++++++++");
      console.log(res.data);
      console.log("+++++++++++");
    } else {
      console.error(res.error);
    }
  }
  1. The SDK's asDeputyOnAppointerAddr param is optional, if you leave it out, then you (as the Deputy) need to OWN the Data NFT to open it.

  2. Here are some potential errors you can get:

    1. There is an issue with the Appointer SC interface. i.e. public viewDeputyAddress

    2. The Appointer SC did NOT nominate your logged-in wallet as the Deputy

    3. The Appointer SC does not have the Data NFT you are trying to open

As you can see, this enables some powerful use cases for Itheum Data NFTs. Give it a go and reach out to us if you need any help

Mint a Data NFT on devnet (), log in, and go to Mint > Mint Data NFT form. Here is a OR use any other Data Stream you want.

Set a deputyAddress on the Appointer SC. Check the basic Smart Contract.

📘
SC template for the Appointer
test.datadex.itheum.io
test Data Stream you can use
SC template for the Appointer