
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Webcredits is a library for creating decentralized ledgers and payments on the web.
npm install -g bitmark
credit create
credit genesis
After the tables are in place, the genesis process must be carried out. The standard population script will put 1 million bits in the coinbase which can then be distributed in tranches to the seed users or robots.
credit server
Then go to
Alternatively calls can be placed via the library or command line.
balance <URI> - shows a balance
create - creates a database
genesis - seeds a wallet
help - shows help message
insert <source> <amount> <unit> <destination>
[description] [timestamp] - inserts a web credit
reputation <URI> - gets the reputation
server - starts an express server
websocket - starts a websocket server
Will conform to the values in lib/dbconfig.js
config.dialect = 'mysql';
config.storage = 'credit.db';
config.host = 'localhost';
config.database = 'webcredits';
config.username = 'root';
config.password = '';
config.wallet = 'https://localhost/wallet/test#this';
dialect
is the db type
storage
is for sqlite defaults to credit.db
host
is hostdatabase
is database nameusername
is usernamepassword
is passwordwallet
is the wallet that contains the webcredit ledger, api and detailsAre supported
Webcredits is a transferable points scoring system. It can be used to provide feedback to the user, throttle actions and allow "gamification" of apps. The system is secure and compatible with the work of the W3C payments groups, so that real incentives may be eventually used. The first versions of the system will only use test credits of negligible monetary value. However, the same code can be used for production systems using full payments.
A wallet consists of a ledger and transactions. Each entry in the ledger is a URI and a positive balance.
<URI> "balance"^^xsd:decimal <currency>
Changes are made to the ledger via webcredits.
<source> <amount> <currency> <destination> <comment> <timestamp>
The genesis state is a starting ledger where one balance, usually the "coinbase" is a non zero account with an emission algorithm. Digital signatures may be included with the webcredits to prove who sent them.
The ledgers and credits can be stored in an LDPC or database. Changes to the ledger are made by adding new transactions, either via HTTP POST or by a direct insert to the database.
The main ontology is the webcredits system
Wallets can be found either from a WebID or from an application configuration using the wallet predicate.
https://w3id.org/cc#wallet
This allows users to launch a wallet app and see their balance, their transaction history, and to make new payments.
The wallet is the main holding structure that points to all the other items. A typical wallet may look as follows:
<#this>
<http://purl.org/dc/terms/description> "My Wallet" ;
a <https://w3id.org/cc#Wallet> ;
<https://w3id.org/cc#api> <http://klaranet/wallet/var/api/v1/> ;
<https://w3id.org/cc#inbox> <inbox/> ;
<https://w3id.org/cc#tx> <tx/> .
For large scale processing a database can be used. Initially supported databases are:
Example schemas
CREATE TABLE Credit (
`@id` TEXT,
`source` TEXT,
`amount` REAL,
`currency` VARCHAR(255) DEFAULT 'https://w3id.org/cc#bit',
`destination` TEXT,
`timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
`context` TEXT,
`description` TEXT,
`wallet` TEXT
);
CREATE TABLE Ledger (
`source` TEXT,
`amount` REAL,
`currency` VARCHAR(255) DEFAULT 'https://w3id.org/cc#bit',
`wallet` TEXT
);
CREATE TABLE Genesis (
`source` TEXT,
`amount` REAL,
`currency` VARCHAR(255) DEFAULT 'https://w3id.org/cc#bit',
`wallet` TEXT
);
The default currency is the 'bit' equal to one millionth of a bitcoin.
It is possible to access balances and credits directly from the database.
A RESTful API is also provided for convenience to the database.
It is possible to write records to the database, tho this is not recommended. Better is to use the javascript API.
The javascript API provides a function insert.js that will
insert.js <source> <amount> <currency> <destination> [comment] [timestamp] [wallet]
The first client used is an open source client side JS project called virtual wallet:
Object
setup database
Object
gets the current config
create tables
Object
get credit
createDB function
get balance
genesis initialization
genesis
get balance
get reputation
Today's credits
reputation function
Insert into webcredits
Object
setup database
Kind: global function
Returns: Object
- sequelize db object
Param | Type | Description |
---|---|---|
dialect | string | type of db mysql |
storage | string | file used for sqlite, default ./credit.db |
Object
gets the current config
Kind: global function
Returns: Object
- The config
create tables
Kind: global function
Param | Type | Description |
---|---|---|
sequelize | Object | db object |
callback | Object | callback |
Object
get credit
Kind: global function
Returns: Object
- the web credit if exists
Param | Type | Description |
---|---|---|
credit | Object | the web credit |
sequelize | Object | the DB connection |
config | Object | the config |
callback | Object | callback |
createDB function
Kind: global function
Param | Type | Description |
---|---|---|
config | Object | config |
callback | Object | callback |
get balance
Kind: global function
Param | Type | Description |
---|---|---|
source | String | the source |
sequelize | Object | sequelize object |
config | Object | config |
callback | function | callback |
genesis initialization
Kind: global function
Param | Type | Description |
---|---|---|
config | Object | config |
callback | function | callback |
genesis
Kind: global function
Param | Type | Description |
---|---|---|
config | Object | config |
callback | function | callback |
get balance
Kind: global function
Param | Type | Description |
---|---|---|
source | String | the source |
sequelize | Object | sequelize object |
config | Object | config |
callback | function | callback |
get reputation
Kind: global function
Param | Type | Description |
---|---|---|
sequelize | Object | db object |
Today's credits
Kind: global function
Param | Type | Description |
---|---|---|
credit | Object | a web credit |
sequelize | Object | db connection |
config | Object | config |
callback | function | callback |
reputation function
Kind: global function
Param | Type | Description |
---|---|---|
config | Object | [description] |
Insert into webcredits
Kind: global function
Param | Type | Description |
---|---|---|
credit | Object | a web credit |
sequelize | Object | db connection |
config | Object | config |
callback | function | callback |
FAQs
bitmark
We found that bitmark demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.