ReddID API Reference - reddcoin-project/reddcoin GitHub Wiki

ReddID System API Reference

Version 2.0 | April 2025


Executive Summary

The ReddID System API provides a comprehensive interface for integrating with Reddcoin's identity management ecosystem. This API enables developers to interact with all three tiers of the system: namespaces (top-level domains), user IDs (identifiers within namespaces), and ReddIDs (cross-namespace identity profiles).

Key features accessible through this API include:

  • Market-driven auction mechanisms for fair resource allocation
  • Hierarchical identity management with namespace governance
  • Social network functionality with connections and reputation tracking
  • Cross-namespace resolution for consistent identity across contexts

This reference document details all available endpoints, parameters, response formats, and includes practical usage examples for common integration scenarios. The API implements standard authentication mechanisms, consistent error handling, and follows RPC conventions for integration with the Reddcoin ecosystem.


ReddID System API Reference

The ReddID system exposes a comprehensive API for integration with external applications and services.


Table of Contents

  1. Overview
  2. Namespace API
  3. User ID API
  4. Profile API
  5. Reputation API
  6. API Usage Examples

Overview

The ReddID API provides programmatic access to all features of the ReddID system, including namespace management, user ID registration, profile management, and reputation tracking.

Authentication

API methods that modify data require authentication using the following methods:

  1. JSON-RPC Authentication: Username/password authentication for RPC calls
  2. Signature-based Authentication: For methods that require proof of ownership

Example of JSON-RPC authentication:

curl --user rpcuser:rpcpassword --data-binary '{"jsonrpc":"1.0","id":"curltest","method":"getnamespacelist","params":[]}' -H 'content-type:text/plain;' http://127.0.0.1:45443/

Response Format

All API responses are JSON-formatted with a consistent structure:

  • For successful operations:
{
  "result": {
    ... operation-specific data ...
  },
  "error": null,
  "id": "request-id"
}
  • For failed operations:
{
  "result": null,
  "error": {
    "code": error_code,
    "message": "Error description"
  },
  "id": "request-id"
}

Error Handling

All API methods return standard error codes and messages:

Error Code Description
404 Resource not found
400 Invalid parameters
401 Unauthorized (ownership verification failed)
403 Forbidden (operation not allowed in current state)
500 Internal error

Namespace API

Namespace Information

getnamespacelist()

Returns a list of all registered namespaces.

Parameters: None

Response:

[
  {
    "id": "namespace_identifier",
    "owner": "owner_address",
    "allow_numbers": true|false,
    "allow_hyphens": true|false,
    "allow_underscores": true|false,
    "min_length": n,
    "max_length": n,
    "renewal_period": n,
    "grace_period": n,
    "namespace_revenue_pct": n,
    "burn_pct": n,
    "node_pct": n,
    "dev_pct": n,
    "min_auction_duration": n,
    "max_auction_duration": n,
    "min_bid_increment": n,
    "last_updated": timestamp,
    "expiration": timestamp
  },
  ...
]

Example:

// Get all registered namespaces
const namespaces = await reddid.getnamespacelist();
console.log(`Found ${namespaces.length} namespaces`);

getnamespaceinfo(namespaceId)

Gets detailed information about a specific namespace.

Parameters:

  • namespaceId (string, required): The namespace identifier

Response:

{
  "id": "namespace_identifier",
  "owner": "owner_address",
  "allow_numbers": true|false,
  "allow_hyphens": true|false,
  "allow_underscores": true|false,
  "min_length": n,
  "max_length": n,
  "renewal_period": n,
  "grace_period": n,
  "namespace_revenue_pct": n,
  "burn_pct": n,
  "node_pct": n,
  "dev_pct": n,
  "min_auction_duration": n,
  "max_auction_duration": n,
  "min_bid_increment": n,
  "last_updated": timestamp,
  "expiration": timestamp,
  "pricing_tiers": [
    {
      "min_length": n,
      "min_price": amount
    },
    ...
  ]
}

Example:

// Get details for a specific namespace
const namespaceDetails = await reddid.getnamespaceinfo("redd");
console.log(`Namespace ${namespaceDetails.id} expires on ${new Date(namespaceDetails.expiration * 1000)}`);

Namespace Auctions

createnamespacesauction(namespaceId, reservePrice, durationDays, type, account, addressType, label)

Creates a new namespace auction.

Parameters:

  • namespaceId (string, required): The namespace identifier (1-15 characters)
  • reservePrice (numeric, required): The minimum bid amount in RDD
  • durationDays (numeric, required): The auction duration in days (14-30)
  • type (numeric, optional): The auction type (0=standard, 1=premium)
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "auction_id": "auction_identifier_hex",
  "namespace_id": "namespace_identifier",
  "start_time": timestamp,
  "end_time": timestamp,
  "reserve_price": amount,
  "auction_type": n,
  "creator_address": "creator_address"
}

