πŸ”Œ Wallet Connector (CIP-30)

  1. Connect button

    1. UI for Unconnected
    2. Modal or Popup for the Wallet choice
    3. Connecting the wallet: https://cips.cardano.org/cips/cip30/
    4. UI for Connected : Display Ada handle or Staking Id + Ada balance
  2. Proof of Wallet Ownership

    1. Usually done with a SignData call
    2. (To support hardware wallets) β†’ Signing the staking id in a transaction to prove wallet ownership.

    <aside> ✍️ This can be done by simply having the user send himself a tiny amount of Ada in a transaction that is NOT submitted. The witness signature of the /0/2 (staking) key can then be verified on the transaction body.

    </aside>

πŸͺ™ Minting NFTs

  1. Proof of ownership of an NFT: Require the relevant NFTs in the inputs and send it right back to the owner in the same transaction. If the user can sign this: he owns those NFTs
  2. Student Class Registration / Completion Tickets
    1. Consider soul-bounding (put staking address or payment credentials hash in the metadata is the simplest soulbounding). When interacting with an NFT later, you will need to check the metadata for the soulbound address and verify the user is indeed using that wallet
      1. Staking address is simpler, but it could be cheated with a mangled address.
      2. Payment credentials of an address is easier, but it requires making sure the NFT is at a specific address (maybe only possible with single address wallets).

πŸ•ΈοΈ Web2 to Web3 interactions

  1. Record of the desired purchased or redeemed LEB points (web 2) in the transaction metadata using the message CIP-20: https://cips.cardano.org/cips/cip20/. There is a limit of 64 characters per string in the β€œmsg”.

    {
      674: {
    		"msg": [
          "user: [email protected]",
    			"points cost: 2000",
          "description: Buying class entry for Cardano Dev - Beginner",
        ]
      }
    }
    
  2. Security is an issue here as we are transacting between Web2 and Web3:

    1. The web 3 wallet must be confirmed with proof of ownership in the web session when you make any transaction with web 2.
    2. The web 2 user must be logged in also β†’ this gives you the information of the linked web 3 wallet.
    3. Only do an actual transaction on the web 2 backend once the Cardano transaction is confirmed enough times on the blockchain and only if the transaction is from the right wallet (as identified by the payment credentials, or the presence of a special NFT).