Mintbase Upgraded 544 NFT Contracts

Nate Geier
Mintbase
Published in
5 min readSep 17, 2021

Yes, NEAR’s major claim to fame is that it’s set up to be one of the first sharded POS chains, but for us at Mintbase we see the account system as being the rock star. First we have to understand the access key system, dive into what is possible, and a bit into Mintbase’s roadmap.

NEAR account system

Near accounts and contracts are all the same. You can have an account named nate.near, (not 0x8d7dd7b604b4e……) and this can act like your bank account where you send / receive the internet monies. We can also write a smart contract in Rust or AssemblyScript and deploy it to that account name. So nate.near can also be a DeFi or NFT smart contract. We also get subdomains so neat.nate.near is a thing.

Mintbase contract factory

Our users deploy their own store, which is their own smart contract where they have all the ownership rules. You can also change contract ownership, but that’s for another post. We deployed our store factory to mintbase1.near and this is going to be how the new digital economy will run. Imagine every store is their own independent company, their own dapp, a full stadium for seating, starting point worlds to observe only their transactions. This is extremely scalable, and we are just getting started.

So if you want your store name to be wildeverse it deploys wildeverse.mintbase1.near. As of writing this we now have 544 stores, all of which yesterday were upgraded with new function names, and better return structures (really good for developers).

What’s possible on NEAR

If you install the NEAR CLI and switch it to mainnet by…

npm install -g near-cliexport NEAR_ENV=mainnetnear keys wildeverse.mintbase1.near

Returns

[
{
access_key: { nonce: 1, permission: 'FullAccess' },
public_key: 'ed25519:2ib9oB8DXNw3ddhZ4Te9oP9MTeSqD9ouXiJoRxv8EktT'
}
]

Let’s take a step back

A NEAR name can have multiple keys. You can have nate.near and it can be accessed through multiple ways like Ledger and other hardware wallets, and Trust Wallet at the same time. The NEAR WebWallet makes an interesting use of this with 2FA via phone, email, seed, and or ledger. You can add or remove any one at any time.

A new access key gets created for every dapp / wallet connection you make and you choose what level of trust you have with that dapp (very SSO-esk). You might give an allowance for the game you connect to spend a small amount on your behalf so you’re not bouncing back and forth to the wallet like on Ethereum, or we can get super granular, creating keys that only gives one rights to specific functions calls, say for oracles.

Most importantly we can delete these keys!

Check Nate’s out

near keys nate.near

Why Mintbase has your keys

Yes, NEAR is very, super-duper new. We are still helping to modify the NFT NEP-171 standard (equivalent of the ERC721) and things are always changing. We are working with different laws of physics on a sharded chain with flying one second block times, where we have to account for storage cost and sharded async dynamics. So if the standard changes mid usage, as it did with how developers can now get data from an accounts owned NFTs, all our contracts would be non-compliant. We opted for upgradable control for now to keep compliance rolling, as without the Full Access keys they would just be a bunch of non-interoperable assets and that’s not really fun or useful.

Will we transfer them to you?

Probably, or at the very least ours will get deleted. As mentioned above, we can delete this Full Access Key and this can be viewable by anyone with the above commands. We hope in the process of deleting ours in the future, we would give the account that deployed the contract Full Access or partial so you can’t delete other folks now owned NFTs. It’s all very early.

Our plan once things start to setting and we really nail interoperability with other dapps like Paras, NFT HipHop, and Pluminite, we will open source our contracts. Ideally we’ll have an upgrade button for the contract deployer where they can decided if they want to get any new fancy loan / fractional ownership features.

What Was Upgraded

When you hit the function nft_tokens_for_owner before, we just returned an array of token ids like on Ethereum, but now we are working with a new world so we get better outcomes.

Running `nft_tokens_for_owner`

near view wilde.mintbase1.near  nft_tokens_for_owner '{"account_id":"nate.near", "from_index": "0", "limit": 10}'

Returned Before

returned ["103", "104"]

Now Returns

[
{
id: 103,
owner_id: { Account: 'mintspace.near' },
approvals: { 'market.mintbase1.near': 137 },
metadata: {
title: null,
description: null,
media: null,
media_hash: null,
copies: 10,
issued_at: null,
expires_at: null,
starts_at: null,
updated_at: null,
extra: null,
reference: 'bZnQvm7TCIACOeucqO00FXMSQQSSZorRbvNnHD--Rjk',
reference_hash: null
},
royalty: {
split_between: {
'caro.near': { numerator: 1000 },
'wildeverse.near': { numerator: 2000 },
'nate.near': { numerator: 1000 },
'mintspace.near': { numerator: 6000 }
},
percentage: { numerator: 1000 }
},
split_owners: null,
minter: 'mintspace.near',
loan: null,
composeable_stats: { local_depth: 0, cross_contract_children: 0 },
origin_key: null
},
{
id: 88,
owner_id: { Account: 'mintspace.near' },
approvals: { 'market.mintbase1.near': 130 },
metadata: {
title: null,
description: null,
media: null,
media_hash: null,
copies: 10,
issued_at: null,
expires_at: null,
starts_at: null,
updated_at: null,
extra: null,
reference: 'bZnQvm7TCIACOeucqO00FXMSQQSSZorRbvNnHD--Rjk',
reference_hash: null
},
royalty: {
split_between: {
'caro.near': { numerator: 1000 },
'mintspace.near': { numerator: 6000 },
'nate.near': { numerator: 1000 },
'wildeverse.near': { numerator: 2000 }
},
percentage: { numerator: 1000 }
},
split_owners: null,
minter: 'mintspace.near',
loan: null,
composeable_stats: { local_depth: 0, cross_contract_children: 0 },
origin_key: null
},
]

Other Upgrades

Pagination

You can run out of gas fetching too much data from a contract so now we have pagination bits for get all tokens: `nft_tokens` and better return data from single `nft_token`.

near view wildeverse.mintbase1.near nft_token '{"token_id": "6"}'near view wildeverse.mintbase1.near nft_tokens '{"from_index": "0", "limit": 10}'

Indexer helpers for Wallet and others

Changed the name of our batch_transfer function to nft_batch_transfer so indexers can pick up the receipts better (hope the NEAR Web Wallet will have better access.

Also added nft_batch_mint and nft_batch_burn

Thanks for keeping an open mind. We are fully bush whacking out here in the deep wilderness and we love it.

Nate

--

--