Example:

// Create a namespace auction
const auction = await reddid.createnamespacesauction(
  "example",        // namespace ID
  50000,            // reserve price (50,000 RDD)
  14,               // duration in days
  0                 // standard auction type
);
console.log(`Created auction ${auction.auction_id} for namespace ${auction.namespace_id}`);

bidonnamespacesauction(auctionId, bidAmount, account, addressType, label)

Places a bid on a namespace auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • bidAmount (numeric, required): The bid amount in RDD
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "bid_id": "bid_identifier_hex",
  "auction_id": "auction_identifier_hex",
  "bid_amount": amount,
  "deposit_amount": amount,
  "bid_time": timestamp,
  "bidder_address": "bidder_address"
}

Example:

// Bid on a namespace auction
const bid = await reddid.bidonnamespacesauction(
  "abcd1234",       // auction ID
  75000             // bid amount (75,000 RDD)
);
console.log(`Placed bid of ${bid.bid_amount} RDD on auction ${bid.auction_id}`);

finalizenamespacesauction(auctionId)

Finalizes a namespace auction after it has ended.

Parameters:

  • auctionId (string, required): The auction identifier

Response:

{
  "auction_id": "auction_identifier_hex",
  "namespace_id": "namespace_identifier",
  "winner": "winner_address",
  "final_price": amount,
  "state": 3
}

Example:

// Finalize a namespace auction
const result = await reddid.finalizenamespacesauction("abcd1234");
console.log(`Auction ${result.auction_id} finalized, winner: ${result.winner}, price: ${result.final_price} RDD`);

cancelnamespacesauction(auctionId, account, addressType, label)

Cancels a namespace auction (only available for auctions with no bids).

Parameters:

  • auctionId (string, required): The auction identifier
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "auction_id": "auction_identifier_hex",
  "namespace_id": "namespace_identifier",
  "state": 4
}

Example:

// Cancel a namespace auction
const result = await reddid.cancelnamespacesauction("abcd1234");
console.log(`Auction ${result.auction_id} for namespace ${result.namespace_id} cancelled`);

getnamespaceauctionlist(activeOnly)

Gets all currently active namespace auctions.

Parameters:

  • activeOnly (boolean, optional, default=false): If true, only show active auctions

Response:

[
  {
    "auction_id": "auction_identifier_hex",
    "namespace_id": "namespace_identifier",
    "creator": "creator_address",
    "start_time": timestamp,
    "end_time": timestamp,
    "reserve_price": amount,
    "current_bid": amount,
    "current_bidder": "bidder_address",
    "state": n,
    "type": n
  },
  ...
]

Example:

// Get all active namespace auctions
const auctions = await reddid.getnamespaceauctionlist(true);
console.log(`Found ${auctions.length} active namespace auctions`);

getnamespaceauctioninfo(auctionId, verbose)

Gets detailed information about a specific namespace auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • verbose (boolean, optional, default=false): If true, include bid history

Response:

{
  "auction_id": "auction_identifier_hex",
  "namespace_id": "namespace_identifier",
  "creator": "creator_address",
  "start_time": timestamp,
  "end_time": timestamp,
  "reserve_price": amount,
  "current_bid": amount,
  "current_bidder": "bidder_address",
  "deposit_amount": amount,
  "state": n,
  "type": n,
  "time_remaining": seconds,
  "bids": [
    {
      "bid_id": "bid_identifier_hex",
      "bidder": "bidder_address",
      "amount": amount,
      "time": timestamp,
      "is_winner": true|false
    },
    ...
  ]
}

Example:

// Get detailed information about a namespace auction
const auctionInfo = await reddid.getnamespaceauctioninfo("abcd1234", true);
console.log(`Auction for ${auctionInfo.namespace_id}, current bid: ${auctionInfo.current_bid} RDD`);

getnamespacesauctionbids(auctionId, sortBy, sortDir)

Gets all bids for a specific namespace auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • sortBy (string, optional, default="time"): Sort order: 'time', 'amount'
  • sortDir (string, optional, default="desc"): Sort direction: 'desc', 'asc'

Response:

{
  "auction_id": "auction_identifier_hex",
  "namespace_id": "namespace_identifier",
  "total_bids": n,
  "highest_bid": amount,
  "bids": [
    {
      "bid_id": "bid_identifier_hex",
      "bidder": "bidder_address",
      "amount": amount,
      "deposit": amount,
      "time": timestamp,
      "is_winner": true|false,
      "refunded": true|false
    },
    ...
  ]
}

Example:

// Get all bids for a namespace auction
const bids = await reddid.getnamespacesauctionbids("abcd1234", "amount", "desc");
console.log(`Auction has ${bids.total_bids} bids, highest: ${bids.highest_bid} RDD`);

Namespace Management

configurenamespacess(namespaceId, config, pricingTiers, account, addressType, label)

Updates configuration parameters for a namespace.

Parameters:

  • namespaceId (string, required): The namespace identifier
  • config (object, required): Configuration parameters
    • allow_numbers (boolean, optional): Whether numbers are allowed in user IDs
    • allow_hyphens (boolean, optional): Whether hyphens are allowed in user IDs
    • allow_underscores (boolean, optional): Whether underscores are allowed in user IDs
    • min_length (numeric, optional): Minimum user ID length (1-10)
    • max_length (numeric, optional): Maximum user ID length (5-64)
    • renewal_period (numeric, optional): Days until renewal required (180-730)
    • grace_period (numeric, optional): Days in grace period (14-60)
    • namespace_revenue_pct (numeric, optional): % of auctions going to namespace owner (5-10)
    • burn_pct (numeric, optional): % of auctions being burned (50-80)
    • node_pct (numeric, optional): % of auctions going to node operators (5-25)
    • dev_pct (numeric, optional): % of auctions going to development fund (5-15)
    • min_auction_duration (numeric, optional): Minimum auction duration in days (1-7)
    • max_auction_duration (numeric, optional): Maximum auction duration in days (3-14)
    • min_bid_increment (numeric, optional): Minimum bid increment percentage (1.0-10.0)
  • pricingTiers (array, optional): Pricing tiers for different name lengths
    • min_length (numeric, required): Minimum length for this tier
    • min_price (numeric, required): Minimum price for names in this tier in RDD
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "id": "namespace_identifier",
  "owner": "owner_address",
  "allow_numbers": true|false,
  "allow_hyphens": true|false,
  "allow_underscores": true|false,
  "min_length": n,
  "max_length": n,
  "renewal_period": n,
  "grace_period": n,
  "namespace_revenue_pct": n,
  "burn_pct": n,
  "node_pct": n,
  "dev_pct": n,
  "min_auction_duration": n,
  "max_auction_duration": n,
  "min_bid_increment": n,
  "last_updated": timestamp,
  "expiration": timestamp,
  "pricing_tiers": [
    {
      "min_length": n,
      "min_price": amount
    },
    ...
  ]
}

Example:

// Update namespace configuration
const config = {
  allow_numbers: true,
  min_length: 3,
  max_length: 32
};

const pricingTiers = [
  {min_length: 1, min_price: 100000},
  {min_length: 3, min_price: 10000}
];

const result = await reddid.configurenamespacess("redd", config, pricingTiers);
console.log(`Updated configuration for namespace ${result.id}`);

renewnamespace(namespaceId, account, addressType, label)

Renews a namespace to extend its expiration.

Parameters:

  • namespaceId (string, required): The namespace identifier
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "id": "namespace_identifier",
  "owner": "owner_address",
  "previous_expiration": timestamp,
  "new_expiration": timestamp,
  "renewal_fee": amount
}

Example:

// Renew a namespace
const result = await reddid.renewnamespace("redd");
console.log(`Renewed namespace ${result.id} until ${new Date(result.new_expiration * 1000)}`);

transfernamespace(namespaceId, toAddress, account, addressType, label)

Transfers ownership of a namespace to a new address.

Parameters:

  • namespaceId (string, required): The namespace identifier
  • toAddress (string, required): The destination address
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "id": "namespace_identifier",
  "previous_owner": "previous_owner_address",
  "new_owner": "new_owner_address",
  "transfer_time": timestamp
}

Example:

// Transfer a namespace to a new owner
const result = await reddid.transfernamespace("redd", "rx1qw9lfdjhn37...");
console.log(`Transferred namespace ${result.id} from ${result.previous_owner} to ${result.new_owner}`);

User ID API

User ID Information

getuseridlist(namespaceId)

Gets all user IDs registered in a specific namespace.

Parameters:

  • namespaceId (string, required): The namespace identifier

Response:

[
  {
    "name": "user_id_name",
    "namespace_id": "namespace_identifier",
    "owner": "owner_address",
    "registration_time": timestamp,
    "expiration_time": timestamp,
    "last_transaction": timestamp,
    "transaction_count": n
  },
  ...
]

Example:

// Get all user IDs in a namespace
const userIds = await reddid.getuseridlist("redd");
console.log(`Found ${userIds.length} user IDs in namespace 'redd'`);

getuseridinfo(name, namespaceId)

Gets detailed information about a specific user ID.

Parameters:

  • name (string, required): The user ID name
  • namespaceId (string, required): The namespace identifier

Response:

{
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "owner": "owner_address",
  "registration_time": timestamp,
  "expiration_time": timestamp,
  "last_transaction": timestamp,
  "transaction_count": n
}

Example:

// Get details about a specific user ID
const userIdInfo = await reddid.getuseridinfo("alice", "redd");
console.log(`User ID ${userIdInfo.name}.${userIdInfo.namespace_id} expires on ${new Date(userIdInfo.expiration_time * 1000)}`);

User ID Auctions

createuseridauction(name, namespaceId, reservePrice, durationDays, type, account, addressType, label)

Creates a new user ID auction within a namespace.

Parameters:

  • name (string, required): The user ID name
  • namespaceId (string, required): The namespace identifier
  • reservePrice (numeric, required): The minimum bid amount in RDD
  • durationDays (numeric, required): The auction duration in days
  • type (numeric, optional): The auction type (0=standard, 1=premium)
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "auction_id": "auction_identifier_hex",
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "start_time": timestamp,
  "end_time": timestamp,
  "reserve_price": amount,
  "auction_type": n,
  "creator_address": "creator_address"
}

Example:

// Create a user ID auction
const auction = await reddid.createuseridauction(
  "alice",           // user ID name
  "redd",            // namespace ID
  5000,              // reserve price (5,000 RDD)
  7,                 // duration in days
  0                  // standard auction type
);
console.log(`Created auction ${auction.auction_id} for user ID ${auction.name}.${auction.namespace_id}`);

bidonuseridauction(auctionId, bidAmount, account, addressType, label)

Places a bid on a user ID auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • bidAmount (numeric, required): The bid amount in RDD
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "bid_id": "bid_identifier_hex",
  "auction_id": "auction_identifier_hex",
  "bid_amount": amount,
  "deposit_amount": amount,
  "bid_time": timestamp,
  "bidder_address": "bidder_address"
}

Example:

// Bid on a user ID auction
const bid = await reddid.bidonuseridauction(
  "abcd1234",       // auction ID
  10000             // bid amount (10,000 RDD)
);
console.log(`Placed bid of ${bid.bid_amount} RDD on auction ${bid.auction_id}`);

finalizeuseridauction(auctionId)

Finalizes a user ID auction after it has ended.

Parameters:

  • auctionId (string, required): The auction identifier

Response:

{
  "auction_id": "auction_identifier_hex",
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "winner": "winner_address",
  "final_price": amount,
  "state": 3
}

Example:

// Finalize a user ID auction
const result = await reddid.finalizeuseridauction("abcd1234");
console.log(`Auction ${result.auction_id} finalized, winner: ${result.winner}, price: ${result.final_price} RDD`);

canceluseridauction(auctionId, account, addressType, label)

Cancels a user ID auction (only available for auctions with no bids).

Parameters:

  • auctionId (string, required): The auction identifier
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "auction_id": "auction_identifier_hex",
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "state": 4
}

Example:

// Cancel a user ID auction
const result = await reddid.canceluseridauction("abcd1234");
console.log(`Auction ${result.auction_id} for user ID ${result.name}.${result.namespace_id} cancelled`);

getuserauctionlist(namespaceId, activeOnly)

Gets all currently active user ID auctions, optionally filtered by namespace.

Parameters:

  • namespaceId (string, optional): Filter by namespace ID
  • activeOnly (boolean, optional, default=false): If true, only show active auctions

Response:

[
  {
    "auction_id": "auction_identifier_hex",
    "name": "user_id_name",
    "namespace_id": "namespace_identifier",
    "creator": "creator_address",
    "start_time": timestamp,
    "end_time": timestamp,
    "reserve_price": amount,
    "current_bid": amount,
    "current_bidder": "bidder_address",
    "state": n,
    "type": n,
    "time_remaining": seconds
  },
  ...
]

Example:

// Get all active user ID auctions in a namespace
const auctions = await reddid.getuserauctionlist("redd", true);
console.log(`Found ${auctions.length} active user ID auctions in namespace 'redd'`);

getuserauctioninfo(auctionId, verbose)

Gets detailed information about a specific user ID auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • verbose (boolean, optional, default=false): If true, include bid history

Response:

