Skip to content

Commit e7af2dd

Browse files
committed
white paper draft udpate
address
1 parent bfd4947 commit e7af2dd

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

VIAT.pages

3.17 KB
Binary file not shown.

streammsg.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
███████╗████████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██╗ ██╗ ███████╗███████╗████████╗████████╗██╗███╗ ██╗ ██████╗ ██╗ ██╗██████╗
2-
██╔════╝╚══██╔══╝██╔══██╗████╗ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔════╝╚══██╔══╝╚══██╔══╝██║████╗ ██║██╔════╝ ██║ ██║██╔══██╗
3-
███████╗ ██║ ███████║██╔██╗ ██║██║ ██║██████╔╝ ╚████╔╝ ███████╗█████╗ ██║ ██║ ██║██╔██╗ ██║██║ ███╗ ██║ ██║██████╔╝
4-
╚════██║ ██║ ██╔══██║██║╚██╗██║██║ ██║██╔══██╗ ╚██╔╝ ╚════██║██╔══╝ ██║ ██║ ██║██║╚██╗██║██║ ██║ ██║ ██║██╔═══╝
5-
███████║ ██║ ██║ ██║██║ ╚████║██████╔╝██████╔╝ ██║ ███████║███████╗ ██║ ██║ ██║██║ ╚████║╚██████╔╝ ╚██████╔╝██║
6-
╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝
1+
███╗ ██╗ █████╗ ██████╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗
2+
████╗ ██║██╔══██╗██╔══██╗ ████╗ ████║██╔═══██╗██╔══██╗██╔════╝
3+
██╔██╗ ██║███████║██████╔╝ ██╔████╔██║██║ ██║██║ ██║█████╗
4+
██║╚██╗██║██╔══██║██╔═══╝ ██║╚██╔╝██║██║ ██║██║ ██║██╔══╝
5+
██║ ╚████║██║ ██║██║ ██║ ╚═╝ ██║╚██████╔╝██████╔╝███████╗
6+
╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
7+
██████╗ ███████╗ ██████╗ █████╗ ██████╗██╗ ██╗ ██████╗ ███╗ ██╗ ██╗███╗ ██╗ █████╗ ██████╗ ██╗████████╗
8+
██╔══██╗██╔════╝ ██╔══██╗██╔══██╗██╔════╝██║ ██╔╝ ██╔═══██╗████╗ ██║ ██║████╗ ██║ ██╔══██╗ ██╔══██╗██║╚══██╔══╝
9+
██████╔╝█████╗ ██████╔╝███████║██║ █████╔╝ ██║ ██║██╔██╗ ██║ ██║██╔██╗ ██║ ███████║ ██████╔╝██║ ██║
10+
██╔══██╗██╔══╝ ██╔══██╗██╔══██║██║ ██╔═██╗ ██║ ██║██║╚██╗██║ ██║██║╚██╗██║ ██╔══██║ ██╔══██╗██║ ██║
11+
██████╔╝███████╗ ██████╔╝██║ ██║╚██████╗██║ ██╗ ╚██████╔╝██║ ╚████║ ██║██║ ╚████║ ██║ ██║ ██████╔╝██║ ██║
12+
╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝

utilities/file.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,6 @@ export function getDirectoryStructure(folderPath) {
127127
});
128128
return tree;
129129
}
130-
export async function ensureDirLegacy(folderPath) {
131-
const directories = normalize(folderPath).split(path.sep);
132-
let currentPath = `${path.sep}`;
133-
for (const dir of directories) {
134-
if (dir.length) {
135-
currentPath = path.join(currentPath, dir);
136-
try {
137-
await stat(currentPath);
138-
} catch {
139-
try {
140-
await mkdir(currentPath);
141-
} catch {
142-
console.log('Error creating folder', currentPath);
143-
}
144-
}
145-
}
146-
}
147-
}
148130
export async function ensureDirectoryPath(filePath) {
149131
const pathNormalized = normalize(filePath);
150132
return fsExtra.ensureDir(path.dirname(pathNormalized));

viat/wallet/generateAddress.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import ed25519 from '#crypto/signature/ed25519.js';
2+
import { encodeStrict } from '#utilities/serialize';
3+
import { hashLegacyAddress } from '#crypto/hash/shake256';
4+
export async function generateAddress(publicKey, type, version = 0) {
5+
const domained = await encodeStrict({
6+
type,
7+
version,
8+
publicKey,
9+
});
10+
if (this.cipherSuite.walletSize === 20) {
11+
return this.cipherSuite.hash.hashLegacyAddress(domained);
12+
} else if (this.cipherSuite.walletSize === 32) {
13+
return this.cipherSuite.hash.hash256(domained);
14+
} else if (this.cipherSuite.walletSize === 64) {
15+
return this.cipherSuite.hash.hash512(domained);
16+
}
17+
}

0 commit comments

Comments
 (0)