-
Notifications
You must be signed in to change notification settings - Fork 4
/
taxi.proto
54 lines (48 loc) · 2.35 KB
/
taxi.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
syntax = "proto3";
package taxi;
option go_package = "github.com/vulpemventures/taxi-protobuf/generated/go/taxi";
import "google/api/annotations.proto";
service Taxi {
// ListAssets rpc returns a subset of supported elements assets that could be accepted as payment
// for topups
rpc ListAssets(ListAssetsRequest) returns (ListAssetsReply) {
option (google.api.http) = {
get: "/v1/assets"
};
}
// TopupWithAsset rpc returns a transaction (pset) with a LBTC input and a payout with defined asset fot taxi.
// The transaction is signed with SIGHASH_SINGLE | ANYONECANPAY
rpc TopupWithAsset(TopupWithAssetRequest) returns (TopupWithAssetReply) {
option (google.api.http) = {
post: "/v1/asset/topup"
body: "*"
};
}
}
message ListAssetsRequest {}
message ListAssetsReply {
repeated AssetDetails assets = 1; // all the assets available for topups
}
message TopupWithAssetRequest {
string asset_hash = 1; // asset hash to be used for payout
uint64 fee_amount = 2; // amount in satoshis of bitcoin needed to cover the fees. It's up to the client to estimate and ask the precise amount
uint64 millisat_per_byte = 3; // how many millisatoshi per byte we want to spend. ie. 0.1 sat/byte is 100
}
message TopupWithAssetReply {
Topup topup = 1; // The Topup message
uint64 expiry = 2; // the unix timestamp after wich the locked LBTC input will provably be double-spent
string private_blinding_key = 3; // the hex encoded blinding private key of the locked LBTC input
string public_blinding_key = 4; // the hex encoded blinding public key of the pay to taxi output
}
message Topup {
string topup_id = 1; // random identifier of the current topup
string partial = 2; // PSET signed with SIGHASH_SINGLE | ANYONECANPAY
string asset_hash = 3; // the asset hash used as payout for bitcoin fees
uint64 asset_amount = 4; // the asset denominated amount expressed in satoshis to be used as payout. It includes also the spread as taxi service fee
uint64 asset_spread = 5; // the spread amount expressed in asset denominated satoshis used to pay the taxi service fees
}
message AssetDetails {
string asset_hash = 1; // the asset hash used as identifier on the network
uint32 basis_point = 2; // the taxi service fee expressed in basis points for the given asset
float asset_price = 3; // the price = the amount of assets to equal 1 BTC
}