Issuer Configuration Off Chain

Token Negotiator issuer configuration off chain

Off chain tokens can be used in the same way as on chain tokens via Token Negotiator using the configurations below. The key difference is that instead of identifying tokens via blockchain(s), tokens are derived via an issuer website (the host origin that dispatched the tokens e.g. Devcon). An additional benefit to using this technology is that tokens can be read cross origin (via the issuer website with Token Negotiator).

EAS Off Chain configuration:

ParametersTypeDetailsOptions

onChain

boolean

defines if the collection is on or off chain. Set this value to false.

true | false

collectionID

string

a unique string identifier for your usage (this will be the name space your tokens are kept)

string

title

string

collection display title

string

image

string

collection image

string

tokenOrigin

string

origin of token issuer

string

attestationOrigin

string

origin of attestation issuer

string

eas.schemaUid

string

schema identifier value

string

eas.idFields

string []

id fields

string []

eas.fields

object []

custom shema fields

object []

base64senderPublicKeys

object {}

key value object. Where keys represent each issuer event name and the value represents the public key.

object {}

base64attestorPubKey

string

attestation issuer public key

string

unEndPoint

string

origin of unpredictable number generator

string

A custom schema defined EAS issuer configuration:

{
      "collectionID": "customtoken",
      "onChain": false,
      "title": "Custom token",
      "image": "https://pbs.twimg.com/profile_images/1653427962350370816/GiJ0Wh-h_400x400.jpg",
      "tokenOrigin": "http://localhost:3002/",
      "attestationOrigin": "https://test.attestation.id/",
      "eas": {
         "schemaUid": "0x9dbdfc814762e2f356a87843ea3a0ef969c47bea0d70ee8c4a3a2f29c8c330dd",
         "idFields": ["tokenId"],
         "fields": [
            {
               "name": "tokenId",
               "label": "Token ID",
               "type": "string"
            },
            {
               "name": "ownerName",
               "label": "Owner Name",
               "type": "string"
            },
            {
               "name": "commitment",
               "label": "Hidden Identity",
               "type": "bytes"
            }
         ]
      },
      "base64senderPublicKeys": {
         "": "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABAjUvEi8UYyC+0rSFu+IwRBos/DEC6YMJV+eCnoYOC4nZU7uayKDJmBxVnmTOSwaM4+gufLbeqqxuovyF5gI3TQ="
      },
      "base64attestorPubKey": "MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ="
   }

Example use

import { Client } from "@tokenscript/token-negotiator";
import "@tokenscript/token-negotiator/dist/theme/style.css";

// configuration

const negotiator = new Client({
	type: "active",
	issuers: [
		{
			onChain: false,
			collectionID: "devcon",
			title: "Devcon",
			image: "https://raw.githubusercontent.com/TokenScript/token-negotiator/main/mock-images/devcon.svg",
			tokenOrigin: "http://localhost:3002/",
			attestationOrigin: "https://stage.attestation.id/",
			unEndPoint: "https://crypto-verify.herokuapp.com/use-devcon-ticket",
			base64senderPublicKeys: { AttestationDAO: "MFYwEAYHKoZIzj0CAQYFK..." },
			base64attestorPubKey: "MIIBMzCB7AYHKoZIzj0C..."
		}
	],
	uiOptions: {
		openingHeading: "Connect your NFT to access custom content and more.",
		issuerHeading: "Get discount with token",
		repeatAction: "try again",
		theme: "light",
		position: "bottom-right",
	},
});

// invoke

negotiator.negotiate();

// event hooks

negotiator.on("tokens-selected", (tokens) => {
	console.log('owner tokens', tokens);
});

For any more details around this technology solution, please reach out to us on discord or via sayhi@smarttokenlabs.com

Last updated