examples/

directory
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: BSD-3-Clause

README

examples

This folder is dedicated to all "example" luxvms that we build to showcase the capability of the vmsdk. If you are interested in writing your own luxvm, this is usally the right place to start.

Beginner: tokenvm

We created the tokenvm to showcase how to use the vmsdk in an application most readers are already familiar with, token minting and token trading. The tokenvm lets anyone create any asset, mint more of their asset, modify the metadata of their asset (if they reveal some info), and burn their asset. Additionally, there is an embedded on-chain exchange that allows anyone to create orders and fill (partial) orders of anyone else. To make this example easy to play with, the tokenvm also bundles a powerful CLI tool and serves RPC requests for trades out of an in-memory order book it maintains by syncing blocks. If you are interested in the intersection of exchanges and blockchains, it is definitely worth a read (the logic for filling orders is < 100 lines of code!).

To ensure the vmsdk stays reliable as we optimize and evolve the codebase, we also run E2E tests in the tokenvm on each PR to the vmsdk core modules.

Expert: indexvm

The indexvm is much more complex than the tokenvm (more elaborate mechanisms and a new use case you may not be familiar with). It was built during the design of the vmsdk to test out the limits of the abstractions for building complex on-chain mechanisms. We recommend taking a look at this luxvm once you already have familiarity with the vmsdk to gain an even deeper understanding of how you can build a complex runtime on top of the vmsdk.

The indexvm is dedicated to increasing the usefulness of the world's content-addressable data (like IPFS) by enabling anyone to "index it" by providing useful annotations (i.e. ratings, abuse reports, etc.) on it. Think up/down vote on any static file on the decentralized web.

The transparent data feed generated by interactions on the indexvm can then be used by any third-party (or yourself) to build an AI/recommender system to curate things people might find interesting, based on their previous interactions/annotations.

Less technical plz? Think TikTok/StumbleUpon over arbitrary IPFS data (like NFTs) but all your previous likes (across all services you've ever used) can be used to generate the next content recommendation for you.

The fastest way to expedite the transition to a decentralized web is to make it more fun and more useful than the existing web. The indexvm hopes to play a small part in this movement by making it easier for anyone to generate world-class recommendations for anyone on the internet, even if you've never interacted with them before.

Future Work

storagevm

It would be great to create a luxvm dedicated to the storage of arbitrary data blobs (maybe up to 64KB) that could be used by different on-chain applications, like NFTs, to store large data (which may utilize many data blobs on-chain).

This luxvm should put the raw data blobs in each block but only store the hash in state (so that anyone syncing the network does not need to state sync everything in it). Nodes can then best-effort/selectively store the content that matters to them. We can additionally add some sort of DHT that could be used to locate chunks across the network (if they are still held by anyone).

If we got ambitious, we could implement some sort of mechanism to perform random checks on the participants to ensure they hold certain pieces of data at a certain time (usually be requiring a node to hash some request payload with the raw file content). Maybe this could be "file submitter driven" and used to slash some host stake if they don't respond fast enough by re-inserting content on-chain.

It would also be a good idea to add a "censor" key that could be used to remove content or ban accounts that post malicious information.

Directories

Path Synopsis
Example: Deploy a subnet using the SDK deploy package
Example: Deploy a subnet using the SDK deploy package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL