Docs/Reference/Issue action

Issue action

A developer-focused reference for constructing and signing a tokenization issuance.

When to use#

Issue when a customer adds eligible existing offchain loyalty value to a wallet.

The first successful issuance can create the Loyalty Token. Later issuances tokenize additional offchain value into an existing Loyalty Token. expiresAt controls the reward bucket; deadline controls how long the signed action can be submitted. The brand backend should reserve or deduct the offchain points before publishing the signed issuance.

Fields#

FieldTypeRequiredMeaning
issueraddressyesBrand wallet that signs the action.
toaddresssessionCustomer wallet receiving tokenized loyalty value. Not part of the issuer-signed terms; add it with the recipient signature or collect it on checkout.
loyaltyIdbytes32yesBrand-scoped program ID.
amountuint256 stringyesAmount of offchain loyalty value to tokenize. Must be greater than zero.
expiresAtuint256 stringyesUse 0 for no expiry, or a Unix timestamp for an expiring bucket.
deadlineuint256 stringyesLast Unix timestamp when the issuance can be submitted. Use 0 for no execution deadline.
noncebytes32yesUnique per issuer. Replays are rejected.
chainIduint256 stringyesExpected chain ID. Loyfin uses Base 8453.
verifyingContractaddressyesThe Loyfin factory that will execute the action.
operationHashbytes32optionalBrand reference hash for correlating this action with an internal database row. Defaults to zero bytes when omitted.
metadataMetadatayesProgram metadata. Required for issuance because the first issuance can create the program.
datahex bytesoptionalBrand-defined data. Defaults to 0x. Max 2048 bytes.

Example#

IssuanceActionjson
{
  "issuance": {
    "issuer": "0x1111111111111111111111111111111111111111",
    "loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
    "amount": "1000",
    "expiresAt": "0",
    "deadline": "0",
    "nonce": "0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
    "chainId": "8453",
    "verifyingContract": "0x3333333333333333333333333333333333333333",
    "operationHash": "0x9999999999999999999999999999999999999999999999999999999999999999",
    "metadata": {
      "loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
      "name": "Bloom Coffee Rewards",
      "symbol": "BLOOM",
      "media": "ipfs://bafy.../bloom.png",
      "description": "Rewards for Bloom Coffee customers.",
      "contractURI": "",
      "tokenURI": ""
    },
    "data": "0x"
  },
  "signature": "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab"
}
Loyfin is built onBase