{
  "auction_id": "auction_identifier_hex",
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "creator": "creator_address",
  "start_time": timestamp,
  "end_time": timestamp,
  "reserve_price": amount,
  "current_bid": amount,
  "current_bidder": "bidder_address",
  "deposit_amount": amount,
  "state": n,
  "type": n,
  "time_remaining": seconds,
  "namespace_info": {
    "id": "namespace_identifier",
    "owner": "owner_address",
    "min_length": n,
    "max_length": n,
    "renewal_period": n,
    "grace_period": n
  },
  "bids": [
    {
      "bid_id": "bid_identifier_hex",
      "bidder": "bidder_address",
      "amount": amount,
      "time": timestamp,
      "is_winner": true|false
    },
    ...
  ]
}

Example:

// Get detailed information about a user ID auction
const auctionInfo = await reddid.getuserauctioninfo("abcd1234", true);
console.log(`Auction for ${auctionInfo.name}.${auctionInfo.namespace_id}, current bid: ${auctionInfo.current_bid} RDD`);

getuseridauctionbids(auctionId, sortBy, sortDir)

Gets all bids for a specific user ID auction.

Parameters:

  • auctionId (string, required): The auction identifier
  • sortBy (string, optional, default="time"): Sort order: 'time', 'amount'
  • sortDir (string, optional, default="desc"): Sort direction: 'desc', 'asc'

Response:

{
  "auction_id": "auction_identifier_hex",
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "total_bids": n,
  "highest_bid": amount,
  "bids": [
    {
      "bid_id": "bid_identifier_hex",
      "bidder": "bidder_address",
      "amount": amount,
      "deposit": amount,
      "time": timestamp,
      "is_winner": true|false,
      "refunded": true|false,
      "bidder_reddid": "bidder_reddid"
    },
    ...
  ]
}

Example:

// Get all bids for a user ID auction
const bids = await reddid.getuseridauctionbids("abcd1234", "amount", "desc");
console.log(`Auction has ${bids.total_bids} bids, highest: ${bids.highest_bid} RDD`);

User ID Management

renewuserid(name, namespaceId, account, addressType, label)

Renews a user ID to extend its expiration.

Parameters:

  • name (string, required): The user ID name
  • namespaceId (string, required): The namespace identifier
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "expiration_time": timestamp,
  "renewal_fee": amount
}

Example:

// Renew a user ID
const result = await reddid.renewuserid("alice", "redd");
console.log(`Renewed user ID ${result.name}.${result.namespace_id} until ${new Date(result.expiration_time * 1000)}`);

transferuserid(name, namespaceId, toAddress, account, addressType, label)

Transfers ownership of a user ID to a new address.

Parameters:

  • name (string, required): The user ID name
  • namespaceId (string, required): The namespace identifier
  • toAddress (string, required): The destination address
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "name": "user_id_name",
  "namespace_id": "namespace_identifier",
  "previous_owner": "previous_owner_address",
  "new_owner": "new_owner_address"
}

Example:

// Transfer a user ID to a new owner
const result = await reddid.transferuserid("alice", "redd", "rx1qw9lfdjhn37...");
console.log(`Transferred user ID ${result.name}.${result.namespace_id} from ${result.previous_owner} to ${result.new_owner}`);

Profile API

Profile Information

getprofile(reddId)

Gets profile information for a ReddID.

Parameters:

  • reddId (string, required): The ReddID to retrieve profile information for

Response:

{
  "reddid": "reddid",
  "owner_address": "owner_address",
  "display_name": "display_name",
  "avatar_hash": "ipfs_hash",
  "bio": "user_biography",
  "email_hash": "hashed_email",
  "social_data": {
    ... social profile links ...
  },
  "messaging_pubkey": "public_key_hex",
  "verification_status": n,
  "creation_time": timestamp,
  "last_updated": timestamp,
  "expiration_time": timestamp,
  "active": true|false,
  "flags": n
}

Example:

// Get profile information for a ReddID
const profile = await reddid.getprofile("alice");
console.log(`Profile for ${profile.reddid}, display name: ${profile.display_name}`);

updateprofile(reddId, profileData, account, addressType, label)

Updates a ReddID profile with new information.

Parameters:

  • reddId (string, required): The ReddID to update
  • profileData (object, required): Profile data to update
    • display_name (string, optional): User-selected display name
    • avatar_hash (string, optional): IPFS hash of avatar image
    • bio (string, optional): Short biography or description
    • email_hash (string, optional): Hash of verified email
    • social_data (object, optional): JSON of linked social profiles
    • messaging_pubkey (string, optional): Public key for encrypted messaging
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "reddid": "reddid",
  "owner_address": "owner_address",
  "display_name": "display_name",
  "avatar_hash": "ipfs_hash",
  "bio": "user_biography",
  "email_hash": "hashed_email",
  "social_data": {
    ... social profile links ...
  },
  "messaging_pubkey": "public_key_hex",
  "verification_status": n,
  "creation_time": timestamp,
  "last_updated": timestamp,
  "expiration_time": timestamp,
  "active": true|false,
  "flags": n
}

