This commit is contained in:
2024-03-18 14:28:08 +02:00
parent f9674a74b9
commit e12acb690e
876 changed files with 788 additions and 546 deletions

View File

@@ -0,0 +1,13 @@
# Cloud Units
Cloud units are the basis for buying & selling capacity on the ThreeFold Grid (for more info see here).
- 1 CU = 1 compute unit
- 1 SU = 1 storage unit
- 1 NU = 1 network unit
References:
- Cloud units the the building blocks for any Cloud / IT workload. See definition [here](https://library.threefold.me/info/threefold#/tfgrid/farming/threefold__resource_units_calc_cloudunits)
- Cloud units are also used to determine commercial pricing for utilisation. See definition [here](https://library.threefold.me/info/threefold#/cloud/threefold__pricing?id=discount-levels)
- Low level primitive [cloud functions](https://library.threefold.me/info/threefold/#/technology/threefold__tfgrid_primitives)

View File

@@ -0,0 +1 @@
# Concepts

View File

@@ -0,0 +1,5 @@
# Cultivation
![cultivation](img/threefold__cloud_blockchain_.jpg)
> See: [https://library.threefold.me/info/threefold/#/cloud/threefold__cloud_home](https://library.threefold.me/info/threefold/#/cloud/threefold__cloud_home)

View File

@@ -0,0 +1,4 @@
# Farming
![farming](img/threefold__grid_new_.png)
> See: [https://library.threefold.me/info/threefold/#/tfgrid/farming/threefold__farming_intro](https://library.threefold.me/info/threefold/#/tfgrid/farming/threefold__farming_intro)

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

View File

@@ -0,0 +1,18 @@
![](img/grid_header.jpg)
# DAO Consensus Engine
## DAO Engine
On TFGrid 3.0 ThreeFold has implemented a DAO consensus engine using Polkadot/TFChain blockchain technology.
This is a powerful blockchain construct which allows us to run our TFGrid and maintain consensus on global scale.
This system has been designed to be compatible with multiple blockchains.

View File

@@ -0,0 +1,17 @@
![](img/grid_header.jpg)
### consensus engine in relation to TFT Farming Rewards in TFGrid 3.0
The consensus engine checks the farming rules as defined in
- [farming logic 3.0](farming_reward)
- [farming reward calculator](farming_calculator)
- if uptime + 98% per month then the TFT will be rewarded to the farmer (for TFGrid 3.0, can change later).
All the data of the farmer and the 3nodes are registered on TFChain
- See [Roadmap TFChain/DAO 3.x](roadmap_tfchain3) for info of implementation.

View File

@@ -0,0 +1,43 @@
## Consensus 3.X Oracles used
Oracles are external resources of information.
The TFChain captures and holds that information so we get more certainty about the accuracy.
We have oracles for price & reputation for e.g. TFFarmers and TFNodes.
These oracles are implemented on TF_CHAIN for TFGrid 3.0.
```mermaid
graph TB
subgraph Digital Currency Ecosystem
money_blockchain[Money Blockchain Explorers]
Exch1[Money Blockchain Decentralized Exchange]
OracleEngine --> Exch1[Polkadot]
OracleEngine --> Exch1[Money Blockchain Exchange]
OracleEngine --> Exch2[Binance Exchange]
OracleEngine --> Exch3[other... exchanges]
end
subgraph ThreeFold Grid
Monitor_Engine --> TFNode1
Monitor_Engine --> TFNode2
Monitor_Engine --> TFNode3
end
subgraph TFChainNode1[TFGrid Blockchain Node]
Monitor_Engine
Explorers[TFChain Explorers]-->TFGridDB --> BCNode
Explorers --> BCNode
ConsensusEngine1-->BCNode[Blockchain Validator Node]
ConsensusEngine1 --> money_blockchain[Money Blockchain]
ConsensusEngine1 --> ReputationEngine[Reputation Engine]
ReputationEngine --> Monitor_Engine[Monitor Engine]
ConsensusEngine1 --> OracleEngine[Oracle For Pricing Digital Currencies]
end
```
- See [Roadmap TFChain/DAO 3.x](roadmap_tfchain3) for info of implementation.

View File

@@ -0,0 +1,51 @@
```mermaid
graph TB
subgraph Money Blockchain
money_blockchain --> account1
money_blockchain --> account2
money_blockchain --> account3
click money_blockchain "/threefold/#money_blockchain"
end
subgraph TFChainNode1[TFChain BCNode]
Explorer1-->BCNode1
ConsensusEngine1-->BCNode1
ConsensusEngine1 --> money_blockchain
ConsensusEngine1 --> ReputationEngine1
ReputationEngine1 --> Monitor_Engine1
click ReputationEngine1 "/info/threefold/#reputationengine"
click ConsensusEngine1 "/info/threefold/#consensusengine"
click BCNode1 "/info/threefold/#bcnode"
click Explorer1 "/info/threefold/#tfexplorer"
end
subgraph TFChainNode2[TFChain BCNode]
Explorer2-->BCNode2
ConsensusEngine2-->BCNode2
ConsensusEngine2 --> money_blockchain
ConsensusEngine2 --> ReputationEngine2
ReputationEngine2 --> Monitor_Engine2
click ReputationEngine2 "/info/threefold/#reputationengine"
click ConsensusEngine2 "/info/threefold/#consensusengine"
click BCNoBCNode2de1 "/info/threefold/#bcnode"
click Explorer2 "/info/threefold/#tfexplorer"
end
Monitor_Engine1 --> TFNode1
Monitor_Engine1 --> TFNode2
Monitor_Engine1 --> TFNode3
Monitor_Engine2 --> TFNode1
Monitor_Engine2 --> TFNode2
Monitor_Engine2 --> TFNode3
click TFNode1 "/info/threefold/#3node"
click TFNode2 "/info/threefold/#3node"
click TFNode3 "/info/threefold/#3node"
click Monitor_Engine1 "/info/threefold/#monitorengine"
click Monitor_Engine2 "/info/threefold/#monitorengine"
```
*click on the parts of the image, they will go to more info*
- See [Roadmap TFChain/DAO 3.x](roadmap_tfchain3) for info of implementation.

View File

@@ -0,0 +1,45 @@
# Consensus Mechanism
## Blockchain node components
- A Blockchain node (= TFChain node) called TF-Chain, containing all entities interacting with each other on the TF-Grid
- An explorer = a Rest + GraphQL interface to TF-Chain (Graphql is a nice query language to make it easy for everyone to query for info)
- Consensus Engine
- is a Multisignature Engine running on TF-Chain
- The multisignature is done for the Money BlockchainAccounts
- It checks the AccountMetadata versus reality and if ok, will sign, which allows transactions to happen after validation of the "smart contract"
- SLA & reputation engine
- Each node uptime is being checked by Monitor_Engine
- Also bandwidth will be checked in the future (starting 3.x)
### Remarks
- Each Monitor_Engine checks uptime of X nr of nodes (in beginning it can do all nodes), and stores the info in local DB (to keep history of check)
- [Roadmap for TFChain deployment mechanism](roadmap_tfchain3)
## Principle
- We keep things as simple as we can
- Money Blockchain blockchain used to hold the money
- Money Blockchain has all required features to allow users to manage their money like wallet support, decentralized exchange, good reporting, low transaction fees, ...
- TFChain based TFChain is holding the metadata for the accounts which express what we need to know per account to allow the start contracts to execute.
- Smart Contracts are implemented using multisignature feature on Money Blockchain in combination with Multi Signature done by Consensus_Engine.
- on money_blockchain:
- each user has Money BlockchainAccounts (each of them holds money)
- there are normal Accounts (means people can freely transfer money from these accounts) as well as RestrictedAccounts. Money cannot be transfered out of RestrictedAccounts unless consensus has been achieved from ConsensusEngine.
- Restricted_Account
- On stellar we use the multisignature feature to make sure that locked/vesting or FarmingPool cannot transfer money unless consensus is achieved by the ConsensusEngine
- Each account on money_blockchain (Money BlockchainAccount) has account record in TFChain who needs advanced features like:
- lockup
- vesting
- minting (rewards to farmers)
- tfta to tft conversion
- The Account record in TFGrid_DB is called AccountMetadata.
- The AccountMetadata describes all info required to be able for consensus engine to define what to do for advanced features like vesting, locking, ...
- See [Roadmap TFChain/DAO 3.x](roadmap_tfchain3) for info of implementation.

View File

@@ -0,0 +1,14 @@
## Consensus Engine Information
- [Consensus Engine Homepage](consensus3)
- [Principles TFChain 3.0 Consensus](consensus3_principles)
- [Consensus Engine Farming 3.0](consensus3_engine_farming)
- [TFGrid 3.0 wallets](tfgrid3_wallets)
- Architecture:
- [Money Blockchains/TFChain architecture](money_blockchain_partity_link)
- [ThreeFold Chain Oracles](consensus3_oracles)
<!-- - [Consensus Engine Weight System](consensus3_weights) -->
> implemented in TFGrid 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -0,0 +1,52 @@
## Link between different Money Blockchain & TFChain
TF-Chain is the ThreeFold blockchain infrastructure, set up in the TFChain framework.
We are building a consensus layer which allows us to easily bridge between different money blockchains.
Main blockchain for TFT remains the Stellar network for now. A secure bridging mechanism exists, able to transfer TFT between the different blockchains.
Active bridges as from TFGrid 3.0 release:
- Stellar <> Binance Smart Chain
- Stellar <> Parity TFChain
More bridges are under development.
```mermaid
graph TB
subgraph Money Blockchain
money_blockchain --- account1a
money_blockchain --- account2a
money_blockchain --- account3a
account1a --> money_user_1
account2a --> money_user_2
account3a --> money_user_3
click money_blockchain "/info/threefold/#money_blockchain"
end
subgraph ThreeFold Blockchain On Parity
TFBlockchain --- account1b[account 1]
TFBlockchain --- account2b[account 2]
TFBlockchain --- account3b[account 3]
account1b --- smart_contract_data_1
account2b --- smart_contract_data_2
account3b --- smart_contract_data_3
click TFBlockchain "/info/threefold/#tfchain"
end
account1b ---- account1a[account 1]
account2b ---- account2a[account 2]
account3b ---- account3a[account 3]
consensus_engine --> smart_contract_data_1[fa:fa-ban smart contract metadata]
consensus_engine --> smart_contract_data_2[fa:fa-ban smart contract metadata ]
consensus_engine --> smart_contract_data_3[fa:fa-ban smart contract metadata]
consensus_engine --> account1a
consensus_engine --> account2a
consensus_engine --> account3a
click consensus_engine "/info/threefold/#consensus_engine"
```
Above diagram shows how our consensus engine can deal with TFChain and multiple Money Blockchains at same time.

View File

@@ -0,0 +1,53 @@
# Roadmap For our TFCHain and ThreeFold DAO
![](img/limitedsupply_.png)
## TFChain / DAO 3.0.2
For this phase our TFChain and TFDAO has been implemented using parity/TFChain.
Features
- poc
- pou
- identity management
- consensus for upgrades of DAO and TFChain (code)
- capacity tracking (how much capacity used)
- uptime achieved
- capacity utization
- smart contract for IT
- validators for L1 (TFChain level)
- storage of value = TFT
- request/approval for adding a validator
Basically all basic DAO concepts are in place
## TFChain / DAO 3.0.x
TBD version nr, planned Q1 2022
NEW
- proposals for TFChain/DAO/TFGrid changes (request for change) = we call them TFCRP (ThreeFold Change Request Proposal)
- voting on proposals = we call them TFCRV (ThreeFold Change Request Vote)
## TFChain / DAO 3.1.x
TBD version nr, planned Q1 2022
This version adds more layers to our existing DAO and prepares for an even more scalable future.
NEW
- Cosmos based chain on L2
- Validator Nodes for TFGrid and TFChain.
- Cosmos based HUB = security for all TFChains
> More info about our DAO strategy see TFDAO.

View File

@@ -0,0 +1,72 @@
# TFGrid 3.0 Wallets
ThreeFold has a mobile wallet which will allow to be used on the TFChain backend (TFChain) as well as any other Money Blockchain it supports.
This provides for a very secure digital currency infrastructure with lots of advantages.
- [X] ultra flexible smart contracts possible
- [X] super safe
- [X] compatible with multiple blockchains (money blockchains)
- [X] ultra scalable
```mermaid
graph TB
subgraph Money Blockchain
money_blockchain[Money Blockchain Explorers]
money_blockchain --- money_blockchain_node_1 & money_blockchain_node_2
money_blockchain_node_1
money_blockchain_node_2
end
subgraph ThreeFold Wallets
mobile_wallet[Mobile Wallet]
desktop_wallet[Desktop Wallet]
mobile_wallet & desktop_wallet --> money_blockchain
mobile_wallet & desktop_wallet --> Explorers
money_blockchain_wallet[Any Money Blockchain Wallet] --> money_blockchain
end
subgraph TFChain[TFGrid Blockchain on TFChain]
Explorers[TFChain Explorers]-->TFGridDB --> BCNode
Explorers --> BCNode
end
```
Generic overview:
```mermaid
graph TB
subgraph TFChain[TFGrid Chain]
guardian1[TFChain Node 1]
guardian2[TFChain Node 2]
guardian3[TFChain Node 3...9]
end
User_wallet[User Wallet] --> money_blockchain_account
User_wallet[User Wallet] --> money_blockchain_restricted_account
subgraph Money Blockchain Ecosystem
money_blockchain_account
money_blockchain_restricted_account --- guardian1 & guardian2 & guardian3
end
subgraph consensus[Consensus Layer on TFChain]
guardian1 --> ReputationEngine & PricingOracle
guardian1 --> contract1[Smart Contract Vesting]
guardian1 --> contract2[Smart Contract Minting/Farming]
end
```

View File

@@ -0,0 +1,52 @@
// - vesting
// - startdate: epoch
// - currency: USD
// - [[$month_nr,$minprice_unlock,$TFT_to_vest],...]
// - if 48 months then list will have 48 parts
// - month 0 = first month
// - e.g. [[0,0.11,10000],[1,0.12,10000],[2,0.13,10000],[3,0.14,10000]...]
//information stored at account level in TFGridDB
struct AccountMeta{
//corresponds to unique address on money_blockchain
money_blockchain_address string
vesting Vesting[]
unlocked_TFT int
}
struct Vesting{
startdate int
//which currency is used to execute on the acceleration in the vesting
//if price above certain level (which is currency + amount of that currency) the auto unlock
currency CurrencyEnum
months []VestingMonth
}
struct VestingMonth{
month_nr int
//if 0 then will not unlock based on price
unlock_price f32
tft_amount int
}
enum CurrencyEnum{
usd
eur
egp
gbp
aed
}
//this is stored in the TFGridDB
fn (mut v AccountMeta) serialize() string{
//todo code which does serialization see above
return ""
}
//write minting pool
//REMARKS
// if unlock triggered because of month or price then that record in the VestingMonth[] goes away and TFT go to unlocked_TFT