What is Machine Binding?
Machine binding is KeyBox’s mechanism for enforcing single-device license activation. When a user activates a license, it becomes permanently associated with that specific machine’s unique identifier.This prevents license sharing and ensures each license is used on only one device at a time.
How Machine IDs Work
KeyBox uses thenode-machine-id library to generate stable, unique identifiers for each machine.
Machine ID Generation
~/workspace/source/apps/server/src/controllers/redisLicense.controller.ts
Machine ID Characteristics
Stable
Same ID across application restarts and system reboots
Unique
Different for each physical/virtual machine
Hashed
SHA-256 hashed for privacy and security
Hardware-Based
Derived from hardware identifiers (CPU, MAC, etc.)
What Machine IDs Include
The library generates IDs based on:- CPU serial number
- System UUID
- MAC address
- Motherboard serial number
The exact components vary by operating system. The
machineIdSync(true) parameter ensures the ID is hashed for privacy.License Binding Process
Machine binding occurs during first activation:Activation Code with Binding
~/workspace/source/apps/server/src/controllers/redisLicense.controller.ts
Machine ID Validation
Every license validation request checks the machine ID:~/workspace/source/apps/server/src/controllers/redisLicense.controller.ts
Validation Flow
Machine Mismatch Response
Data Model
Machine ID storage in the license schema:~/workspace/source/apps/server/src/models/License.ts
The
machineId field is indexed to enable fast machine-based license lookups and queries.Caching Machine IDs
Machine IDs are included in cached license data:~/workspace/source/apps/server/src/cache/license.cache.ts
Cache Validation
Redis cache hits also enforce machine binding:Security Implications
Benefits
Prevents License Sharing
Prevents License Sharing
Users cannot share license keys with others, as each key only works on one machine.
Enforces Licensing Terms
Enforces Licensing Terms
Ensures compliance with single-device licensing agreements automatically.
Protects Revenue
Protects Revenue
Prevents unauthorized distribution and use of licenses across multiple devices.
Audit Trail
Audit Trail
Machine IDs provide a record of which device activated each license for support and security purposes.
Privacy Considerations
- Hashed IDs cannot be reverse-engineered to reveal hardware details
- No personally identifiable information (PII) is included
- Machine IDs are only used for validation—not tracking or analytics
SDK Machine Binding
The Node.js SDK automatically handles machine binding:~/workspace/source/apps/SDK/Node-SDK/index.js
SDK users don’t need to manually handle machine IDs—the activation process is automatic and transparent.
Handling Edge Cases
Hardware Changes
Machine IDs can change when:- Motherboard is replaced
- CPU is upgraded
- Virtual machine is migrated
- MAC address changes
In these scenarios, users will receive a
machine_mismatch error. Developers must manually reset the license’s machine binding.Virtual Machines
Virtual machines have stable machine IDs as long as:- VM configuration remains unchanged
- VM is not cloned or duplicated
- Hypervisor provides consistent hardware identifiers
Development vs Production
For development/testing scenarios:Machine Binding Lifecycle
| State | Machine ID | Behavior |
|---|---|---|
| PENDING | null | No machine binding—can be activated on any device |
| ACTIVE (first use) | Set on activation | Bound to the activating machine |
| ACTIVE (subsequent) | Unchanged | Validates against bound machine |
| EXPIRED | Preserved | Machine binding retained for records |
| REVOKED | Preserved | Machine binding retained for records |
Best Practices
Communicate Binding Policy
Inform users during purchase that licenses are single-device only
Provide Transfer Mechanism
Build a support process for legitimate machine changes
Monitor Mismatch Errors
Track
machine_mismatch responses to identify abuse patternsTest Across Platforms
Verify machine ID stability on Windows, macOS, and Linux
Resetting Machine Bindings
To allow a license to be re-activated on a new machine:Next Steps
License Lifecycle
Understand how licenses transition between states
SDK Integration
Integrate machine-bound licenses into your application
API Reference
Explore validation and activation endpoints
Dashboard
Monitor license activations and machine bindings