Example:

// Update a ReddID profile
const profileData = {
  display_name: "Alice Smith",
  bio: "Blockchain enthusiast and developer",
  avatar_hash: "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco"
};

const updatedProfile = await reddid.updateprofile("alice", profileData);
console.log(`Updated profile for ${updatedProfile.reddid}, new display name: ${updatedProfile.display_name}`);

Social Connections

getuserconnections(reddId, connectionType, direction)

Gets all social connections for a ReddID.

Parameters:

  • reddId (string, required): The ReddID to get connections for
  • connectionType (numeric, optional): Filter by connection type (0=follow, 1=friend, 2=endorse, 3=block)
  • direction (string, optional, default="outgoing"): Connection direction to show: 'outgoing', 'incoming', or 'both'

Response:

{
  "reddid": "reddid",
  "outgoing_connections": [
    {
      "to_reddid": "target_reddid",
      "connection_type": n,
      "type_name": "connection_type_string",
      "creation_time": timestamp,
      "last_interaction": timestamp,
      "visibility": n,
      "metadata": "additional_metadata"
    },
    ...
  ],
  "incoming_connections": [
    {
      "from_reddid": "source_reddid",
      "connection_type": n,
      "type_name": "connection_type_string",
      "creation_time": timestamp,
      "last_interaction": timestamp,
      "visibility": n
    },
    ...
  ]
}

Example:

// Get all friend connections for a ReddID
const connections = await reddid.getuserconnections("alice", 1, "both");
console.log(`${connections.reddid} has ${connections.outgoing_connections.length} friends and ${connections.incoming_connections.length} incoming friend requests`);

createuserconnection(fromReddId, toReddId, type, visibility, metadata, account, addressType, label)

Creates a social connection between two ReddIDs.

Parameters:

  • fromReddId (string, required): The source ReddID
  • toReddId (string, required): The target ReddID
  • type (numeric, required): Connection type (0=follow, 1=friend, 2=endorse, 3=block)
  • visibility (numeric, optional, default=0): Privacy setting (0=public, 1=friends, 2=private)
  • metadata (string, optional): Additional connection metadata
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "from_reddid": "source_reddid",
  "to_reddid": "target_reddid",
  "connection_type": n,
  "type_name": "connection_type_string",
  "creation_time": timestamp,
  "last_interaction": timestamp,
  "visibility": n,
  "metadata": "additional_metadata",
  "owner_address": "owner_address"
}

Example:

// Create a friend connection between two ReddIDs
const connection = await reddid.createuserconnection(
  "alice",          // from ReddID
  "bob",            // to ReddID
  1,                // connection type (friend)
  0,                // visibility (public)
  "Friends since school"  // metadata
);
console.log(`Created ${connection.type_name} connection from ${connection.from_reddid} to ${connection.to_reddid}`);

updateuserconnection(fromReddId, toReddId, type, visibility, metadata, account, addressType, label)

Updates an existing social connection between two ReddIDs.

Parameters:

  • fromReddId (string, required): The source ReddID
  • toReddId (string, required): The target ReddID
  • type (numeric, required): New connection type (0=follow, 1=friend, 2=endorse, 3=block)
  • visibility (numeric, optional): New privacy setting (0=public, 1=friends, 2=private)
  • metadata (string, optional): New additional connection metadata
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "from_reddid": "source_reddid",
  "to_reddid": "target_reddid",
  "connection_type": n,
  "type_name": "connection_type_string",
  "creation_time": timestamp,
  "last_interaction": timestamp,
  "visibility": n,
  "metadata": "additional_metadata",
  "owner_address": "owner_address"
}

Example:

// Update a connection between two ReddIDs
const connection = await reddid.updateuserconnection(
  "alice",          // from ReddID
  "bob",            // to ReddID
  2,                // new connection type (endorse)
  1,                // new visibility (friends-only)
  "Trusted colleague"  // new metadata
);
console.log(`Updated connection from ${connection.from_reddid} to ${connection.to_reddid} to type: ${connection.type_name}`);

deleteuserconnection(fromReddId, toReddId, account, addressType, label)

Deletes a social connection between two ReddIDs.

