Skip to content

data availability design #144

@lispc

Description

@lispc

The meaning of 'data availability' is to enable proving account has balance of token in the tree. So order details are not needed.

SpotTrade:

AccountID1 4bytes
AccountID2 4bytes
tokenID_1to2 2bytes
tokenID_2to1 2bytes
Amount1to2 3bytes
Amount2to1 3bytes
// NewAccount1OrderRoot 
// NewAccount2OrderRoot
// although hash root is only 1 field element, it consumes many bytes in fact. So we prefer use original data
Order1Pos 2bytes
Order1ID 4bytes
Order1BuyAmount 3bytes
Order1SellAmount 3bytes
// Order1SellFilled 
// Order1BuyFilled
.. and for order2 ..

So total 42 bytes.

DepositToOld:

AccountID1 4bytes
tokenID1 2bytes
Amount1 3bytes

DepositToNew

AccountID1 4bytes
tokenID1 2bytes
Amount1 3bytes
ethAddr: 20bytes
sign 1bit
ay field: 32 bytes

total: 61bytes

Transfer

AccountID1 4bytes
AccountID2 4bytes
tokenID2bytes
Amount 3bytes

Withdraw

AccountID1 4bytes
tokenID1 2bytes
Amount1 3bytes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions