Skip to content

Instantly share code, notes, and snippets.

@christroutner
Last active February 15, 2023 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christroutner/01b8b840809b68f4c759bda0d52b9319 to your computer and use it in GitHub Desktop.
Save christroutner/01b8b840809b68f4c759bda0d52b9319 to your computer and use it in GitHub Desktop.
Intro to SLP Token Icons

Introduction to SLP Token Icons

There have been a handful of attempts to create standards around SLP token icons. All approaches prior to the PSF specifications relied on centralized services. The PS002 and PS007 specifications define the use of mutable (changable) data in SLP tokens. Inside this mutable data, a URL to the token icon can be placed. The big advantage of these specifications is that the token icon can be changed at any time by the token creator. It is permissionless, secure, and the process does not rely on any centralized services.

Hands On Examples

Using Token Data in Software

Below are examples of REST APIs and JavaScript libraries that can be used to easily implement token icons into your own application.

REST API

Token data (including icons) can be retrieved from a REST API server in the Web 3 Cash Stack array of back-end servers. Here is a list of redundent servers. The example below will work on any of those servers.

The big advantage of using a REST API is that it's programming-language agnostic. Every programming language can make a REST API call. Here is an example of retrieving token data with the curl command line tool:

  • curl -H "Content-Type: application/json" -X POST -d '{ "tokenId": "4540a1abe8fc1cdcd92c199c454e6f67391e312de11d7b17f4f0ef3dcaf11e25" }' https://free-bch.fullstack.cash/bch/getTokenData2

JavaScript

The minimal-slp-wallet npm package can be used in JavaScript applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment