Skip to content

Commit

Permalink
Update marketplace.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jimstir authored Apr 30, 2024
1 parent 9aa7f04 commit 3a7a30b
Showing 1 changed file with 48 additions and 26 deletions.
74 changes: 48 additions & 26 deletions codex/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,46 @@ a storage contract is opened on the marketplace via the blockchain, and
storage nodes can then decide to store the data.
The requester SHOULD initiate the contract with the following:

```protobuf
requestStorage {
// content identifier
byte cid = 1
// Tokens from the requester to reward storage nodes
byte reward = 2
// Amount of tokens required for collateral by storage nodes
byte collateral = 3
// Frequency that proofs are checked by validator nodes
```nim
proc requestStorage (): {} =
# content identifier
byte32 cid = 1
# Tokens from the requester to reward storage nodes
UInt256 reward = 2
# Amount of tokens required for collateral by storage nodes
UInt256 collateral = 3
# Frequency that proofs are checked by validator nodes
byte proofProbability = 4
//
proofParameters = 5
// Amount of desired time for stoageRequest
uint64 duration = 6
//The requester can choose amount of spreading of data to storage nodes
dispersal = 7
//
repair = 8
// Number of storage hosts
uint nodes = 9
//
uint tolerance = 10
// Timeout set for slots to be filled
expire = 11
# Amount of desired time for stoageRequest
UInt256 duration = 5
# The requester can choose amount of spreading of data to storage nodes
dispersal = 6
# Number of storage hosts
uint nodes = 7
#
uint tolerance = 8
# Timeout set for slots to be filled
UInt256 expire = 9
}
```

`cid`
- MUST be a sha2-256 hash (length 32 bytes, base58) of the data being stored
- MUST be generated by the requester, or regular node

`reward`
- SHOULD be token known to the network.
- it MUST be paid directly to storage nodes that agree to contract

`collateral`

All storage nodes MUST provide token collateral before being able to fullfill a storage contract.
The collateral will taken to punish the storage node when that node does not follow the contract.
The collateral will be taken to punish a storage node when it does not follow the contract.
The following conditions MUST be fullfilled in a Codex storage contract
- failing to provide proofs periodically, the RECOMMENDED method for proofs is [Proof-of-Data-Possession](https://hackmd.io/2uRBltuIT7yX0CyczJevYg?view).
- failing to provide proof of storage periodically, the RECOMMENDED method for proofs is [Proof-of-Data-Possession](https://hackmd.io/2uRBltuIT7yX0CyczJevYg?view).
- a portion of `collateral` MUST be offered as rewards vaildator nodes,
and a portion SHOULD be offered as reward to storage nodes that repair [slots](##slots)

Expand All @@ -89,4 +88,27 @@ and a portion SHOULD be offered as reward to storage nodes that repair [slots](#


### Slots
After a storage request is made,
the requester's Codex node will create slots from the blocks that are generated from the `cid`.
Each slot will contain a sub-block of the data being stored.
- Storage Nodes MUST provide token collateral

-----------

proof & proof &
collateral proof missed collateral missed
| | | | |
v v v v v
-------------------------------------------------------------------
slot: |///////////////////////| |////////////////////|
-------------------------------------------------------------------
| |
v v
collateral collateral
lost lost



---------------- time ---------------->


0 comments on commit 3a7a30b

Please sign in to comment.