@mybucks.online/core 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/package.json +2 -2
- package/test/index.test.js +31 -0
package/README.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# @mybucks.online/core
|
|
2
2
|
|
|
3
|
-
This is a core part of mybucks.online crypto wallet, involving hashing and private key generation.
|
|
3
|
+
This is a core part of [mybucks.online](https://mybucks.online) crypto wallet, involving hashing and private key generation.
|
|
4
4
|
|
|
5
5
|
## mybucks.online
|
|
6
6
|
|
|
7
|
-
Mybucks.online is a **password-only, self-custodial and browser-based cryptocurrency wallet** built with Javascript. It generates a private key from your password and passcode using an industry-standard, verified **one-way hash function**. Your private key forms your account, allowing you to transfer, receive, and hold your crypto assets
|
|
7
|
+
[Mybucks.online](https://mybucks.online) is a **password-only, self-custodial and browser-based cryptocurrency wallet** built with Javascript. It generates a private key from your password and passcode using an industry-standard, verified **one-way hash function**. Your private key forms your account, allowing you to transfer, receive, and hold your crypto assets instantly.
|
|
8
|
+
|
|
9
|
+
As a hash function, the **scrypt** Key Derivation Function (KDF) increases the computational effort required to crack passwords, effectively delaying **brute-force** attacks and making them impractical.
|
|
10
|
+
|
|
11
|
+
It fully runs on your **browser side** without using any storage or invoking any 3rd-party APIs for key management. It instantly generates your private key from your password input, and whenever you close or refresh, there is no footprint. This absolutely protects your privacy.
|
|
8
12
|
|
|
9
13
|
## Quick start
|
|
10
14
|
|
|
@@ -29,6 +33,11 @@ const privateKey = getEvmPrivateKey(hash);
|
|
|
29
33
|
console.log("Private key: ", privateKey);
|
|
30
34
|
```
|
|
31
35
|
|
|
36
|
+
## Test
|
|
37
|
+
```bash
|
|
38
|
+
npm run test
|
|
39
|
+
```
|
|
40
|
+
|
|
32
41
|
## Docs
|
|
33
42
|
|
|
34
43
|
Find the docs [here](https://docs.mybucks.online).
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mybucks.online/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Core module for mybucks.online crypto wallet",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "node test/index.test.js"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const assert = require("node:assert");
|
|
2
|
+
const { describe, test } = require("node:test");
|
|
3
|
+
const { generateHash, getEvmPrivateKey } = require("../index.js");
|
|
4
|
+
|
|
5
|
+
const DEMO_PASSWORD = "DemoAccount5&";
|
|
6
|
+
const DEMO_PASSCODE = "112324";
|
|
7
|
+
const DEMO_HASH =
|
|
8
|
+
"af9a22d75f8f69d33fe8fc294e8f413219d9c75374dec07fda2e4a66868599609887a10e04981e17356d2c07432fc89c11089172fdf91c0015b9a4beef11e447";
|
|
9
|
+
const DEMO_PRIVATE_KEY =
|
|
10
|
+
"0x71743de900c63ed741263a2a4513c1b1829e80bd9f18d5d3a593e651b914cb3b";
|
|
11
|
+
|
|
12
|
+
describe("generateHash", () => {
|
|
13
|
+
test("should return empty string if password or passcode is blank", async () => {
|
|
14
|
+
const hash = await generateHash("", "");
|
|
15
|
+
assert.strictEqual(hash, "");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("should return scrypt hash result", async () => {
|
|
19
|
+
const hash = await generateHash(DEMO_PASSWORD, DEMO_PASSCODE);
|
|
20
|
+
assert.strictEqual(hash, DEMO_HASH);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("getEvmPrivateKey", () => {
|
|
25
|
+
test("should return 256bit private key", async () => {
|
|
26
|
+
const hash = await generateHash(DEMO_PASSWORD, DEMO_PASSCODE);
|
|
27
|
+
const privateKey = getEvmPrivateKey(hash);
|
|
28
|
+
|
|
29
|
+
assert.strictEqual(privateKey, DEMO_PRIVATE_KEY);
|
|
30
|
+
});
|
|
31
|
+
});
|