Saltearse al contenido

Assign an NFT for a provenance claim through a registrar

Esta página aún no está disponible en tu idioma.

The process for assigning an NFT to a provenance claim through a registrar consists of two major steps:

  1. Have the originator create a delegation for the registrar. This permission can either be specific (assignNft), or general (the empty string).

    Loading graph...

    graph TB
    
       Bill@{ shape: rounded }
       Registry@{ shape: rounded, label: "Delegation Registry"}
       RobertRegistar@{ shape: rounded, label: "Robert Registrar" }
    
       Bill --->|Let Robert Registry act in my name| Registry
  2. The registrar calls the assignNft function 🔗, using these steps:

    Loading graph...

    graph TB
    
       Bill@{ shape: rounded }
       DeleRegistry@{ shape: rounded, label: "Delegation Registry"}
       IdRegistry@{ shape: rounded, label: "Identity Registry"}
       RobertRegistrar@{ shape: rounded, label: "Robert Registrar" }
       Gateway@{ shape: rounded, label: "Provenance Gateway" }
       ProvRegistry@{ shape: rounded, label: "Provenance Registry" }
    
       RobertRegistrar ==> |2 Assign NFT for Bill's existing Provenance Claim| Gateway
       Gateway --> |3a Is this OK?| IdRegistry
       IdRegistry --> |3b Is this OK?| DeleRegistry
       DeleRegistry --> |3c Yes| IdRegistry
       IdRegistry --> |3d Yes| Gateway
       Gateway ==> |4 Assign NFT for Bill's existing Provenance Claim| ProvRegistry
    1. The registrar decides to assign an NFT to an existing provenance claim. In most cases, the registrar would need to create a new NFT with the correct metadata first.

    2. The registrar sends a transaction to the assignNft function 🔗. This transaction includes the provenance claim’s ID as well as the NFT contract and token ID.

    3. The assignNft function 🔗 verifies that the registrar is delegated the right to register content by the originator. This check goes through the IdRegistry’s canAct function 🔗, which uses the DelegateRegistry’s checkDelegateForContract function 🔗.

    4. The ProvenanceGateway’s assignNft function calls the ProvenanceRegistry’s assignNft function 🔗

    5. That assignNft function 🔗 runs more checks and then registers the provenance claim.

Step by step directions

  1. As a user, create a delegation to another Royal ID whose private key you know.

  2. Set up environment variables.

    VariableMeaningHow to get it
    PRIVATE_KEYYour registrar private keyYou can usually get it from the wallet
    CLAIM_IDThe ID for your provenance claimUse the indexer 🔗
    NFT_ADDRThe address of your NFT contract
    TOKEN_IDThe token ID of your NFT within that contract
  3. If necessary, install Foundry 🔗.

  4. Run these commands to use the cast command 🔗.

    Terminal window
    PROVENANCE_GATEWAY=0x000000456Bb9Fd42ADd75F4b5c2247f47D45a0A2
    ENDPOINT=https://mainnet.base.org
    cast send --rpc-url $ENDPOINT \
    --private-key $PRIVATE_KEY $PROVENANCE_GATEWAY \
    "assignNft(uint256, address, uint256)" \
    `cast to-uint256 $CLAIM_ID` $NFT_ADDR `cast to-uint256 $TOKEN_ID`
  5. When you get the transaction hash, you can use a block explorer 🔗 to see the log entry with your assigned NFT.