Knots
Knots are the fundamental unit of money in String Theory. They are immutable, meaning once created they cannot be changed. This is a powerful property that makes them perfect for tracking money in a system. Knots are created when money is deposited into the system. Rather than being changed, whenever the money changes state or acquires new context, a new knot is created and the original is marked as stale. Rather than being destroyed, a withdrawn knot is created to represent the money being removed from the system. At every stage, we have complete information.
Knot amount
Section titled “Knot amount”A knot contains three main fields that describe its amount:
- unit type : The category of asset (e.g. currency, loyalty points, real estate, etc.)
- unit token : The specific sub-type of asset (e.g. USD, a property address, etc.)
- unit count : The whole number count of the asset
For example, a knot representing $10.00 USD could have:
- unit type: “currency_centis”
- unit token: “USD”
- unit count: 1000 (cents)
Note: In this case, the unit type also contains precision information. This is standard when working with currencies or other assets that have fractional units. Learn more about amounts in String Theory.
Changing knot values
Section titled “Changing knot values”Knots can be split (resulting in two knots with a combined amount equal to the original), but they cannot be changed or merged . This means that if you have a knot representing $10 USD, you cannot change it to $20 USD. Instead, you would need to deposit more money into the system. You also cannot take two knots worth $5 USD and combine them into a single knot worth $10 USD. However, you could place them in a group and then consider the group as a single “account” for the purposes of your business logic.
A consequence of these rules is that, unless you are performing exchanges, the total amount of money in a single thread can never increase or decrease.
Knot owners
Section titled “Knot owners”Owners generally represent the entity that owns the money. All knots must have exactly one owner; to move money to a different owner, you must withdraw the money from the original owner and deposit it into the new owner. (This is facilitated by the transfer operations.) From a technical perspective, owners define a distinct data shard; in other words, all the knots owned by a single owner could be stored in a single database separately from the other owners.
Knot groups
Section titled “Knot groups”Knots can be grouped together to form a collection of knots. This is useful for tracking money that belongs to a specific entity (e.g. a user, a business, a project, a quarterly budget, etc.). Notably, unlike records in traditional double-entry accounts, knots can be in any number of groups at once. Knot groups can be used to:
- Track the total amount of money in a group
- Operate on money in a group, such as when performing withdrawals or transfers
- Perform detailed investigations, especially when using an intersection of multiple groups
Knot threads
Section titled “Knot threads”Threads are conceptually similar to groups, but they follow a specific piece of money as it moves through the system. Threads cannot be created manually; a thread is created automatically any time a) a piece of money is deposited or b) a piece of money is split. No matter how many times a piece of money is split or changes state, you can always easily determine the current state of that money via a thread.
Knot operations
Section titled “Knot operations”Knots can be operated on in a variety of ways:
- Deposits: Create new knots when money is deposited
- Splits: Decompose a knot into exactly two new knots
- Withdrawals: Mark knots as removed from the system
- Transfers: Move knots between owners
- Exchanges: Convert knots from one unit type to another
Knot immutability
Section titled “Knot immutability”The immutability of knots is a key feature of String Theory. It ensures that:
- Money cannot be created or removed without a clear audit trail
- All operations on money are traceable
- The system is secure and reliable
Questions?
Section titled “Questions?”If you have any questions about knots or how to use them in your system, the String Theory team is always available to help.