WebWallet - Structures
Puzzles
A Hash Puzzle is a document that describes a problem to be solved before authorizing a transaction. Puzzles impose restrictions such as the list of public keys that are valid for signature verification, and the number of signatures required to solve them. Since addresses are essentially derived from hash puzzles, transactions must provide valid solutions in order to modify their balances.
Restriction | Example |
---|---|
valid public keys | [alice, bob, charlie] |
threshold | 2 out of 3 |
Trees
Merkle trees are hash based data structures in which pairs of hashes are consecutively hashed until only one is left, called the merkle root. WebWallet uses trees to secure transaction history while enabling efficient verifications of proof of membership, which can determine whether a transaction was included in a given block without knowing all of its transactions.
Graphs
A graph is a data structure made of nodes and arcs, in which nodes represent entities and arcs the relationships between them. WebWallet uses graphs mainly to represent transactions and their spent outputs, determine an address balance, traverse the transaction history and implement transaction clearing almost entirely with append-only operations.
Blocks
A Block is a list of transactions cleared in the same timeframe. Although transaction hashes are listed in a specific order, all transactions included in the same block are said to have been cleared "at the same time". Blocks are a way to buffer transactions in order to solve the double-spending problem through mining, but WebWallet uses blocks only for proof of membership.
Stacks
Stacks are groups of blocks meant to overcome the scalability constraints related to the size of individual blocks. Stacks are made of blocks in the same way that blocks are made of transactions, by creating a Merkle tree out of block hashes. Stack hashes can later be secured using proof-of-work in the same way that blocks are secured in Bitcoin.