Skip to main content

User Identification

How to identify users when sending events to the Resonance API.

The Pattern

{platform}_{user_id}@rsnc.network

This creates a deterministic wallet for each user.

Platform Examples

PlatformPatternExample
Discorddiscord_{user_id}@rsnc.networkdiscord_123456789@rsnc.network
Telegramtelegram_{user_id}@rsnc.networktelegram_987654321@rsnc.network
Your Gameyourgame_{player_id}@rsnc.networkmygame_player42@rsnc.network
Your Appmyapp_{user_id}@rsnc.networkmyapp_user_abc123@rsnc.network
Websitemysite_{user_id}@rsnc.networkmysite_visitor_xyz@rsnc.network
Direct Emailuser@example.comjohn@example.com

Deterministic Wallets

The same identifier always maps to the same wallet:

player_123@mygame.rsnc.network → 0xABC...
player_123@mygame.rsnc.network → 0xABC... (same wallet)

This means:

  • Users accumulate rewards over time
  • No registration required
  • Wallets created automatically on first reward

Best Practices

1. Use Stable Identifiers

Good:

discord_123456789@rsnc.network  (immutable Discord ID)
mygame_player_42@rsnc.network (database primary key)

Bad:

discord_CoolUsername@rsnc.network  (usernames can change)
mygame_session_abc123@rsnc.network (sessions are temporary)

2. Keep Platform Prefix Consistent

Always use the same prefix for your platform:

// Good - consistent prefix
const userEmail = `mygame_${playerId}@rsnc.network`;

// Bad - inconsistent prefixes
const userEmail1 = `mygame_${playerId}@rsnc.network`;
const userEmail2 = `game_${playerId}@rsnc.network`; // Different prefix!

3. Handle Special Characters

URL-encode special characters in user IDs:

// If user ID contains special characters
const safeId = encodeURIComponent(userId);
const userEmail = `myplatform_${safeId}@rsnc.network`;

4. Consider Cross-Platform Users

If a user might be on multiple platforms:

discord_123456789@rsnc.network  → Wallet A
telegram_987654321@rsnc.network → Wallet B (different wallet!)

If you want unified wallets, use a consistent identifier:

myplatform_user_abc@rsnc.network  → Same wallet everywhere

Direct Email Support

You can also use real email addresses:

john@example.com

This works when:

  • User has an email on file
  • You want users to access via email login

Wallet Access

Users can access their wallets via:

  1. perks.rsnc.network — Login with Discord/Telegram OAuth
  2. Email magic link — For direct email identifiers
  3. Partner Portal — For brand admins to view

Code Examples

Node.js

function getUserEmail(platform, userId) {
// Normalize the user ID
const normalizedId = String(userId).toLowerCase().trim();

// Create the deterministic email
return `${platform}_${normalizedId}@rsnc.network`;
}

// Usage
const discordUser = getUserEmail('discord', '123456789');
// → discord_123456789@rsnc.network

const gamePlayer = getUserEmail('mygame', 'player_42');
// → mygame_player_42@rsnc.network

Python

def get_user_email(platform: str, user_id: str) -> str:
"""Create deterministic user email for Resonance."""
normalized_id = str(user_id).lower().strip()
return f"{platform}_{normalized_id}@rsnc.network"

# Usage
discord_user = get_user_email('discord', '123456789')
# → discord_123456789@rsnc.network

game_player = get_user_email('mygame', 'player_42')
# → mygame_player_42@rsnc.network

Verification

The API will accept any valid email format. Wallets are created automatically.

To verify a user has received rewards:

  1. Check balance API (if available)
  2. Partner Portal Analytics — Search by user email
  3. Blockchain explorer — Look up wallet address

Migration Considerations

If you change your identifier scheme:

Old: game_player42@rsnc.network New: mygame_player_42@rsnc.network

These create different wallets. Plan migrations carefully:

  1. Stick with your original scheme
  2. Or implement a migration to transfer balances

Security

  • User emails are hashed for wallet derivation
  • No PII is stored beyond what's needed
  • Wallets are non-custodial (user controls)