DragonFire Developer Portal

Wallet SDK Contents

SDK Guides

Related SDKs

Dragon Wallets SDK

Browser Integration Sections

Related Resources

Browser Integration Guide

Dragon Wallets SDK Version 0.8.5

Transform the traditional web browsing experience with Dragon Wallets browser integration, enabling semantic web addressing, AI-powered navigation, and secure one-click payments.

Introduction to Semantic Web Integration

Dragon Wallets offers revolutionary browser integration capabilities that transform how users navigate and interact with the web, replacing traditional domain-based addressing with intuitive semantic profiles and AI-powered navigation.

Key Benefits

Dragon Wallets browser integration delivers significant advantages over traditional web experiences:

  • Intuitive Addressing: Replace www.domain.com with natural me.profile and name.profile addresses
  • AI Navigation: Let the AI assistant understand user intent and navigate to the appropriate destination
  • Seamless Authentication: One-click authentication without passwords or login forms
  • Secure Payments: Execute vector-based financial transactions directly from the browser
  • Identity Management: Control digital identity and credentials through the browser
  • Geometric Security: Leverage DragonFire's geometric security architecture in web environments
Semantic Web Integration Overview
Dragon Wallets semantic web architecture transforming traditional browsing

Traditional Web vs. Semantic Web

Characteristic Traditional Web Semantic Web with Dragon Wallets
Addressing www.domain.com/page name.profile
Navigation Explicit URL entry Intent-based AI navigation
Authentication Username/password for each site Single identity, one-click verification
Payments Form-based checkout process One-click vector transactions
Security Site-specific, variable protection Unified RWT security architecture
Context Awareness Limited to current page Full semantic understanding of intent

Browser Extension Overview

The Dragon Wallets browser extension serves as the gateway to the semantic web, providing a comprehensive suite of features for next-generation browsing.

Semantic Navigation

Transform URLs into intuitive profile addresses and enable AI-driven navigation based on user intent.

Identity Management

Manage digital identities and credentials with one-click authentication across websites.

Secure Payments

Execute vector-based transactions with one click, eliminating traditional checkout processes.

AI Assistant

Get intelligent assistance for navigation, transactions, and identity management powered by Aurora AI.

Extension Architecture

The Dragon Wallets browser extension uses a sophisticated architecture to integrate with both browsers and the DragonFire ecosystem:

Extension Architecture Diagram
// Extension initialization with core components
const extension = await DragonFire.initializeExtension({
  apiKey: 'YOUR_API_KEY',
  
  // Core features to enable
  features: [
    'semanticNavigation',     // Semantic web addressing
    'identityManagement',     // Identity and credential management
    'payments',               // Secure vector-based payments
    'aiAssistant'             // AI navigation assistant
  ],
  
  // Browser permissions required
  permissions: [
    'storage',                // Local storage access
    'tabs',                   // Browser tab management
    'webNavigation',          // Navigation interception
    'webRequest'              // Web request modification
  ],
  
  // Security settings
  security: {
    level: 'high',            // Security level
    rwtIntegration: true,     // Integrate with RWT
    encryptLocalData: true    // Encrypt local extension data
  }
});

Semantic Web Addressing

Replace traditional domain-based URLs with intuitive, human-centered profile addresses.

Profile Address Structure

alice.profile
Identifier
alice
Namespace
profile
me.profile/shopping
Self-reference
me
Namespace
profile
Context
shopping
dragonfire.wallet/transfer
Service
dragonfire
Type
wallet
Action
transfer

Creating a Semantic Profile

// Import necessary modules
import { DragonFireClient } from '@dragonfire/client';
import { WalletClient } from '@dragonfire/wallet-client';

// Initialize clients
const dragonfire = new DragonFireClient({ apiKey: 'YOUR_API_KEY' });
await dragonfire.connect();

const wallet = new WalletClient(dragonfire);

