Developers Forum for XinFin XDC Network

Cover image for NFT Keys to Manage Multi-Sig Wallets
Quincy Jones
Quincy Jones

Posted on

NFT Keys to Manage Multi-Sig Wallets

Most people are familiar with the aesthetic functions of non-fungible tokens (NFTs), but their capabilities actually include functionality that goes far beyond anything visual. Those who understand that NFTs can have real utility usually think of tickets or supply chain tools. But an NFT can also act as a key.

In the world of crypto, having multiple signatures required for wallet access allows for further security and further redundancy as well as a decentralized mechanism for giving multiple parties custody of assets in a wallet.

In addition, using a key to cast a signature on a multi-signature wallet allows users to easily move the access key to other devices. Users can even delegate their key to another smart contract for further functionality. Contract keys may be a popular contract design in the future due to their ability to hold NFTs as an access mechanism to the contract. As contracts become increasingly sophisticated, access keys may manage access rights for all users and contracts that use them, and can allow further automation when used within other smart contracts.

Image description

In this Multisig Key contract, I added in a few additional functions. Instead of tying each account to an address, I tied it to a token. This allows for users to use an NFT as a key to sign a proposed transaction. In theory, the NFT can act as a ballot to propose and vote on proposals proposed within the contract by any of the key holders. This means a multisig contract can be used to propose and vote on principal items by the key holders as well as act as a standing treasury for assets to be decentrally held in custody and voted on to be reallocated to other addresses.

The Multisig Key contract can primarily act as a decentralized trust, a dApp, DAO, escrow, or even a secondary wallet for someone who wants to have multiple protective measures to safeguard their assets. With any of these use cases, users can have a form of governance and community control over a given smart contract. In fact, they can make community-driven decisions by having each user hold a key which they use to vote. Additional means of governance can be programmed into the smart contract using the signer key tokens as governance tokens for any additional function created.

dApps and DAOs can also use this contract as a library for basic governance amongst a given set of users. Keys can be used to manage assets and votes within their applications, greatly increasing functionality of a dApp with little effort. As further libraries are built out, future dApps and DAOs will be able to gain greater functionality for less.

when engaging with the contract there are many different Settings (proposals, confirmation to a proposal, type of proposal) so all input parameters are an array with a syntax in accordance to the Setting

submitProposal() Parameters

function submitProposal(uint  _ammount, address [] memory  _address,string  memory  _topic,string  memory  _messege) public CheckKeys returns(bool)
Enter fullscreen mode Exit fullscreen mode
  • uint: [Amount,tokenID]
  • address: [0: toAddress, 1: XRC_Type, 2: NFT_id] (token based parameters)
  • String: [Topic,Message, FunctionExecution() ]

#int [] Based Parameters

governance Vote

  • [NA]

XDC & XRC20 transactions

  • [amount,N/A]

XRC721&1155 Transactions:

  • [1,tokenNumber]

#address [] Based Parameters

Note: 0x0000000000000000000000000000000000000000 is used as a 0 place hoder

Governance Vote:
A blank vote where token holders can vote on a topic (no execution is made other than showing the result of a majority vote)

  • 0: (address) 0x0000000000000000000000000000000000000000 (Required!)
  • 1: (address) 0x0000000000000000000000000000000000000000 (Required!)

XDC Transactions:
A simple transaction sending XDC to another address upon a completed vote

  • 0:(address) toAddress
  • 1: N/A

XRC20 Transactions:
A simple transaction sending XRC20 tokens to another address upon a completed vote

  • 0: (address) toAddress
  • 1: (address) XRC contract address

XRC721&1155 Transactions:
A simple transaction sending a XRC721 or XRC1155 tokens to another address upon a completed vote

  • 0: (address) toAddress
    • 1: (address) XRC contract address

#String [] Based Parameters

Topic & Message
Topic and message of transaction or vote describing the

  • ["Topic name" , "message",""] : XDC transaction without function excution or blank transaction
  • ["Topic name" , "message","XRC20"] : XRC20 transaction or blank transaction
  • ["Topic name" , "message","XRC20"] : NFT transaction or blank transaction

FunctionExecution() [Not completed]

Function Execution can only be made with an XDC transaction and execute another contracts external functions (only one execution at a time!)
so a multi executing function would require to be done in a separately created contract where the Treasury would execute to automate multiple executions

  • ["Topic name" , "message", FunctionExecution()]

Github:https://github.com/CoinClubQuincy/Multi-Sig-Treasury

Discussion (1)

Collapse
akhekade profile image
Atul Khekade

Especially useful when custody of NFTs of financially important assets. Like a title deed or an expensive art or Bill of lading!

Good one!