Parameters:

  • fromReddId (string, required): The source ReddID
  • toReddId (string, required): The target ReddID
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "from_reddid": "source_reddid",
  "to_reddid": "target_reddid",
  "deleted": true
}

Example:

// Delete a connection between two ReddIDs
const result = await reddid.deleteuserconnection("alice", "bob");
console.log(`Connection from ${result.from_reddid} to ${result.to_reddid} deleted`);

Reputation API

Reputation Information

getuserreputation(reddId, detailed)

Gets the reputation information for a ReddID.

Parameters:

  • reddId (string, required): The ReddID to get reputation for
  • detailed (boolean, optional, default=false): If true, include detailed breakdown of reputation components

Response:

{
  "reddid": "reddid",
  "overall_score": n,
  "last_calculated": timestamp,
  "longevity_score": n,
  "transaction_score": n,
  "engagement_score": n,
  "verification_score": n,
  "auction_score": n,
  "owner": "owner_address",
  "profile_summary": {
    "display_name": "display_name",
    "verification_status": n,
    "creation_time": timestamp,
    "active": true|false
  }
}

Example:

// Get detailed reputation information for a ReddID
const reputation = await reddid.getuserreputation("alice", true);
console.log(`${reputation.reddid} has an overall reputation score of ${reputation.overall_score}`);
console.log(`Component scores: Longevity ${reputation.longevity_score}, Transactions ${reputation.transaction_score}`);

getuserreputationhistory(reddId, count, startTime)

Gets reputation history for a ReddID.

Parameters:

  • reddId (string, required): The ReddID to get reputation history for
  • count (numeric, optional, default=10): Number of historical entries to retrieve
  • startTime (numeric, optional, default=current time): Start time as Unix timestamp

Response:

{
  "reddid": "reddid",
  "current_score": n,
  "history": [
    {
      "timestamp": timestamp,
      "overall_score": n,
      "longevity_score": n,
      "transaction_score": n,
      "engagement_score": n,
      "verification_score": n,
      "auction_score": n,
      "calculator_signatures": "signature_count"
    },
    ...
  ]
}

Example:

// Get reputation history for a ReddID
const history = await reddid.getuserreputationhistory("alice", 20);
console.log(`Reputation history for ${history.reddid}, current score: ${history.current_score}`);
console.log(`Showing last ${history.history.length} reputation updates`);

Reputation Calculation

calculateuserreputation(reddId, force, account, addressType, label)

Calculates or recalculates reputation for a ReddID.

Parameters:

  • reddId (string, required): The ReddID to calculate reputation for
  • force (boolean, optional, default=false): Force recalculation even if recently updated
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "reddid": "reddid",
  "overall_score": n,
  "previous_score": n,
  "longevity_score": n,
  "transaction_score": n,
  "engagement_score": n,
  "verification_score": n,
  "auction_score": n,
  "last_calculated": timestamp,
  "calculator_address": "calculator_address",
  "recalculated": true|false
}

Example:

// Calculate reputation for a ReddID
const result = await reddid.calculateuserreputation("alice", true);
console.log(`Calculated reputation for ${result.reddid}: ${result.overall_score} (previous: ${result.previous_score})`);

updateuserreputation(reddId, reputationData, authAddress, account, addressType, label)

Updates reputation information for a ReddID. Only authorized nodes can update reputation directly.

Parameters:

  • reddId (string, required): The ReddID to update reputation for
  • reputationData (object, required): Reputation data to update
    • overall_score (numeric, optional): Overall reputation score (0-100)
    • longevity_score (numeric, optional): Score component for account age (0-100)
    • transaction_score (numeric, optional): Score component for transaction history (0-100)
    • engagement_score (numeric, optional): Score component for community engagement (0-100)
    • verification_score (numeric, optional): Score component for verification depth (0-100)
    • auction_score (numeric, optional): Score component for auction behavior (0-100)
  • authAddress (string, optional): Address of the authorized reputation calculator
  • account (string, optional): The account to use for HD wallets
  • addressType (string, optional): The address type to use (legacy, p2sh-segwit, bech32)
  • label (string, optional): A label for the address (HD wallet)

Response:

{
  "reddid": "reddid",
  "overall_score": n,
  "previous_score": n,
  "last_calculated": timestamp,
  "auth_address": "auth_address",
  "updated": true
}

Example:

// Update reputation for a ReddID (authorized nodes only)
const reputationData = {
  overall_score: 75.5,
  engagement_score: 80.0
};

const result = await reddid.updateuserreputation("alice", reputationData);
console.log(`Updated reputation for ${result.reddid} to ${result.overall_score} (previous: ${result.previous_score})`);

API Usage Examples

Complete Namespace Registration Workflow