// Register a semantic profile
const profile = await wallet.createSemanticProfile({
  // Profile identification
  identityId: 'identity_123',          // Associated digital identity
  profileName: 'alice',                // Profile name (becomes alice.profile)
  displayName: 'Alice Johnson',        // Human-readable display name
  description: 'Software Engineer and AI Researcher',
  
  // Profile content
  avatarUrl: 'https://example.com/alice.jpg',
  bannerUrl: 'https://example.com/banner.jpg',
  socialLinks: {
    github: 'alicejohnson',
    twitter: 'alicej',
    linkedin: 'alice-johnson'
  },
  
  // Access settings
  publicAccess: true,                  // Publicly accessible profile
  verifiedIdentity: true,              // Identity verification badge
  
  // Redirect settings
  redirectOptions: {
    defaultUrl: 'https://alice.example.com',  // Default redirect
    customDomains: ['alicejohnson.com'],      // Custom domain options
    contexts: {
      'blog': 'https://alice.example.com/blog',
      'projects': 'https://github.com/alicejohnson',
      'contact': 'https://alice.example.com/contact'
    }
  }
});

console.log('Semantic profile created:');
console.log('Profile ID:', profile.id);
console.log('Profile address:', profile.address); // alice.profile
console.log('Public URL:', profile.publicUrl);

// Configure profile routing behavior in browser extension
await wallet.configureProfileRouting({
  profileId: profile.id,
  routing: {
    interceptWwwDomains: true,        // Intercept alice.com → alice.profile
    redirectionBehavior: 'ask',       // Ask before redirecting
    navigationPriority: 'high',       // High priority for navigation
    securityLevel: 'verified'         // Only allow verified destinations
  }
});

Implementing Semantic Addressing in Websites

Website owners can implement semantic addressing support with a simple meta tag:

<!-- Add to your website's head section -->
<meta name="dragonfire:profile" content="company.profile">
<meta name="dragonfire:profile:contexts" content='{"products": "/products", "support": "/support", "blog": "/blog"}'>

<!-- Add semantic navigation links -->
<a href="products.company.profile" class="df-semantic-link">Products</a>
<a href="support.company.profile" class="df-semantic-link">Support</a>
<a href="me.profile/settings" class="df-semantic-link">My Settings</a>

Automatic Domain-to-Profile Conversion

The Dragon Wallets browser extension can automatically convert traditional domain names to semantic profiles:

  • www.alice.comalice.profile
  • www.company.com/productsproducts.company.profile
  • www.example.com/user/alicealice.profile (with identity verification)

This conversion happens through AI analysis of the domain structure, page content, and user identity, creating a more intuitive browsing experience.

AI-powered Navigation

Dragon Wallets transforms web navigation with an intelligent AI assistant that understands user intent and context.

Navigation Assistant Configuration

// Configure the AI navigation assistant
await wallet.configureNavigationAssistant({
  // Core settings
  enabled: true,                     // Enable navigation assistant
  intelligenceLevel: 'advanced',     // Advanced AI capabilities
  learningMode: 'adaptive',          // Adapt to user behavior
  
  // Privacy settings
  privacySettings: {
    dataCollection: 'minimal',       // Minimal data collection
    localProcessing: true,           // Process data locally when possible
    encryptedStorage: true,          // Encrypt stored preferences
    retentionPolicy: '30-days'       // Data retention period
  },
  
  // Behavior settings
  defaultBehaviors: {
    suggestAlternatives: true,       // Suggest alternative destinations
    autoRedirect: false,             // Don't automatically redirect
    rememberPreferences: true,       // Remember user preferences
    interceptSearchQueries: true,    // Interpret search queries semantically
    enhanceNavigation: true          // Enhance traditional navigation
  },
  
  // Integration settings
  integrations: {
    auroraAI: true,                  // Integrate with Aurora AI
    vectorDatabase: true,            // Use vector database for matching
    semanticCache: true              // Cache semantic navigation results
  }
});

Intent-Based Navigation

The AI assistant processes navigation requests based on user intent rather than explicit URLs:

