Evrmore Accounts Documentation

A complete white-label authentication solution for web applications using Evrmore blockchain.

Overview

Evrmore Accounts is an all-in-one authentication solution that enables web applications to implement secure, blockchain-based authentication with minimal effort. It uses the Evrmore blockchain to authenticate users through cryptographic signatures, eliminating the need for passwords and centralized identity management.

Key Features

  • White-Label Solution: Fully customizable and brandable authentication system
  • RESTful API: Complete backend authentication API
  • JavaScript Client Library: Easy-to-integrate frontend library
  • Complete Frontend Components: Ready-made UI components for authentication
  • No Passwords: Authentication based on blockchain cryptography
  • Self-hosted: Run it on your own servers for maximum privacy and control

Installation

Evrmore Accounts can be installed using pip:

pip3 install evrmore-accounts

Requirements

  • Python 3.7 or later
  • Flask 2.0.0 or later
  • evrmore-authentication 0.3.0 or later

Getting Started

1

Start the Evrmore Accounts server

After installation, you can start the Evrmore Accounts server with:

python3 -m evrmore_accounts.app

This will start a Flask server on localhost:5000 with both the API endpoints and a web interface.

2

Access the Demo Interface

Open http://localhost:5000/demo in your web browser to see the authentication flow in action.

3

View the Integration Example

Visit http://localhost:5000/example to see a simple example of how to integrate Evrmore Accounts into your web application.

Configuration

Evrmore Accounts can be configured using environment variables:

# Server configuration
PORT=5000
HOST=0.0.0.0
DEBUG=false

# Security
SECRET_KEY=your-secret-key-here

# Database settings
DATABASE_URL=sqlite:///evrmore_accounts.db

You can create a .env file in your project directory with these variables, and they will be automatically loaded when the server starts.

Deployment

For production deployments, we recommend using a WSGI server like Gunicorn:

pip3 install gunicorn
gunicorn "evrmore_accounts.app:create_app()" --bind 0.0.0.0:5000

Deploying with Docker

You can also deploy Evrmore Accounts using Docker:

docker pull manticoretechnologies/evrmore-accounts
docker run -p 5000:5000 manticoretechnologies/evrmore-accounts

Nginx Configuration

For production deployments, we recommend using Nginx as a reverse proxy:

server {
    listen 80;
    server_name auth.yourdomain.com;

    location / {
        proxy_pass http://localhost:5000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Customization

Evrmore Accounts is designed to be a white-label solution that you can fully customize to match your brand.

Styling

You can customize the look and feel by modifying the CSS files in the evrmore_accounts/static directory.

Templates

The HTML templates can be found in the evrmore_accounts/templates directory. You can modify these to match your brand's design.

Frontend Library

The JavaScript client library (evrmore-accounts.js) can be customized to change the authentication flow or add additional features.

API Customization

You can extend the API by subclassing the AccountsServer class and adding your own endpoints.

API Reference

Evrmore Accounts provides a RESTful API for authentication:

Challenge Generation

POST /api/challenge
Content-Type: application/json

{
  "evrmore_address": "EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc"
}

Response:
{
  "challenge": "Sign this message to authenticate with Evrmore: EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc:1741814609:d47fc13f26226910",
  "expires_at": "2025-03-12T13:33:29.077793"
}

Authentication

POST /api/authenticate
Content-Type: application/json

{
  "evrmore_address": "EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc",
  "challenge": "Sign this message to authenticate with Evrmore: EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc:1741814609:d47fc13f26226910",
  "signature": "H/SignatureValueHere..."
}

Response:
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2025-03-19T13:33:29.077793",
  "user": {
    "id": "12345",
    "evrmore_address": "EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc"
  }
}

Token Validation

GET /api/validate
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Response:
{
  "valid": true,
  "expires_at": "2025-03-19T13:33:29.077793",
  "evrmore_address": "EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc"
}

User Information

GET /api/user
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Response:
{
  "id": "12345",
  "evrmore_address": "EViF16aYCetDH56MyKCcxfyeZ3F7Ao7ZBc",
  "username": null,
  "email": null,
  "is_active": true
}

Sign Out

POST /api/logout
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Response:
{
  "success": true,
  "message": "Successfully logged out"
}

JavaScript Library

The Evrmore Accounts JavaScript library provides client-side functionality for authentication.

Including the Library

<script src="/static/evrmore-accounts.js"></script>

Initialization

// Initialize Evrmore Accounts
EvrmoreAccounts.init({
  apiUrl: '/api',
  autoRefresh: true,
  debug: false
});

Creating a Sign-In Button

// Create a sign-in button
EvrmoreAccounts.initSignInButton('#sign-in-button');

Listening for Authentication State Changes

// Listen for authentication state changes
EvrmoreAccounts.onAuthStateChanged(function(user) {
  if (user) {
    console.log('User is signed in:', user);
    // Show authenticated UI
  } else {
    console.log('User is signed out');
    // Show sign-in UI
  }
});

Signing Out

// Sign out the user
EvrmoreAccounts.signOut();

Advanced: Custom Challenge Handler

// Custom challenge handler
EvrmoreAccounts.initSignInButton('#sign-in-button', {
  onChallenge: function(challenge, completeAuth) {
    // Display the challenge to the user
    document.getElementById('challenge-text').textContent = challenge.challenge;
    
    // Show challenge UI
    document.getElementById('challenge-container').classList.remove('hidden');
    
    // Submit button handler
    document.getElementById('submit-signature-button').onclick = function() {
      const signature = document.getElementById('signature-input').value;
      completeAuth(signature);
    };
  }
});