-
Notifications
You must be signed in to change notification settings - Fork 2
/
PQC Frameworks.rb
73 lines (73 loc) · 13.6 KB
/
PQC Frameworks.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//Frameworks SPHINX Blockchain
//@website https://linktr.ee/sphinx.org
//@authors: C. Kusuma
//
//
//
// +=================================================================================================================================>>+
// ^ | Public key |
// | +--------------|
// +=====================================================================>+ |
// ^ | Private key | |
// | +---------------| v
// | v v
// +------------------+ +----------------+ +----------+ +-----------------+ +--------------------+ +----------------------+ +------------------+
// |Hybrid PQC + Curve| |Transaction data| <<=====>> | Hashing | <<=>> |Digital Signature| |Transaction proposal| ====>> |Transaction validation| =====================================================>> | Pool of valid |
// +------------------+ +----------------+ +----------+ +-----------------+ +--------------------+ +----------------------+ +------------------+
// ^ | | SHA3 | | SPHINCS+ | ^ | | |
// ^ | |SPHINXHash| | DSA | ^ | Block Validation | |
// | | +----------+ +-----------------+ | |----------------------| |
// | v v | | Proof-of-Work | v
// | v v | | SPHINXHash | v
// | +----------------------------------------------------------------------+ | +----------------------+ +-------------------+
// +----------------+ | |"YOUR SK WILL BE ABSTRACTION"| | | ^ | Valid transaction |
// | USERS | | Prover |-----------------------------| Verifier | ===>> + ^ +-------------------+
// +----------------+ | | ZK-STARK | | | | | Valid transaction |
// +----------------------------------------------------------------------+ | | +-------------------+
// | +----------------------+ +---------------------+ | Valid transaction |
// | | Block | <<=========== | Merkle root hashing | <<=========== +-------------------+
// | +----------------------+ +---------------------+ | Valid transaction |
// | ^ | +-------------------+
// | ^ v
// | | v
// | | +---------------------+
// | | | Signature SPHINCS+ |
// | | | Script input PK |
// | | +---------------------+
// | | |
// v | v
// v | v
// +<<=========================================================================================+ | +---------------------+
// | | | Script output |
// | | | SPHINXHash |
// | | +---------------------+
// | |
// | |
// | |
// | |
// | |
// | |
// | +============================================================================>>+
// | ^
// | ^
// | |
// | |
// | |
// v |
// v |
// +------------------------------+ +------------------------------+ +------------------------------+ +------------------------------+ +--------------------------------+
// | Block n2 | | Block n+1 | | Block n | | Block 1 | | Genesis Block |
// |------------------------------| |------------------------------| |------------------------------| |------------------------------| |--------------------------------|
// | |Version | | |Version | | |Version | | |Version | | |Version |
// | |--------------------| | |--------------------| | |--------------------| | |--------------------| | |--------------------|
// | |Merkle root | | |Merkle root | | |Merkle root | | |Merkle root | | |Merkle root |
// | HEADER |--------------------| | HEADER |--------------------| | HEADER |--------------------| | HEADER |--------------------| | HEADER |--------------------|
// | |Time stamp | | |Time stamp | | |Time stamp | | |Time stamp | | |Time stamp |
// | |--------------------| | |--------------------| | |--------------------| | |--------------------| | |--------------------|
// | |Difficulty target | | |Difficulty target | | |Difficulty target | | |Difficulty target | | |Difficulty target |
// | |--------------------| | |--------------------| | |--------------------| | |--------------------| | |--------------------|
// | |Nonce | SHA3 | |Nonce | SHA3 | |Nonce | SHA3 | |Nonce | SHA3 | |Nonce |
// |---------|--------------------| SPHINXHash |------------------------------| SPHINXhash |------------------------------| SPHINXHash |------------------------------| SPHINXHash |--------------------------------|
// | Hash Prev. Hash | <<======>> | Hash Prev. Hash | <<=====>> | Hash Prev. Hash | <<=====>> | Hash Prev. Hash | <<=====>> | Hash of block 0 |
// +------------------------------+ +------------------------------+ +------------------------------+ +------------------------------+ +--------------------------------+
//