Buy new headphones
Buy
headphones
new
1
Identify intent as shopping-related
2
Check user's preferred electronics retailer from profile
3
Navigate to electronics.store.profile/headphones
Send $50 to Maria
Send
$50
Maria
1
Identify intent as financial transaction
2
Resolve "Maria" to maria.profile from contacts
3
Initialize wallet transfer: $50 to maria.profile

Processing Semantic Navigation

// Process a semantic navigation request
const navigationResult = await wallet.processSemanticNavigation('shopping.alice.profile', {
  // Navigation context
  context: 'e-commerce',              // Context for disambiguation
  intent: 'view-cart',                // User intent
  referrer: 'search',                 // Navigation source
  
  // User context
  userContext: {
    recentActivity: ['product-search', 'wishlist-view'],
    preferences: {
      retailer: 'preferred-store',
      shippingMethod: 'express'
    }
  },
  
  // Navigation options
  options: {
    suggestAlternatives: true,        // Suggest alternatives
    verifyDestination: true,          // Verify destination security
    preserveContext: true             // Preserve context in navigation
  }
});

console.log('Navigation result:');
console.log('Resolved destination:', navigationResult.destination);
console.log('Confidence score:', navigationResult.confidenceScore);
console.log('Alternative destinations:', navigationResult.alternatives);
console.log('Authentication required:', navigationResult.authRequired);

// Execute the navigation
if (navigationResult.confidenceScore > 0.8) {
  // High confidence - navigate directly
  await wallet.navigateTo(navigationResult.destination);
} else {
  // Lower confidence - show options to user
  const userSelection = await wallet.showDestinationOptions(navigationResult.alternatives);
  await wallet.navigateTo(userSelection);
}

Natural Language Navigation

Users can navigate using natural language directly in the address bar:

"Check my order status"
→ orders.me.profile/recent
"Book a flight to London"
→ travel.profile/flights?destination=london
"Find Italian restaurants nearby"
→ local.profile/restaurants?cuisine=italian

The AI processes these natural language requests and transforms them into semantic navigation actions, creating a more intuitive browsing experience.

Extension Setup and Configuration

Set up and configure the Dragon Wallets browser extension for Chrome and Firefox browsers.

Extension Installation

Note: Browser extensions are currently in beta. For early access, sign up through the DragonFire Developer Portal.

Extension Integration in Web Applications

// Detect and interact with the Dragon Wallets extension
function setupDragonFireExtension() {
  // Check if extension is installed
  if (window.dragonfire) {
    console.log('Dragon Wallets extension detected!');
    
    // Initialize connection with the extension
    window.dragonfire.init({
      appName: 'My E-Commerce Store',
      appId: 'com.example.store',
      features: ['payments', 'identity', 'navigation']
    })
    .then(result => {
      console.log('Extension initialized:', result);
      
      // Setup extension event listeners
      window.dragonfire.on('profileConnected', handleProfileConnection);
      window.dragonfire.on('paymentRequest', handlePaymentRequest);
      window.dragonfire.on('navigationRequest', handleNavigationRequest);
      
      // Update UI to show extension functionality
      showDragonFireFeatures();
    })
    .catch(err => {
      console.error('Extension initialization failed:', err);
    });
  } else {
    // Extension not installed - show installation prompt
    showExtensionInstallPrompt();
  }
}

// Handle a profile connection event
function handleProfileConnection(profile) {
  console.log('Connected profile:', profile);
  
  // Update UI with profile information
  document.getElementById('user-avatar').src = profile.avatarUrl;
  document.getElementById('user-name').textContent = profile.displayName;
  
  // Show authenticated UI
  document.getElementById('login-button').style.display = 'none';
  document.getElementById('user-profile').style.display = 'block';
}

// Handle a payment request
function handlePaymentRequest(payment) {
  console.log('Payment request:', payment);
  
  // Show payment confirmation UI
  document.getElementById('payment-amount').textContent = 
    payment.currency + ' ' + payment.amount;
  document.getElementById('payment-recipient').textContent = 
    payment.recipient;
  document.getElementById('payment-confirmation').style.display = 'block';
  
  // Handle confirmation
  document.getElementById('confirm-payment-button').onclick = () => {
    window.dragonfire.completePayment(payment.id, { confirmed: true });
  };
  
  // Handle cancellation
  document.getElementById('cancel-payment-button').onclick = () => {
    window.dragonfire.completePayment(payment.id, { confirmed: false });
  };
}

