https://docs.google.com/document/d/1vjSUCF3JNEE1dFNs-SGLwQcXJR0pg0q3FzQwvlW7nvc
Authors: @nicola, @zenground0
Demo (soon): https://github.com/ZenGround0/onramp-contracts
The goals of this projects are:
This set of protocols are designed to make sure that the User can delegate their data and client making to third parties.
Note the client can also be the buffer and the agent, for simplicity and more modularity we divide their roles here.
sequenceDiagram
autonumber
participant Client
participant Agent
participant Buffer
participant MarketOffchain
participant SP
participant MinerActor
participant FilecoinBridgeActor
participant Bridge
alt Deal delegation
Client -->> Agent: EnageAgent (deal)
end
alt Buffer delegation
Agent -->> Buffer: StoreDeal (deal)
Client -->> Buffer: UploadDealData (piece)
end
This set of protocols make the agent advertise the deal so that storage providers can commit to store it, store it into Filecoin and then using the bridge, show that the data has been stored.
This protocol only guarantees that the data has been stored, not that it is continuosly stored. (This is an equivalent to an HTTP POST)
sequenceDiagram
autonumber
participant Client
participant Agent
participant Buffer
participant MarketOffchain
participant SP
participant MinerActor
participant FilecoinBridgeActor
participant Bridge
alt Piece advertise
Agent ->> MarketOffchain: AdvertiseDeal(deal)
end
alt Piece selection
SP -->> MarketOffchain: GetDeals ()
SP ->> MarketOffchain: PickDeals()
SP -->> Buffer: GetPiece (deal)
SP ->> MarketOffchain: CommitDeals (deal), lock X
end
alt Filecoin Storage
SP -->> SP: generateCommD(CommD) -> PoDSI
SP ->> MarketOffchain: UpdateDeal(PoDSI)
SP ->> MinerActor: ProveSector()
end
opt Bridge confirmation
SP ->> FilecoinBridgeActor: Stored(podsi.root)
FilecoinBridgeActor ->> Bridge: AnnounceDealStored(deal)
Bridge ->> MarketOffchain: DealStored(deal)
end
This protocol makes sure that if the data is not stored, the agent can read Filecoin L1 and report this back into the offchain market.
sequenceDiagram
autonumber
participant Client
participant Agent
participant Buffer
participant MarketOffchain
participant SP
participant MinerActor
participant FilecoinBridgeActor
participant Bridge
opt Optional: Agent reporting failed deals
Agent ->> FilecoinBridgeActor: Complain(podsi.root) -> proof
FilecoinBridgeActor ->> Bridge: Complaint
Bridge ->> MarketOffchain: ComplaintSucceeded
end
We will not work on the following
sequenceDiagram
Client ->> Agent: Sign (deal)
Agent ->> Buffer: Store (deal)
Client ->> Buffer: Upload (piece)
Agent ->> MarketOffchain: Advertise(deal)
SP -->> MarketOffchain: GetDeals ()
SP ->> MarketOffchain: PickDeals()
SP ->> Buffer: GetPiece (deal)
SP ->> MarketOffchain: Commit (deal), lock X
SP -->> SP: generate(CommD)
SP ->> MarketOffchain: PoDSI
SP ->> MinerActor: ProveSector()
alt if the SP doesn't ProveSector
Agent ->> FilecoinOracle: RequestSectorState(podsi.root) -> proof
Agent ->> MarketOffchain: Complain(commit, proof)
end
sequenceDiagram
Client ->> MarketOnchain: lock tokens
Client ->> Agent: Sign (deal)
Agent ->> Buffer: Store (deal)
Client ->> Buffer: Upload (piece)
Agent ->> MarketOffchain: Advertise(deal)
SP -->> MarketOffchain: GetDeals ()
SP ->> MarketOffchain: PickDeals()
SP ->> Buffer: GetPiece (deal)
SP ->> MarketOffchain: Commit (deal)
SP ->> MarketOnchain: lock X, commitment
SP -->> SP: generate(CommD)
SP ->> MarketOffchain: PoDSI
SP ->> MinerActor: ProveSector()
alt if the SP doesn't ProveSector
Agent ->> MarketOnchain: Complain(commit)
end
Where do operations happen?
Who verifies the deal of the correctness of the data structure?
We decided that deals are publicly verifiable deals
Bridges vs Oracle
If we could replace the message passing (Axelar) with an oracle (Axiom), then any small chain/l2 not supported by Axelar will work.
Ideally we design for oracles and not for bridges.
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing