LogoLogo
  • 🚀DeSo Vision
  • 🪙DeSo Tokenomics
    • No Equity, Just Coins and Code
    • Current DESO Supply
    • Initial DESO Distribution
    • DESO Sinks
    • The BMF: Burn-Maximizing Fee Mechanism
    • Designed for the End-Game
  • 🏛️DeSo Governance
  • ⭐DeSo Tutorial (Build Apps)
  • 🖥️Node Architecture Overview
    • Setup a Node & Frontend Locally
    • Making Your First Changes
  • 📅DeSo Roadmap
  • 🔍DeSo Block Explorer
  • 💸DeSo Wallet
  • 💬DeSo Chat Protocol
  • 👽Openfund
  • 👀Focus
  • 🛠️DeSo Tech Stack
  • 🌐DeSo Applications
  • DeSo Blockchain
    • 1️⃣Bare Metal
    • 2️⃣Scaling Roadmap
    • 3️⃣Content Moderation
    • 4️⃣Infinite-State
    • 5️⃣On-Chain Data
    • 6️⃣Smart Services
    • 7️⃣User Security
  • DeSo Features
    • 1️⃣Associations
    • 2️⃣Creator Coins
    • 3️⃣Feeds & Moderation
    • 4️⃣Social NFTs
    • 5️⃣Social Tipping
  • DeSo Identity
    • 1️⃣Identity: Overview
      • Core Concepts
      • Mobile Integration
    • 2️⃣Identity: iFrame API
      • Overview
      • Endpoints
    • 3️⃣Identity: Window API
      • Overview
      • Endpoints
  • DESO FRONTEND
    • 1️⃣Frontend: Get Started
    • 2️⃣Frontend: React Example
  • DESO BACKEND
    • 1️⃣Backend: Config
      • Onboarding
      • Phone Number Verification
      • Global State
      • Admins
      • Web Security
      • Media
        • Images
        • Videos
      • Hot Feed
      • Selling $DESO
        • Wyre - Buy with USD
        • Buy with BTC
        • Buy with ETH
      • Analytics
      • Emails
      • Supply Monitoring
    • 2️⃣Construct: API
      • Social Transactions API
      • NFT Transactions API
      • Financial Transactions API
      • Derived Keys Transaction API
      • DeSo Tokens Transactions API
      • Associations Transactions API
      • Access Groups API
    • 3️⃣Data: API
      • Admin Endpoints
      • Associations Endpoints
      • DeSo Tokens Endpoints
      • Media Endpoints
      • Miner Endpoints
      • Notification Endpoints
      • NFT Endpoints
      • Social Endpoints
      • Referral Endpoints
      • Tutorial Endpoints
      • Meta Data Endpoints
      • Transaction Spending Limits Endpoints
      • User Endpoints
      • Post Endpoints
      • Messages Endpoints
      • Access Group Endpoints
    • 4️⃣Transactions: API
  • DeSo Exchange Listings
    • 1️⃣Exchange Listing: API
  • DeSo Nodes
    • 2️⃣Node: Setup
    • 3️⃣Node: Staying Up-To-Date
    • 4️⃣Node: FAQ
  • DESO VALIDATORS
    • 1️⃣Run a Validator
  • Openfund
    • What is Openfund?
    • Openfund Tokenomics
    • Openfund Governance
    • Algorithmic Trading
      • The DeSo Python SDK
    • The DeSo Python SDK
      • Getting Help from the Community
      • Creating DeSo Testnet Accounts
      • Debugging Tips and Code Walkthrough
      • Write Blockchain Bots with AI
      • Market-Making Bots
      • Social AI Agents
      • AI-Generating Your Code
    • How Do the Advanced AMMs Work?
  • Focus
    • The Crypto Social Network
    • Next-Generation Token Mechanics
      • Launching Your Token
      • How the Order-Book AMMs Work
    • Crypto-Native Monetization
    • Focus Tokenomics
    • The Social Airdrop
    • Decentralizing Social Media
  • Contact And Media
    • ☀️DeSo Website
    • 📑DeSo Blog
    • 💻DeSo Github
    • 💎DeSo Diamond
    • 🐦DeSo Twitter
    • 📺DeSo YouTube
    • 📬Contact US
    • ⚠️Reporting an Account or Post
  • 中文
    • 什么是DeSo? (What is DeSo?)
    • 愿景 (The Vision)
Powered by GitBook
On this page
  • Submit a transaction
  • Get Transaction
  • Append Extra Data
  • Get Transaction Spending

Was this helpful?

  1. DESO BACKEND

Transactions: API

PreviousAccess Group EndpointsNextExchange Listing: API

Last updated 10 months ago

Was this helpful?

Transactions are the building material of every blockchain.

Transactions allow users to submit data to the blockchain which allows user to perform actions such as transferring DeSo, creating posts and profiles, and minting NFTs.

Transactions have three steps in their lifecycle

  1. Construct: The first step for a developer is to interact with the DeSo Backend API through a transaction construction endpoint to get an unsigned user transaction. Social Transactions API, NFT Transactions API, Financial Transactions API, and Derived Keys Transaction API explain the endpoints that will get you an unsigned transaction.

  2. Sign: The developer will then take the output TransactionHex from the construct step's response, which encodes the user transaction, and signs it using DeSo Identity. You can read about signing transactions in the section of the Endpoints documentation.

  3. Broadcast: The signed transaction will be sent through the /api/v0/submit-transaction by the developer so that it can be added to the blockchain ledger. The Submit a transaction submit explains how this endpoint works.