// Initialize when page loads
document.addEventListener('DOMContentLoaded', setupDragonFireExtension);

Extension Configuration

Configure the Dragon Wallets extension for optimal user experience:

// Configure the browser extension
const extension = await DragonFire.initializeExtension({
  apiKey: 'YOUR_API_KEY',
  features: ['semanticNavigation', 'identityManagement', 'payments'],
  permissions: ['storage', 'tabs', 'webNavigation'],
  securityLevel: 'high'
});

// Configure semantic navigation
extension.configureNavigation({
  // Address bar behavior
  addressBar: {
    interceptWwwDomains: true,       // Intercept www. domains
    interceptComDomains: true,       // Intercept .com domains
    defaultProfileDomain: 'profile', // Use .profile as default domain
    naturalLanguageInput: true       // Enable natural language in address bar
  },
  
  // UI elements
  interface: {
    showNavigationIndicator: true,   // Show navigation indicator in address bar
    profileBadgeEnabled: true,       // Show profile badge for semantic sites
    aiSuggestionsEnabled: true,      // Show AI navigation suggestions
    semanticHistoryEnabled: true     // Enable semantic browsing history
  },
  
  // AI settings
  ai: {
    assistanceLevel: 'proactive',    // Level of AI assistance
    learningEnabled: true,           // Enable learning from user behavior
    privacyMode: 'balanced',         // Privacy mode for AI features
    suggestionThreshold: 0.7         // Confidence threshold for suggestions
  }
});

Semantic Profile Management

Manage and control semantic profiles through the browser extension.

Creating and Managing Profiles

// Create a semantic profile through the extension
const profile = await extension.createProfile({
  // Profile details
  name: 'alice',                      // Profile name (alice.profile)
  displayName: 'Alice Johnson',       // Display name
  description: 'Software Engineer',   // Profile description
  
  // Profile content
  avatar: imageDataOrUrl,             // Profile avatar
  banner: bannerDataOrUrl,            // Profile banner
  
  // Profile links
  links: {
    website: 'https://alice-johnson.com',
    github: 'https://github.com/alicejohnson',
    twitter: 'https://twitter.com/alicej'
  },
  
  // Profile content
  sections: [
    {
      title: 'About Me',
      content: 'Software engineer specializing in AI and web development...',
      visibility: 'public'
    },
    {
      title: 'Projects',
      content: 'List of my recent projects and contributions...',
      visibility: 'public'
    },
    {
      title: 'Contact Information',
      content: 'Email: alice@example.com\nPhone: (555) 123-4567',
      visibility: 'connections'  // Only visible to connections
    }
  ],
  
  // Privacy settings
  privacy: {
    defaultVisibility: 'public',      // Default content visibility
    allowDiscovery: true,             // Allow profile discovery
    indexable: true,                  // Allow indexing by semantic search
    dataSharing: 'minimal'            // Data sharing preferences
  }
});

// Update an existing profile
await extension.updateProfile(profile.id, {
  description: 'Senior Software Engineer & AI Researcher',
  sections: [
    // Updated sections...
  ]
});

// Manage profile connections
const connections = await extension.getProfileConnections();
console.log('Profile connections:', connections);

// Add a new connection
await extension.addProfileConnection('bob.profile', {
  connectionType: 'friend',
  visibilityLevel: 'full',
  notes: 'Met at tech conference'
});

Profile Verification and Security

Verify your profile and enhance its security through the extension:

// Verify profile identity
const verificationResult = await extension.verifyProfileIdentity({
  // Verification method
  method: 'document',               // Document verification
  documentType: 'passport',         // Document type
  documentData: documentImageData,  // Document data
  
  // Additional verification
  additionalVerification: {
    email: 'alice@example.com',     // Verify email
    phone: '+1234567890',           // Verify phone
    socialAccounts: ['github']      // Verify social accounts
  }
});

