Gem Bank lets you manage a whitelisted collection of NFTs ("gems" 💎) across any number of lockable vaults.


  • Anyone with a wallet can create a bank

  • Each bank has an effectively unlimited number of vaults, each created by a vault owner

  • Each vault can store an effectively unlimited number of NFTs (different mints, yes)

    • Dirty little secret - it can store normal tokens too, not just NFTs

  • You as the bank manager can decide which NFTs are / aren't allowed in the vaults. That's done through whitelisting

  • You as the bank manager can lock / unlock specific vaults, controlling whether vault owners are allowed to withdraw / deposit gems

  • You also have the option of freezing ALL vaults at the same time

  • You as the bank manager can also configure extra points for rarities for your collection


  • Whitelists are configured at bank level - ie they apply to all vaults

    • What if you want multiple different whitelists? Start multiple banks - there is no limit per keypair

  • Currently you can whitelist NFTs by

    • 1)mint

    • 2)verified creator

    • 3)candy machine ID (which actually is simply stored as creator #0)

  • If 0 mints / creators have been whitelisted, then ANY NFT is allowed into the vaults

  • If even a single mint / creator is whitelisted, then all NFT deposits start to be checked against that whitelist

  • The whitelist is an "OR" type - meaning if you whitelist 3 mints and 3 creators, the NFT only needs to match one of the mints, or have one of the creators to be allowed in

  • Only verified creators count (read Metaplex docs if you don't know what "verified" means)

  • There is no cap on how many mints / creators you can whitelist - but you will have to send a single transaction per each

Deposits & Locking

  • Deposits / withdrawals are done by the vault owner, the bank manager has no way to move gems in/out of the vault, unless its theirs

  • That said locking / unlocking is done by the manager

    • It's sort of like you'd have it in a real bank - you show up, the manager opens the vault, you deposit/withdraw what you want, then the manager locks the vault

  • Any tokens can be deposited, any number of them

  • Funds are never comingled with other users funds - eg your token X deposit will never be comingled with token X by another user


  • You as the bank manager can configure different NFTs in your collection to score different amounts of "rarity points"

  • Those rarity points are summed up and stored on the Vault struct

  • Any program that builds on top of the bank can make use of these rarity points

  • Rarity points for each NFT must be in the range 1 - 65,535

  • Rarity points are optional. If not specified each mint simply gets a 1

  • Example:

    • You have a collection with 3 NFTs

    • You upload a config that says:

      • Mint_1 NFT = 5 rarity points

      • Mint_2 NFT = 3 rarity points

    • You leave Mint_3 unspecified

    • User 1 shows up and uploads Mint_1 and Mint_3 NFTs into a vault. The vault will now record a total of 5+1 = 6 rarity points for this user

    • User 2 shows up and uploads Mint_2 NFT into a vault. The vault will now record a total of 3 rarity points for this user

  • Rarity configuration is set PER BANK. Ie if the same bank manager starts 2 banks, he would have to configure NFTs twice

    • This might seem tedious, but it opens up the ultimate flexibility for bank managers to configure their bank how they want

    • The alternative approach (not taken) would be to set rarities per collection once - but what if one bank manager views rarity different to another? Gets tricky

  • Rarity configuration can be done for ANY mint - ie you don't need to be the collection owner to set rarities (again remember you're setting them for YOUR BANK ONLY)

  • Rarity configuration isn't free. For a 10,000 NFT collection it will cost ~10SOL on mainnet (this is because we need to create a PDA per NFT to store the score. We've done what we could to make it as small as possible)

This feature is only added to the protocol and the SDK, NOT the front-ends. To see it in action find the file called gem-farm.rarities.test.ts


  • I built Gem Bank imagining it as the "ground 0" program for any future gemworks apps

    • Almost any more complex use-case (staking, lending, sharding, etc) first requires secure, whitelisted storage

  • But maybe it can also be used on its own! Eg maybe you're a DAO and want to manage an NFT collection across a number of users, letting them only deposit certain whitelisted NFTs

  • If you have a cool use-case for Gem Bank - I'd love to hear from you!

Last updated