You can read more about Transactions in this section of the

Submit a transaction

POST /api/v0/submit-transaction

Submit a signed transaction to DeSo blockchain.

Endpoint implementation in .

Example usages in frontend: - Make request to - Use Submit Transaction

Request Body

Name
Type
Description

TransactionHex*

String

Hex of transaction

{
    "Transaction": {
      "PublicKey": "Aqo9yNKZ6h5JFN5mSU7T4W7amg1lcZ1SPBqaA8v59gxF", // public key of the transactor
      "TxnTypeJSON": 5, // Integer representing transaction type
      "ExtraData": { // Arbitrary key value map providing metadata about the transaction
        "key": "value"
      },
      "Signature": {
        "R": 981237981749831749879848321, // R attribute of signature
        "S": 843174832748124, // S attribute of signature
      },
      "TxInputs": [{
        "Index": 0, // Index within transaction where the unspent output occurs
        "TxID": [1, 2, 3, ...] // 32 byte transaction id where unspent output occurs 
      }],
      "TxOutputs": [{ 
        "PublicKey": "Aqo9yNKZ6h5JFN5mSU7T4W7amg1lcZ1SPBqaA8v59gxF", // Public key receiving the output
        "AmountNanos": 912739 // Amount of DeSo in the output
      }],
      "TxnMeta": { // Transaction metadata. more details explaining TxnMeta for each transaction type coming soon. 
      ...
      }
    },
    "TxnHashHex": "0f40a5fc7eb991cea55ebece1ec21ee5fb1c4bba537bb76643ee1d31f617bb56",
    "PostEntryResponse": <PostEntryResponse>, // If transaction is a Submit post transaction, include the PostEntryResponse that was created as a result of the transaction.
}
Name
Type
Description

Transaction

Transaction object

transaction object that was broadcast to the DeSo blockchain

PublicKey

string

Attribute of transaction

Public key of transactor

TxnTypeJSON

integer

Attribute of transaction

Number representing transaction type

ExtraData

map[string]string

Attribute of transaction

Arbitrary key value map providing metadata about the transaction

Signature

{ R: integer, S: integer }

Attribute of transaction

Signature of transactoin

TxInputs

Array of transaction iputs

[{ Index: integer, TxId: integer[] }]

Attribute of transaction

Each element represents an input (DeSo being used) in the transaction.

TxOutputs

Array of transaction outputs

[{ PublicKey: string, AmountNanos: integer }]

Attribute of transaction

Each element represents an output (DeSo being received) in the transaction

TxnMeta

Transaction Metadata object

Attribute of transaction

Transaction Metadata descriptions coming soon. Each transaction type has its own transaction metadata object structure.

TxnHashHex

String

Hex of transaction hash broadcasted to the DeSo blockchain

PostEntryResponse

If a transaction is a submit post transaction, the PostEntryResponse that was created by the transaction is included

Get Transaction

POST /api/v0/get-txn

Check if transaction is currently in mempool. This is particularly useful if you need to wait for a transaction to be broadcasted before submitting a subsequent transaction.

Request Body

Name
Type
Description

TransactionHashHex*

Strng

Hex of Transaction hash that we want to check made it to the mempool

{
    "TxnFound": true
}
Name
Type
Description

TxnFound

boolean

If true, the transaction is currently in the mempool

Append Extra Data

POST /api/v0/append-extra-data

Append custom ExtraData for a given transaction hex. This endpoint is typically used when signing with a derived key.

Note: If you will be using this endpoint, you will need to increase MinFeeRateNanosPerKB to 1500 when using a transaction construction endpoint.

Request Body

Name
Type
Description

TransactionHex*

String

The hex of the transaction on which extra data will be appended.

ExtraData*

map[string]string

Arbitrary key value map that will be merged with any extra data decoded from TransactionHex. Keys from this map will overwrite keys that were decoded from TransactionHex

{
    // Response
}
{
  "TransactionHex": "sometransactionhex"
}
Name
Type
Description

TransactionHex

string

hex of transaction with extra data appended

Get Transaction Spending

POST /api/v0/get-transaction-spending

Calculates the total transaction spending by subtracting transaction output to sender from transaction inputs. This allows a convenient way to display to users how much they will spend if they submit a given transaction to the network.

Request Body

Name
Type
Description

TransactionHex*

String

The hex of the transaction on which extra data will be appended.

{
  "TotalSpendingNanos": 1000823987
}
Name
Type
Description

TotalSpendingNanos

Integer

Total amount spent by the transactor in this transaction

Endpoint implementation in .

Example usages in frontend: - Make request to - Use Get Txn to

Endpoint implementation in

Endpoint implementation in

Example usages in identity: - Make request to - Use Get Transaction Spending to

4️⃣
backend
Get Txn
see if a transaction has been broadcast to the network
backend
backend
Get Transaction Spending
show user total spending of transaction
PostEntryResponse
backend
Submit Transaction
in conjunction with signing transaction
Identity documentation.
sign