DID NFT Metadata Ownership

Requires

Previously migrated / created onchain metadata in Ancon

How it works

  1. Alice changes metadata ownership in Ancon. It also creates a SendMetadataOwnership packet and stores it.

  2. Proofs for both UpdataMetadataOwnership and SendMetadataOwnership are requested.

  3. A Relay updates the latest roots in Chain B

  4. Chain B has the following contracts

    1. AguaclaraRouter (EVM) / AtlanticoRouter (Flow)

    2. AnconVerifier

    3. NFT

  5. Alice sends claim to Chain B

    1. AguaclaraRouter calls AnconVerifier, verifies Chain A metadata and packet proof with latest roots from Chain A

    2. Packet is read send to NFT when safeTransferFrom is called

    3. NFT onERC721Received or equivalent receives and verifies operator is whitelisted and applies metadata uri change.

Code

Requires

Deployment

  • Deploy Ethereum smart contracts in /ethereum both in Ancon and destination chain

Request metadata

  • Use AnconJS or call with JSON RPC ancon-sendRawTransaction

  • AnconJS will sign with CosmJS MsgChangeMetadataOwnership as a metatransaction inside an Ethereum transaction.

// Some code
// CosmsJS Message
const msgChangeMetadataBytes = ancon.msg.msgChangeMetadataOwnership(msg)

// Meta transaction
const cosmjsMetaTx = await sign({
    acct: cosmosAccount.account_number,
    addr: cosmosAccount.address,
    chainId:  'anconprotocol_9000-1',
    sequence: cosmosAccount.sequence,
    fee,
    msgChangeMetadataBytes,
    signer,  // Kepler or Stargate offchain signer
})

const tx = {
    data: cosmjsMetaTx,
    value: 0,
    chainId: 9000,
}

// EthersJS
const signedTx = await eth.signTransaction({ ...tx })
const res = await rpc.send('ancon_sendRawTransaction', [signedTx])

Register VC Permit with owner change and new metadata hash / cid

Create proof and send to verifier

Execute ownership transfer

Backend subscription to destination chain confirmation

Backend IPFS DAG duplication

Last updated