Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

nsskin/v1 package

Overview

Package nsskin holds purchasable card art — the skins — as tokens of their own, and binds them to names.

WHY THIS IS ITS OWN REALM AND NOT PART OF nsdata. SKINS.md §8 listed it as undecided; it is decided here, because the reasoning turned out to be one-sided rather than balanced.

Example
 1nsdata IS PERMANENT. It cannot be replaced, ever. A second kind of
 2token in it means every mistake in the skin model is permanent too,
 3and the skin model is the newest and least settled thing here.
 4
 5nsdata.OwnerOf DELIBERATELY PANICS FOR EXPIRED TOKENS so a lapsed
 6name cannot be listed anywhere. Skins do not expire. That machinery
 7is exactly wrong for them, and a conditional on token kind inside
 8the one realm that can never be fixed is the worst place for it.
 9
10A NEW REALM CAN BE REPLACED while it holds a handful of tokens. The
11vault cannot, at any point, for any reason.

So being wrong here costs a migration nobody notices. Being wrong inside nsdata costs forever.

A SKIN IS TWO THINGS

Example
1A DEFINITION is the artwork: a name, a sprite, an optional extension
2lock, and the artist to pay. One per design, stored once — a
3thousand holders of one design cost one sprite, not a thousand.
4
5A TOKEN is somebody's copy. Editions are unlimited, because SKINS.md
6is explicit that a cap is a floor price with extra steps and resale
7value is never part of the pitch.

A SKIN BINDS TO ONE NAME, AND TRAVELS WITH IT

This reverses an earlier recommendation of mine, and the new answer is better. I had argued for keeping them separate — a pointer from the name, reverting on sale — because names expire and skins should not. The objection to bundling was that a buyer sees a skinned card on a marketplace and receives an unskinned name.

Binding solves that rather than working around it. The skin genuinely comes with the name, so the card is not misleading, and the small disclosure line the old model needed inside the artwork disappears. And a skin still does not die with a name: when the name goes, the skin comes back.

WHY ATTACHING ESCROWS THE TOKEN, WHICH IS THE WHOLE CUSTODY ANSWER

The worry: a name listed on a marketplace that takes CUSTODY. If the skin lived in the seller's wallet, a custodial listing would hold the name while the skin sat somewhere else, and untangling that on expiry would need cooperation we cannot compel.

So attaching moves the token to THIS REALM'S OWN ADDRESS. While attached it is in nobody's wallet: it cannot be listed, cannot be sold out from under the name, and a marketplace escrowing the NAME never touches it. The question of freeing a skin from somebody else's custody does not arise, because it was never in it.

Taking it out again is one rule with one fallback:

Example
1WHILE THE NAME EXISTS, its CURRENT OWNER may claim the skin. That is
2what makes it travel: buy the name, claim the skin.
3
4IF THE NAME RECORD IS GONE — lapsed and reclaimed — whoever attached
5it may take it back, which is the "it returns to your wallet" case.

One limitation, stated rather than hidden: buy a name with a skin, never claim it, and let that name lapse completely, and the skin returns to whoever attached it. Claiming on purchase avoids it entirely, and the site prompts for exactly that.

Function

Approve

func Approve(cur realm, to address, tid grc721.TokenID)
Ask AI Claude ChatGPT

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsskin/v1" -func "Approve" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsskin/v1" -func "Approve" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx