Parallel Universe
  • Learn
    • Introduction to PUT
    • Getting started with PUT
  • Architecture
    • What is a PUT Cluster?
    • Clusters
      • PUT Clusters
      • RPC Endpoints
      • Benchmark a Cluster
      • Performance Metrics
    • Consensus
      • Synchronization
      • Leader Rotation
      • Fork Generation
      • Managing Forks
      • Turbine Block Propagation
      • Commitment Status
      • Secure Vote Signing
      • Stake Delegation and Rewards
    • Validators
      • Overview
      • TPU
      • TVU
      • Blockstore
      • Gossip Service
      • The Runtime
  • CLI
    • Command-line Guide
    • Install the PUT Tool Suite
    • Command-line Wallets
      • Command Line Wallets
      • Paper Wallet
      • File System Wallet
      • Support / Troubleshooting
    • Using PUT CLI
    • Connecting to a Cluster
    • Send and Receive Tokens
    • Staking
    • Deploy a Program
    • Offline Transaction Signing
    • Durable Transaction Nonces
    • CLI Usage Reference
  • Developers
    • Get Started
      • Hello World
      • Local development
      • Rust program
    • Core Concepts
      • Accounts
      • Transactions
        • Overview
        • Versioned Transactions
        • Address Lookup Tables
      • Programs
      • Rent
      • Calling between programs
      • Runtime
    • Clients
      • JSON RPC API -1
      • JSON RPC API -2
      • JSON RPC API -3
      • Web3 JavaScript API
      • Web3 API Reference
      • Rust API
    • Writing Programs
      • Overview
      • Developing with Rust
      • Deploying
      • Debugging
      • Program Examples
      • FAQ
    • Native Programs
      • Overview
      • Sysvar Cluster Data
    • Local Development
      • PUT Test Validator
    • Backward Compatibility Policy
  • Validators
    • Running a Validator
    • Getting Started
      • Validator Requirements
    • Voting Setup
      • Starting a Validator
      • Vote Account Management
      • Staking
      • Monitoring a Validator
      • Publishing Validator Info
      • Failover Setup
      • Troubleshooting
    • Geyser
      • Geyser Plugins
  • Staking
    • Staking on PUT
    • Stake Account Structure
  • Integrations
    • Add PUT to Your Exchange
    • Retrying Transactions
  • Library
    • Introduction
    • Token Program
    • Associated Token Account Program
    • Memo Program
    • Name Service
    • Feature Proposal Program
    • NFT Program
      • Overview
      • Interface
      • Usage Guidelines
        • Create a new NFT-Mint
        • Cast NFT
        • Transfer an NFT
        • Change account status
        • Permission settings
        • Query Interface
        • Continuous casting
        • Change the Mint attribute
      • Operation Overview
        • Create a new NFT-Mint
        • Transfer NFT
        • Destroy
        • Freeze NFT accounts
        • Update
    • PUT multi-sign program
      • Overview
      • Interface
      • Usage Guidelines
        • Create a multi-signature account
        • Create a proposal account
        • Vote proposal
        • Verify Proposal
        • Add-singer
        • Remove-signer
      • Operation Overview
        • Create a multi-signature account
        • Create a proposal account
        • Vote
        • Verify
        • Add-singer
        • Remove-signer
  • PUT Privacy Policy
Powered by GitBook
On this page
  • Source
  • Interface
  • Operational Notes
  1. Library

Memo Program

Memo ProgramThe Memo program is a simple program that validates a string of UTF-8 encoded characters and verifies that any accounts provided are signers of the transaction.The program also logs the memo, as well as any verified signer addresses, to the transaction log, so that anyone can easily observe memos and know they were approved by zero or more addresses by inspecting the transaction log from a trusted provider.

Source

The Memo Program's source is available on github

Interface

The on-chain Memo Program is written in Rust and available on crates.io as spl-memo and docs.rs.The crate provides a build_memo() method to easily create a properly constructed Instruction.

Operational Notes

If zero accounts are provided to the signed-memo instruction, the program succeeds when the memo is valid UTF-8, and logs the memo to the transaction log.If one or more accounts are provided to the signed-memo instruction, all must be valid signers of the transaction for the instruction to succeed.

Logs

This section details expected log output for memo instructions.Logging begins with entry into the program: ProgramMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr invoke [1]The program will include a separate log for each verified signer: Program log: Signed by <BASE_58_ADDRESS>Then the program logs the memo length and UTF-8 text: Program log: Memo (len 4): "🐆"If UTF-8 parsing fails, the program will log the failure point: Program log: Invalid UTF-8, from byte 4Logging ends with the status of the instruction, one of: ProgramMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr success ProgramMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr failed: missing required signature for instruction ProgramMemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr failed: invalid instruction dataFor more information about exposing program logs on a node, head to the developer docs

Compute Limits

Like all programs, the Memo Program is subject to the cluster's compute budget. In Memo, compute is used for parsing UTF-8, verifying signers, and logging, limiting the memo length and number of signers that can be processed successfully in a single instruction.The longer or more complex the UTF-8 memo, the fewer signers can be supported, and vice versa.As of v1.5.1, an unsigned instruction can support single-byte UTF-8 of up to 566 bytes. An instruction with a simple memo of 32 bytes can support up to 12 signers.

PreviousAssociated Token Account ProgramNextName Service

Last updated 2 years ago