console.log('Verification result:', verificationResult);
console.log('Verification status:', verificationResult.status);
console.log('Verification level:', verificationResult.verificationLevel);

// Enhance profile security
await extension.enhanceProfileSecurity({
  // Security settings
  twoFactorAuthentication: true,    // Enable 2FA
  loginNotifications: true,         // Enable login notifications
  activityAlerts: true,             // Enable unusual activity alerts
  
  // Recovery options
  recoveryEmail: 'recovery@example.com',
  recoveryPhone: '+1987654321',
  
  // Advanced security
  phiSecurityEnabled: true,         // Enable phi-resonant security
  rwtAuthentication: true,          // Use RWT for authentication
  biometricVerification: true       // Enable biometric verification
});

Profile Analytics and Insights

Get insights about your profile's usage and interactions:

// Get profile analytics
const analytics = await extension.getProfileAnalytics({
  timeRange: {
    start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), // Last 30 days
    end: new Date()
  },
  metrics: [
    'views',                    // Profile views
    'connections',              // New connections
    'interactions',             // Profile interactions
    'navigationSources',        // Navigation sources
    'contentEngagement'         // Content engagement
  ]
});

console.log('Profile analytics:');
console.log('Total views:', analytics.views.total);
console.log('View trend:', analytics.views.trend);
console.log('Top navigation sources:', analytics.navigationSources.top);
console.log('Content engagement:', analytics.contentEngagement);

// Generate profile insights
const insights = await extension.generateProfileInsights();
console.log('Profile insights:', insights);
console.log('Improvement suggestions:', insights.improvementSuggestions);
console.log('Connection opportunities:', insights.connectionOpportunities);

Payments Integration

Integrate vector-based payments into websites and applications for secure one-click transactions.

Website Payment Button

<!-- Add Dragon Wallets payment button to your site -->
<button 
  class="df-payment-button" 
  data-amount="49.99" 
  data-currency="USD" 
  data-recipient="store.profile" 
  data-item="Premium Subscription" 
  data-success-url="/thank-you"
  data-cancel-url="/cart">
  Pay with Dragon Wallet
</button>

<script>
  // Initialize Dragon Wallets payment functionality
  document.addEventListener('DOMContentLoaded', function() {
    // Check if Dragon Wallets extension is available
    if (window.dragonfire) {
      // Initialize payment buttons
      const paymentButtons = document.querySelectorAll('.df-payment-button');
      
      paymentButtons.forEach(button => {
        button.addEventListener('click', async function(e) {
          e.preventDefault();
          
          // Get payment details from button attributes
          const paymentDetails = {
            amount: parseFloat(button.getAttribute('data-amount')),
            currency: button.getAttribute('data-currency'),
            recipient: button.getAttribute('data-recipient'),
            item: button.getAttribute('data-item'),
            successUrl: button.getAttribute('data-success-url'),
            cancelUrl: button.getAttribute('data-cancel-url')
          };
          
          try {
            // Request payment through Dragon Wallets
            const result = await window.dragonfire.requestPayment(paymentDetails);
            
            // Handle payment result
            if (result.status === 'success') {
              // Payment successful - redirect to success page
              window.location.href = paymentDetails.successUrl +
                                      '?transaction=' + result.transactionId;
            } else if (result.status === 'canceled') {
              // Payment canceled - redirect to cancel page
              window.location.href = paymentDetails.cancelUrl;
            } else {
              // Payment failed - show error
              console.error('Payment failed:', result.error);
              alert('Payment failed: ' + result.error.message);
            }
          } catch (error) {
            console.error('Payment error:', error);
            alert('An error occurred during payment processing.');
          }
        });
      });
    } else {
      // Dragon Wallets not available - show installation prompt
      const paymentButtons = document.querySelectorAll('.df-payment-button');
      
      paymentButtons.forEach(button => {
        button.addEventListener('click', function(e) {
          e.preventDefault();
          showDragonWalletsInstallPrompt();
        });
      });
    }
  });
  
  // Show installation prompt
  function showDragonWalletsInstallPrompt() {
    // Implementation of installation prompt UI
    const modal = document.createElement('div');
    modal.className = 'df-install-modal';
    modal.innerHTML = `
      <div class="df-modal-content">
        <h2>Dragon Wallets Required</h2>
        <p>To make secure one-click payments, please install the Dragon Wallets browser extension.</p>
        <div class="df-modal-buttons">
          <a href="https://chrome.google.com/webstore/detail/dragon-wallets/..." target="_blank" class="df-install-button">Install for Chrome</a>
          <a href="https://addons.mozilla.org/en-US/firefox/addon/dragon-wallets/..." target="_blank" class="df-install-button">Install for Firefox</a>
          <button class="df-cancel-button">Cancel</button>
        </div>
      </div>
    `;
    
    document.body.appendChild(modal);
    
    // Add event listener to close modal
    modal.querySelector('.df-cancel-button').addEventListener('click', function() {
      document.body.removeChild(modal);
    });
  }