// 1. Create a namespace auction
const namespaceAuction = await reddid.createnamespacesauction(
  "gaming",        // namespace ID
  25000,           // reserve price (25,000 RDD)
  14,              // duration in days
  0                // standard auction type
);
console.log(`Created auction ${namespaceAuction.auction_id} for namespace ${namespaceAuction.namespace_id}`);

// 2. Place a bid on the namespace auction
const namespaceBid = await reddid.bidonnamespacesauction(
  namespaceAuction.auction_id,
  30000            // bid amount (30,000 RDD)
);
console.log(`Placed bid of ${namespaceBid.bid_amount} RDD on auction ${namespaceBid.auction_id}`);

// 3. Finalize the namespace auction
const namespaceResult = await reddid.finalizenamespacesauction(namespaceAuction.auction_id);
console.log(`Namespace auction finalized, winner: ${namespaceResult.winner}`);

// 4. Configure the namespace
const namespaceConfig = {
  allow_numbers: true,
  allow_hyphens: false,
  allow_underscores: true,
  min_length: 3,
  max_length: 32,
  namespace_revenue_pct: 10,
  burn_pct: 70,
  node_pct: 15,
  dev_pct: 5
};

const pricingTiers = [
  {min_length: 1, min_price: 100000},
  {min_length: 3, min_price: 25000},
  {min_length: 5, min_price: 10000},
  {min_length: 10, min_price: 5000}
];

const configResult = await reddid.configurenamespacess("gaming", namespaceConfig, pricingTiers);
console.log(`Namespace ${configResult.id} configured successfully`);

User ID Registration and Profile Creation

// 1. Create a user ID auction
const userIdAuction = await reddid.createuseridauction(
  "player1",        // user ID name
  "gaming",         // namespace ID
  10000,            // reserve price (10,000 RDD)
  7,                // duration in days
  0                 // standard auction type
);
console.log(`Created auction ${userIdAuction.auction_id} for user ID ${userIdAuction.name}.${userIdAuction.namespace_id}`);

// 2. Place a bid on the user ID auction
const userIdBid = await reddid.bidonuseridauction(
  userIdAuction.auction_id,
  15000             // bid amount (15,000 RDD)
);
console.log(`Placed bid of ${userIdBid.bid_amount} RDD on auction ${userIdBid.auction_id}`);

// 3. Finalize the user ID auction
const userIdResult = await reddid.finalizeuseridauction(userIdAuction.auction_id);
console.log(`User ID auction finalized, winner: ${userIdResult.winner}`);

// 4. Update profile information
const profileData = {
  display_name: "Pro Gamer",
  bio: "Competitive esports player",
  avatar_hash: "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco",
  social_data: {
    twitter: "@progamer",
    discord: "progamer#1234"
  }
};

const profileResult = await reddid.updateprofile("player1", profileData);
console.log(`Profile updated for ${profileResult.reddid}`);

// 5. Create social connections
const connection = await reddid.createuserconnection(
  "player1",        // from ReddID
  "gamer2",         // to ReddID
  1,                // connection type (friend)
  0,                // visibility (public)
  "Game teammates"  // metadata
);
console.log(`Created ${connection.type_name} connection from ${connection.from_reddid} to ${connection.to_reddid}`);

Managing Reputation and Connections

// 1. Get reputation information
const reputation = await reddid.getuserreputation("player1", true);
console.log(`${reputation.reddid} has an overall reputation of ${reputation.overall_score}`);

// 2. Get social connections
const connections = await reddid.getuserconnections("player1", null, "both");
console.log(`${connections.reddid} has ${connections.outgoing_connections.length} outgoing connections and ${connections.incoming_connections.length} incoming connections`);

// 3. Update a connection
const updatedConnection = await reddid.updateuserconnection(
  "player1",        // from ReddID
  "gamer2",         // to ReddID
  2,                // new type (endorse)
  0,                // visibility (public)
  "Top player, highly recommended"  // new metadata
);
console.log(`Updated connection to ${updatedConnection.type_name}`);

// 4. Monitor reputation changes
const repHistory = await reddid.getuserreputationhistory("player1", 10);
console.log(`Reputation history for ${repHistory.reddid}:`);
repHistory.history.forEach(entry => {
  console.log(`  ${new Date(entry.timestamp * 1000)}: ${entry.overall_score}`);
});

Note: All API endpoints that modify data require appropriate authentication. Endpoints that create resources or update settings typically require ownership of the relevant resource, verified through cryptographic signatures. The specific authentication requirements are enforced by the underlying RPC implementation.

⚠️ **GitHub.com Fallback** ⚠️