A lightweight standard for non-fungible assets.

Overview

Nifty Asset

Nifty Asset

A lightweight standard for non-fungible assets.

Contents

Warning

nifty asset has not been formally audited – use in production at your own risk.

Features

The main goal of nifty asset is to provide an open-source, lightweight and composable non-fungible standard on Solana. This is achieved by:

  • Using a single account to represent a digital asset.
  • Storing as much or as little data on-chain using optional extensions.
  • Efficient zero-copy de-/serialization to minimize compute units utilization.
  • Full-featured standard, including royalty enforcement, delegates, lock/unlock, inscriptions and groups (collections).
  • Rust and JavaScript client SDKs.

Overview

Majority of NFT standards on Solana are built on top of SPL Token, which is mainly a fungible token program. A non-fungible is created by adding restrictions to fungible mints – i.e., for a mint to be considered "non-fungible", it must have supply 1, decimals 0 and no mint authority. As a consequence, NFT standards carry "baggage" from the requirements of fungibles to represent non-fungibles. For example, while non-fungibles have a supply of 1 by definition, there is still a requirement for separate mint and token accounts. Requiring a separate mint and token accounts is wasteful and adds complexity (e.g., more accounts validation) to a standard. In most cases, the only information required from a non-fungible token account is the owner (holder) address, given that the amount is always expected to be 1. At the same time, a token account takes 165 bytes of storage. Additionally, SPL Token - even including Token Extensions (a.k.a., SPL Token 2022) - does not enforce constraints to define different token standards.

Since different token standards will usually be defined in separate programs, the end result is a bloated (multiple accounts) standard – e.g., mint, token and (potentially) metadata accounts, in addition to SPL Token and Metadata programs. For most operations, all 5 accounts would be needed to interact with a non-fungible – and there are standards that the number of accounts is even higher.

nifty asset takes a different approach and re-imagines how non-fungibles are represented on Solana. In essense, a non-fungible asset is a unique slab of bytes on the blockchain identified by an address and it has an specific owner. When you transfer the "ownership" of this slab of bytes, you are changing the owner information of it. The contents of a non-fungible is as flexible as possible, given that they are "just" a slab of bytes – all data can be on-chain, or it can have "pointers" to external resources.

Packages

The packages below can be used to interact with nifty asset program.

JavaScript

npm install @nifty-oss/asset

Rust

cargo add nifty-asset

Building

To build the programs from the root directory of the repository:

pnpm install

to install the required libraries, then:

pnpm programs:build

This will create program binaries at <ROOT>/programs/.bin.

Testing

The repository contains both Rust BPF and TypeScript test. These can be run from the root directory of the repository:

pnpm clients:rust:test

for Rust BPF tests, and:

pnpm clients:js:test

for TypeScript tests.

Programs

This project contains the following programs:

  • Asset AssetGtQBTSgm5s91d1RAQod5JmaZiJDxqsgtqrZud73

  • Bridge BridgezKrNugsZwTcyAMYba643Z93RzC2yN1Y24LwAkm

You will need a Rust version compatible with BPF to compile the program, currently we recommend using Rust 1.68.0.

Clients

Each program in the project contains autogenerated Javascript and Rust clients:

Asset:

Bridge:

CLI

The project includes a Rust-based command-line interface:

Contributing

Check out the Contributing Guide the learn more about how to contribute to this project.

License

Copyright (c) 2024 nifty-oss maintainers

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You might also like...
Ktx is a lightweight terminal-ui utility for editing Kubernetes config
Ktx is a lightweight terminal-ui utility for editing Kubernetes config

ktx Ktx is a lightweight terminal-ui utility for editing the kubectl config If you work with a large infrastructure where you have to jump between clu

DIP721 - An Internet Computer Non-fungible Token Standard
DIP721 - An Internet Computer Non-fungible Token Standard

DIP721 - Introduction DIP721 is an ERC-721 style non-fungible token standard built mirroring its Ethereum counterpart and adapting it to the Internet

Dfinity's fungible token standard. Any PRs and comments are welcome,collaborate with us to build this standard

Dfinity's fungible token standard. Any PRs and comments are welcome,collaborate with us to build this standard

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Metaplex is a protocol built on top of Solana that allows: Creating/Minting non-fungible tokens;
Metaplex is a protocol built on top of Solana that allows: Creating/Minting non-fungible tokens;

Metaplex is a protocol built on top of Solana that allows: Creating/Minting non-fungible tokens; Starting a variety of auctions for primary/secondary

Bespoke toolkit for Non-fungible token (NFT) technology 🚀
Bespoke toolkit for Non-fungible token (NFT) technology 🚀

Bespoke toolkit for Non-fungible token (NFT) technology 🚀 What is Onft? Instead of forcing a consensus algorithm or peer networking on you, Onft prov

ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

DIP20: A fungible token standard for the DFINITY Internet Computer.
DIP20: A fungible token standard for the DFINITY Internet Computer.

DIP20 - Introduction Token standards are essential for the Internet Computer ecosystem, especially for the decentralized finance ecosystem (DeFi) syst

A standard for fungible tokens on Move.

Move Program Kit (MPK) The Move Program Kit (MPK) is a collection of software written in the Move programming language for the Aptos blockchain. Modul

Grimsby is an Erlang Port written in Rust that can close its standard input while retaining standard output (and error)

Grimsby An Erlang Port provides the basic mechanism for communication from Erlang with the external world. From the Ports and Port Drivers: Erlang Ref