</script>

Extension Payment Handling

Handle payment requests from websites in the extension:

// Register payment request handler in extension
extension.on('paymentRequest', async (request) => {
  // Handle payment requests from websites
  const { amount, currency, recipient, purpose } = request;
  
  // Verify the payment request
  const verification = await extension.verifyPaymentRequest(request);
  
  if (verification.valid) {
    // Show payment confirmation dialog
    const confirmation = await extension.showPaymentConfirmation({
      amount: amount,
      currency: currency,
      recipient: recipient,
      purpose: purpose,
      securityInfo: verification.securityInfo
    });
    
    if (confirmation.approved) {
      // Execute the payment using vector transactions
      const result = await extension.executePayment(request, {
        vectorRouting: 'phi',        // Use phi-resonant routing
        securityLevel: 'high',       // High security level
        animateTransaction: true     // Show transaction animation
      });
      
      // Return payment result to the website
      extension.sendPaymentResult(request.id, {
        status: 'success',
        transactionId: result.transactionId,
        timestamp: result.timestamp
      });
    } else {
      // User canceled payment
      extension.sendPaymentResult(request.id, {
        status: 'canceled',
        reason: confirmation.cancelReason
      });
    }
  } else {
    // Invalid payment request
    extension.sendPaymentResult(request.id, {
      status: 'error',
      error: {
        code: 'invalid_request',
        message: verification.reason
      }
    });
  }
});

Transaction Authorization Flow

1
Payment Request
Website requests payment via extension API
2
Request Verification
Extension verifies payment request details
3
User Confirmation
User approves transaction in extension UI
4
Vector Transaction
Secure phi-resonant transaction processing
5
Receipt Confirmation
Website receives transaction confirmation

PORTAL Port Integration

The browser extension integrates with the PORTAL geometric port for advanced interdimensional operations and external integrations.

PORTAL Geometric Properties

The PORTAL port uses dodecahedral geometry (phi-based Platonic solid) to create gateways between the DragonFire ecosystem and external systems:

  • Geometric Form: Dodecahedron (12 pentagonal faces)
  • Mathematical Basis: Golden ratio (φ), pentagonal faces
  • Binary Encoding: 0b111 (7)
  • Key Properties: Phi-resonance, gateways, external connections

PORTAL Port Operations

// Import necessary modules
import { DragonFireClient } from '@dragonfire/client';
import { WalletClient } from '@dragonfire/wallet-client';
import { PortClient } from '@dragonfire/ports-client';

// Initialize clients
const dragonfire = new DragonFireClient({ apiKey: 'YOUR_API_KEY' });
await dragonfire.connect();

const wallet = new WalletClient(dragonfire);
const ports = new PortClient(dragonfire);

// Register a semantic profile through PORTAL port
const profile = await ports.executePortOperation('PORTAL', {
  action: 'REGISTER',
  entity: 'PROFILE',
  parameters: {
    identityId: 'identity_123',
    profileName: 'alice',
    publicAccess: true,
    redirectUrl: 'https://alice.example.com'
  }
});