Signature construction
To interact with the system, your users must send messages containing orders they want to execute. The following order types are currently supported:
WithdrawalToAddress
|
(StarkEx Perpetual v2.0) Withdrawal to a specific L1 address. Requests collateral to move from the L2 state to L1. |
Withdrawal
|
(StarkEx Perpetual v1.0) Requests collateral to move from the L2 state to L1. |
Liquidate
|
Limit order with fees, declares intent to sell a certain amount of a certain asset in exchange for a different asset at a certain ratio. One of the assets must be the collateral. |
Transfer
|
Transfer, requests collateral to be transferred from one vault to another. |
ConditionalTransfer
|
Conditional transfer, requests collateral to be transferred from one vault to another if some on-chain event is recorded. |
The transaction is sent directly to the application through an interface exposed there, and the validity of the signature over all the fields is verified by the proof system.
For information on using the corresponding APIs for these transaction types, see Transactions in the StarkEx Perpetual v2.0 REST API reference.
WithdrawalToAddress
(StarkEx Perpetual v2.0)
Signature construction
Where:
ECDSA is the regular elliptic curve digital signature algorithm, \$H\$ is the Pedersen hash function, and \$w_{1-n}\$ are 252-bit words.
Parameters
\$k_{private}\$ |
The user’s private key |
||||||||||||
\$w_1\$ |
The withdrawn |
||||||||||||
\$w_2\$ |
The destination L1 address. |
||||||||||||
\$w_3\$ |
Defined as follows: +----+--------------+----------+--------------+------- --+------------+ #bits | 10 | 64 | 32 | 64 | 32 | 49 | +----+--------------+----------+--------------+------ ---+------------+ label A B C D E F Where:
|
Withdrawal
(StarkEx Perpetual v1.0 only)
Signature construction
Where:
ECDSA is the regular elliptic curve digital signature algorithm, \$H\$ is the Pedersen hash function, and \$w_{1-n}\$ are 252-bit words.
Parameters
\$k_{private}\$ |
The user’s private key |
||||||||||||
\$w_1\$ |
The withdrawn |
||||||||||||
\$w_5\$ |
Defined as follows: +----+----------------+---------+---------+---------+------------+ #bits | 10 | 64 | 32 | 32 | 32 | 49 | +----+----------------+---------+---------+---------+------------+ label A B C D E F Where:
|
Liquidate
(Limit order with fees)
Signature construction
Where:
ECDSA is the regular elliptic curve digital signature algorithm, \$H\$ is the Pedersen hash function, and \$w_{1-n}\$ are 252-bit words.
Parameters
\$k_{private}\$ |
The user’s private key. |
||||||||||||
\$w_1\$ |
The |
||||||||||||
\$w_2\$ |
The |
||||||||||||
\$w_3\$ |
The |
||||||||||||
\$w_4\$ |
Defined as follows: +-------+--------------+--------------+--------------+--------+ #bits | 27 | 64 | 64 | 64 | 32 | +-------+--------------+--------------+--------------+--------+ label A B C D E Where:
|
||||||||||||
\$w_5\$ |
Defined as follows: +---+--------------+--------------+--------------+-----+-----+ #bits | 10| 64 | 64 . | 64 | 32 | 17 | +---+--------------+--------------+--------------+-----+-----+ label A B C D E F Where:
|
Transfer
Signature construction
Where:
ECDSA is the regular elliptic curve digital signature algorithm, \$H\$ is the Pedersen hash function, and \$w_{1-n}\$ are 252-bit words.
Parameters
\$w_1\$ |
The |
||||||||||
\$w_2\$ |
The |
||||||||||
\$w_3\$ |
The |
||||||||||
\$w_4\$ |
Defined as follows: +-------+--------------+--------------+--------------+--------+ #bits | 27 | 64 | 64 . | 64 | 32 | +-------+--------------+--------------+--------------+--------+ label A B C D E Where:
|
||||||||||
\$w_5\$ |
Defined as follows: +---+--------------+--------------+--------+-----------------+ #bits | 10| 64 | 64 | 32 | 81 | +---+--------------+--------------+--------+-----------------+ label A B C D E Where:
|
||||||||||
\$w_6\$ |
is the |
ConditionalTransfer
Signature construction
Where:
ECDSA is the regular elliptic curve digital signature algorithm, \$H\$ is the Pedersen hash function, and \$w_{1-n}\$ are 252-bit words.
Parameters
\$w_1\$ |
The |
||||||||||
\$w_2\$ |
The |
||||||||||
\$w_3\$ |
The |
||||||||||
\$w_4\$ |
Defined as follows: +-------+--------------+--------------+--------------+--------+ #bits | 27 | 64 | 64 . | 64 | 32 | +-------+--------------+--------------+--------------+--------+ label A B C D E Where:
|
||||||||||
\$w_5\$ |
Defined as follows: +---+--------------+--------------+--------+-----------------+ #bits | 10| 64 | 64 | 32 | 81 | +---+--------------+--------------+--------+-----------------+ label A B C D E Where:
|
||||||||||
\$w_6\$ |
is the |