LBC (LoopingBinary Coin)
LBC is the universal digital currency that powers the entire LoopingBinary ecosystem. Users earn coins through platform activities, affiliate sales, and can exchange them for XAF (Central African Francs) in their wallet.
What are LB Coins?
LB Coins are a digital currency system that enables seamless value transfer across the LMS, E-commerce, Tournaments, and Community platforms. They are stored in user wallets and managed through secure transactions.
How LB Coins Work
The coin system is built on a secure, centralized ledger with the following components:
User Wallets
Every user has a wallet that stores their LB Coin balance. Wallets are created automatically when a user registers.
Transactions
All coin movements are recorded as transactions with complete audit trails including sender, receiver, amount, type, and reason.
Treasuries
Four system treasuries manage coins for different purposes: Course fees, Subscriptions, Rewards, and General operations.
Core Operations
The coin system supports several key operations:
1Minting Coins
Admins can mint (create) new coins and add them to any user's wallet. This is typically used for rewards, bonuses, or refunds.
fetch('https://api.loopingbinary.com/api/admin/mint', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.LB_API_KEY,
'Authorization': 'Bearer ' + token
},
body: JSON.stringify(({
userId: 123,
amount: 100,
reason: 'Welcome bonus'
})
})2Transferring Coins
Users can transfer coins to other users (P2P transfers) or to treasuries for payments.
fetch('https://api.loopingbinary.com/api/coins/transfer', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + token
},
body: JSON.stringify(({
toUserId: 456,
amount: 50,
reason: 'Payment for service'
})
})3Burning Coins
Admins can burn (destroy) coins from any user's wallet. This is used for penalties or corrections.
fetch('https://api.loopingbinary.com/api/admin/burn', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.LB_API_KEY,
'Authorization': 'Bearer ' + token
},
body: JSON.stringify(({
userId: 123,
amount: 25,
reason: 'Penalty for violation'
})
})Transaction Types
All coin movements are categorized into different transaction types:
| Type | Description | Who Can Execute |
|---|---|---|
| MINT | Create new coins and add to wallet | Admin only |
| BURN | Destroy coins from wallet | Admin only |
| TRANSFER | Move coins between users | Any user |
| PURCHASE | Pay for courses, products, etc. | Any user |
| REWARD | Tournament prizes, bonuses | System/Admin |
| REFUND | Return coins for cancelled purchase | Admin only |
Checking Balance
Users can check their current coin balance at any time:
fetch('https://api.loopingbinary.com/api/wallets/me', {
headers: {
'Authorization': 'Bearer ' + token
}
})Response Example:
{
"id": "uuid",
"userId": 123,
"balance": 1250.50,
"activeCoins": 1250.50,
"totalReceived": 2000.00,
"totalSent": 749.50,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-10-02T16:30:00Z"
}Transaction History
Get a complete history of all coin transactions for a user:
fetch('https://api.loopingbinary.com/api/wallets/me/transactions?limit=50&offset=0', {
headers: {
'Authorization': 'Bearer ' + token
}
})Response Example:
{
"transactions": [
{
"id": 1,
"type": "MINT",
"amount": 100,
"fromUserId": null,
"toUserId": 123,
"reason": "Welcome bonus",
"createdAt": "2025-10-01T10:00:00Z"
},
{
"id": 2,
"type": "TRANSFER",
"amount": 50,
"fromUserId": 123,
"toUserId": 456,
"reason": "Payment for service",
"createdAt": "2025-10-02T14:30:00Z"
}
]
}Best Practices
- Always check balance before attempting a transfer
- Use atomic transactions to prevent race conditions
- Include descriptive reasons for all transactions
- Implement retry logic for failed transactions
- Monitor transaction history for suspicious activity
- Never mint coins directly to production without proper authorization