NFT & Marketplace Contracts with royalties and fungible token support. Sample React app included.
NFT & Marketplace Contracts with royalties and fungible token support. Sample React app included.

NFT Market Reference Implementation A PoC backbone for NFT Marketplaces on NEAR Protocol. Reference Changelog Changelog Progress: basic purchase of NF

A contract to lock fungible tokens with a given vesting schedule including cliffs.

Fungible Token Lockup contract Features A reusable lockup contract for a select fungible token. Lockup schedule can be set as a list of checkpoints wi

An all-in-one IBC protocol providing fungible token transfer, interchain account, and async query functionalities

ICS-999 An all-in-one IBC protocol providing fungible token transfer, interchain account (ICA), and query (ICQ) functionalities, implemented in CosmWa

Modern, lightweight & standard-compliant bitcoin wallet runtime & cli without rust-bitcoin dependencies

Bitcoin protocol command-line wallet & tools Modern, minimalistic & standard-compliant cold wallet from LNP/BP Standards Association. Contributing Con

Easily embed and manage assets for your web application to build standalone-executables. Offers filename hashing, templating and more.

reinda: easily embed and manage assets This library helps you manage your assets (external files) and is mostly intended to be used in web application

A frontend to Assets purchased on Epic Games Store
A frontend to Assets purchased on Epic Games Store

Epic-Asset-Manager A frontend to Assets purchased on Epic Games Store Current Screenshot Install Arch Linux Use the AUR package Build flatpak meson _b

bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file
bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file

bevy_blender bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file.

📦  Crate Protocol allows anyone to create, manage, and trade a tokenized basket of assets, which we refer to as a Crate.
📦 Crate Protocol allows anyone to create, manage, and trade a tokenized basket of assets, which we refer to as a Crate.

📦 Crate Protocol Crate Protocol allows anyone to create, manage, and trade a tokenized basket of assets, which we refer to as a Crate. A Crate is alw

nAssets are Nova Finance’s framework for building programmable assets.
nAssets are Nova Finance’s framework for building programmable assets.

nAssets are Nova Finance’s framework for building programmable assets. nAssets can be used to tokenize and store collective forms of value while also instructing assets to yield, exchange or rebalance.

Comments
  • Metafrost/royalties

    Metafrost/royalties

    To-do:

    • [x] JS tests
    • [x] Decode royalty extension in CLI
    • [x] Create asset w/ Royalties extension via CLI
    • [x] Refactor transfer logic to reduce if nesting, if possible
    • [x] Check logic matches royalties feature in TM
    • [x] Fix AND and OR JS deserialization implementations
    • [x] Fix cyclic dep issue
    • [x] Add Grouping to Bridge for Collection assets
    opened by samuelvanderwaal 0
  • Set authority as optional signer

    Set authority as optional signer

    This PR sets the authority as an optional signer on the create instruction. This allows a different authority than the payer to sing the create instruction when a group is being set. Note that the authority of the asset must match the authority of the group asset for the asset to be added to the group.

    opened by febo 1
Owner
Open source protocols for digital assets on Solana
null
A data compatibility project for Minecraft's assets

Data Compat MC Data tool for the Falcon MC project. Description DataCompatMC is a cli tool designed to help deal with the many different versions of M

GrizzlT 5 Dec 11, 2022
A data compatibility project for Minecraft's assets

Data Compat MC Data tool for the Falcon MC project. Description DataCompatMC is a cli tool designed to help deal with the many different versions of M

FalconMC 2 Jul 6, 2022
Decryption tool for assets.pie from Teenage Mutant Ninja Turtles: The Cowabunga Collection. This tool was made in its entirety by SowwyItsAnAlt.

Cowabunga Decryption tool for assets.pie from Teenage Mutant Ninja Turtles: The Cowabunga Collection. This tool was made in its entirety by SowwyItsAn

Masquerade 8 Dec 22, 2022
Adds support for wasm/wat assets in Bevy, and enables easier scripting

bevy_wasm_scripting Adds support for wasm/wat assets in Bevy, and enables easy scripting. This is enabled through the wasmer crate. Prepare for public

null 9 Dec 20, 2022
Non-Linear Ray Casting

linon Non-Linear Ray Casting References E. Gröller, “Nonlinear Ray Tracing: Visualizing Strange Worlds,” The Visual Computer, vol. 11, no. 5, pp. 263–

Niklas Korz 13 Dec 1, 2022
Porting Go standard libraries to Rust.

Crabmole Porting some Go standard libraries in Rust Note: This crate will not port all go standard libraries in Rust, but some missing libraries in Ru

Al Liu 6 Jan 2, 2023
Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust

Heavy - an opinionated, efficient, relatively lightweight, and tightly Lua-integrated game framework for Rust Slow down, upon the teeth of Orange Heav

Shea Leffler 12 Mar 18, 2022
A lightweight Datalog engine in Rust

datafrog Datafrog is a lightweight Datalog engine intended to be embedded in other Rust programs. Datafrog has no runtime, and relies on you to build

The Rust Programming Language 693 Jan 2, 2023
A lightweight, cross-platform epub reader.

Pend Pend is a program for reading EPUB files. Check out the web demo! Preview Image(s) Installation Building Pend is simple & easy. You should be abl

bx100 11 Oct 17, 2022
A lightweight job framework for Bevy.

bevy_jobs A lightweight job framework for Bevy. Getting started Defining a job: pub struct FetchRequestJob { pub url: String, } impl bevy_jobs::J

Corey Farwell 3 Aug 31, 2022