OBD Websocket Reference
Welcome to the Websocket API reference documentation for OmniBOLT Daemon (OBD), the daemon that communicates with light clients written in any program languages that support websocket connection, such as javascript, golang, shell or even C/C++. OBD runs as an independent process connecting to a full node of OmniCore(version 0.18 or later), which provides the on chain settlement service for OmniBOLT. And current OBD implementation is deeply binded to OmniCore.
We assume you have already gone through our installation instruction, so that you are familar with:
- Pulling source code and compile to get obdserver;
- Configuring OmniCore node for OBD;
- Connecting OBD with Omnicore correctly;
- Using GUI tool to test all functions of OBD, OR
- Using a simple web based websocket client for Chrome to do experiments;
- OBD responses you correctly;
For kernel developers in our community, the above steps are the easiest way to get started. Just run the GUI tool and open OmniBOLT Daemon project with your favorit golang editor, run OBD in debug mode, setup break points, and send messages from GUI tool. You may intercept the messages and track message flows of OBD kernel.
Client JS SDK is also released with the GUI tool. This SDK implements APIs in this document, especially the internal HD functions managing pub/priv keys generation. This SDK and is for wallet developers to easily integrate. Also it helps developers automatically fill in the arguments which is hardly to be manually finished.
wsWallet
Wallet is the first place that a client begin to work with an obd instance. User can initiate a local obd instance or connect to a remote one. The first step is to generate mnemonic code to identify yourself in the network using genMnemonic. Once the code is obtained by the user, then channel addresses, pub/priv key pairs will all be generated by it. The wallet is created.
genMnemonic
Simple Type -102004 Protocol
Mode 1 local OBD:
Type -102004 Protocol is used to sign up a new user by hirarchecal deterministic wallet system integrated in OBD. OBD returns mnemonic words to the client who signs up, and create a new user by the hash of the mnemonic words as the UserID.
Mode 2 remote OBD that is not trusted (currently using as a SDK function):
In this mode, this Protocol requires to generate mnemonic words using BIP32 on local device. Clients, e.g wallets, interacting with obd shall implement this HD mechanism for security guarantees. Mnemonic words shall be kept in a local safe place, and never be shared with any OBD instances.
Websocket Request: Message Type -102004
GenSeed request:
{
"type":-102004
}
This request has no parameters.
Websocket Response: Message Type -102004
Client SDK returns:
{
"type":-102004,
"status":true,
"from":"c2215a60-8b81-439f-8cb3-11ba51691076",
"to":"c2215a60-8b81-439f-8cb3-11ba51691076",
"result":"two ribbon knee leaf easy pottery hobby pony mule test bridge liar sand mirror decline gasp focus this park undo rough cricket portion ignore"
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | socket id generated when establishing a websocket connection. |
to | ------- | body | socket id generated when establishing a websocket connection. |
result | ------- | body | mnemonic words. |
wsLogIn
Simple Type -102001 Protocol
Type -102001 Protocol is used to login to OBD.
Websocket Request: Message Type -102001
Login request:
{
"type":1,
"data":{
"mnemonic":"< mnemonic words generated by obd or client library >"
}
}
Parameter | default | placement | Description |
---|---|---|---|
mnemonic | ------- | data | mnemonic words generated by OBD |
Websocket Response: Message Type -102001
OBD Responses:
{
"type":-102001,
"status":true,
"from":"7da8d2441e0ad67040a274902f1965ee1a5c3fdd86f1ddc3280eda5230e006f2",
"to":"all",
"result":"7da8d2441e0ad67040a274902f1965ee1a5c3fdd86f1ddc3280eda5230e006f2 login"
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | A SHA256 string of mnemonic words as the peer id |
to | ------- | body | to whom should know the login of this peer |
result | ------- | body | response data from OBD |
wsConnectPeer
Simple Type -102003
Establish a p2p connection with a remote OBD.
Websocket Request: Message Type -102003
Request:
{
"type":-102003,
"data":{
"remote_node_address":"/ip4/62.234.216.108/tcp/3001/p2p/Qmdqwooq9Ab7Bry1NT3bgbrj2i57ugEKZwoZTGPLiKnMF8"
}
}
Parameter | default | placement | Description |
---|---|---|---|
remote_node_address | ------- | body | node address of the OBD. |
connectToServer
Connect to an OBD.
Request:
{
"data":{
"obd_address":"ws://62.234.216.108:60020/wstest"
}
}
Parameter | default | placement | Description |
---|---|---|---|
obd_address | ------- | body | an OBD address. |
genAddressFromMnemonic
Simple Type -103000 Protocol (currently using as a SDK function)
Type -103000 Protocol generates a new address from mnemonic words. This message requires to generate address on local device from mnemonic words using BIP32. Clients interacting with obd, e.g wallets, shall implement this HD mechanism for security guarantees. Mnemonic words shall be kept in a safe place, and never be shared with any obd instances.
Request: Message Type -103000
Requests:
{
"type": -103000
}
This message has no arguments.
Response: Message Type -103000
Responses:
{
"type":-103000,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"result":{
"address":"mfstT4mnj9AsT6XRKf6MWbFC2Ae99oMJf6",
"index":0,
"private_key":"0c379ade77ceefbc2b54ee76bab7d483a4dd37ebb8a3fc6f91ae6d01e2084bc5",
"pub_key":"03c285a23081ea778b38e4fa4e870a9a2c0de2b526f6c915a62091bbe0e5b2c50d",
"wif":"cMzT53SEiF1PkoJaxp44pA8yhLFkqbRc9AWRZDyBTmHgnipdJ8zs"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
address | ------- | result | The newly generated wallet address |
index | ------- | result | number of generated sort |
private_key | ------- | result | private key of address |
pub_key | ------- | result | public key of address |
wif | ------- | result | other format private key of address |
Basic Lightning Network Operations
wsOpenChannel
Simple Type -100032 Protocol
Type -100032 Protocol is used to request to create a channel with someone else(Bob).
Alice sends request to her OBD instance, her OBD helps her complete the message, and routes her request to Bob's OBD for creating a channel between them.
Websocket Request: Message Type -100032
Request:
{
"type":-100032,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"funding_pubkey":"02c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66",
"is_private":false
}
}
Parameter | default | placement | Description |
---|---|---|---|
recipient_node_peer_id | ------- | body | peer id of the obd node where the fundee logged in. |
recipient_user_peer_id | ------- | body | the user id of the fundee. |
funding pubkey | ------- | data | public key of funder, who wish to deposite BTC and other tokens to the channel |
is_private | ------- | data | true to private channel or false to open channel. |
Websocket Response: Message Type -100032
OBD Response:
{
"type":-100032,
"status":true,
"from":"<user_id>",
"to":"<user_id>",
"result":
{
"chain_hash":"1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P",
"channel_reserve_satoshis":0,
"delayed_payment_base_point":"",
"dust_limit_satoshis":0,
"fee_rate_per_kw":0,
"funding_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
"funding_pubkey":"021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d",
"funding_satoshis":0,
"htlc_base_point":"",
"htlc_minimum_msat":0,
"max_accepted_htlcs":0,
"max_htlc_value_in_flight_msat":0,
"payment_base_point":"",
"push_msat":0,
"revocation_base_point":"",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"to_self_delay":0
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | peer id of funder |
to | ------- | body | peer id of fundee |
chain_hash | ------- | result | identify the public chain. Default is OmniLayer's address: 1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P |
channel_reserve_satoshis | ------- | result | reserved satoshis in the channel |
delayed_payment_base_point | ------- | result | |
dust_limit_satoshis | ------- | result | |
fee_rate_per_kw | ------- | result | |
funding_address | ------- | result | Funder's address from where he send money to the channel |
funding_pubkey | ------- | result | public key of funder, who wish to deposite BTC and other tokens to the channel |
funding_satoshis | ------- | result | |
htlc_base_point | ------- | result | |
htlc_minimum_msat | ------- | result | |
max_accepted_htlcs | ------- | result | |
max_htlc_value_in_flight_msat | ------- | result | |
payment_base_point | ------- | result | |
push_msat | ------- | result | |
revocation_base_point | ------- | result | |
temporary_channel_id | ------- | result | |
to_self_delay | ------- | result |
acceptChannel
Simple Type -100033 Protocol
Bob replies to accept, his OBD completes his message and routes it back to Alice's OBD. Then Alice sees the response of acceptance.
Websocket Request: Message Type -100033
Request:
{
"type":-100033,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2 ",
"data":{
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"funding_pubkey":"028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e",
"approval":true
}
}
Parameter | default | placement | Description |
---|---|---|---|
temporary_channel_id | ------- | data | the temporary channel id, used before real funding completes. |
funding pubkey | ------- | data | public key of fundee(Bob), who wish to deposite BTC and other tokens to the channel. Current implementation of OBD supports one-way deposite. Fundee does not need to fund the channel. |
approval | ------- | data | true to accept or false to deny. |
Websocket Response: Message Type -100033
OBD Responses:
{
"type":-100033,
"status":true,
"from":"<user_id>",
"to":"<user_id>",
"result":
{
"accept_at":"2019-09-21T00:06:48.634265+08:00",
"address_a":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
"address_b":"myHRPQWTQ1yYbj7vr7raBW59CTeAFEsUXY",
"chain_hash":"1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P",
"channel_address":"2N1DFjaE4yCcECdFwgLQcLmNrLV5zetgQtE",
"channel_address_redeem_script":"5221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952ae",
"channel_address_script_pub_key":"a9145761a1d45b8a6e7caa10a4bcecca97630c67af4687",
"channel_id":"",
"channel_reserve_satoshis":0,
"close_at":"0001-01-01T00:00:00Z",
"create_at":"2019-09-21T00:05:25.667117+08:00",
"create_by":"alice",
"curr_state":20,
"delayed_payment_base_point":"",
"dust_limit_satoshis":0,
"fee_rate_per_kw":0,
"funding_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
"funding_pubkey":"021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d",
"funding_satoshis":0,
"htlc_base_point":"",
"htlc_minimum_msat":0,
"id":2,
"max_accepted_htlcs":0,
"max_htlc_value_in_flight_msat":0,
"payment_base_point":"",
"peer_id_a":"alice",
"peer_id_b":"bob",
"pub_key_a":"021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d",
"pub_key_b":"03efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce9",
"push_msat":0,
"revocation_base_point":"",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"to_self_delay":0
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | peer id of funder |
to | ------- | body | peer id of fundee |
accept_at | ------- | result | time of acceptance |
address_a | ------- | result | address of Alice |
address_b | ------- | result | address of Bob |
chain_hash | ------- | result | identify the public chain. Default is OmniLayer's address: 1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P |
channel_address | ------- | result | the p2whk address of the channel |
channel_address_redeem_script | ------- | result | redeem script of the multi-sig address |
channel_address_script_pub_key | ------- | result | the script pubkey |
channel_id | ------- | result | the global unique channel id |
channel_reserve_satoshis | ------- | result | reserved satoshis in the channel |
close_at | ------- | result | close time |
create_at | ------- | result | create time |
create_by | ------- | result | the funder who created this channel. Alice in this case. |
curr_state | ------- | result | |
delayed_payment_base_point | ------- | result | |
dust_limit_satoshis | ------- | result | |
fee_rate_per_kw | ------- | result | |
funding_address | ------- | result | Funder's address from where he send money to the channel |
funding_pubkey | ------- | result | public key of funder, who wish to deposite BTC and other tokens to the channel |
funding_satoshis | ------- | result | |
htlc_base_point | ------- | result | |
htlc_minimum_msat | ------- | result | |
max_accepted_htlcs | ------- | result | |
max_htlc_value_in_flight_msat | ------- | result | |
payment_base_point | ------- | result | |
peer_id_a | ------- | result | peer id of funder |
peer_id_b | ------- | result | peer id of fundee |
pub_key_a | ------- | result | public key of funder |
pub_key_b | ------- | result | public key of fundee. Current OBD implementation does not requir fundee to deposit money to a channel. |
push_msat | ------- | result | |
revocation_base_point | ------- | result | |
temporary_channel_id | ------- | result | |
to_self_delay | ------- | result |
fundingBitcoin
Simple Type -102109 Protocol
Type -102109 Protocol is used for depositing bitcoin into a channel. Since the basic Omnilayer protocal uses BTC as miner fee in constructing transactions, this message -102109 is mandatory for depositing a little BTC into a channel as miner fee.
Websocket Request: Message Type -102109
Request:
{
"type":-102109,
"data":{
"from_address":"mre4gBmjKiBm8gwZmpCNcnnHiDY7TXr2wD",
"from_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf",
"to_address":"2MvPieQLzkS2mhexzYExsSkXGTExJJzzANw",
"amount":0.0002,
"miner_fee":0.00001,
}
}
Parameter | default | placement | Description |
---|---|---|---|
from_address | ------- | data | address of funder, from where the BTC is transferred. |
from_address_private_key | ------- | data | private key. |
to_address | ------- | data | the channel multi-sig address. |
amount | 0.0001 | data | amount of BTC. |
miner_fee | 0.00001 | data | miner fee in BTC for each time transaction. |
Websocket Response: Message Type -102109
OBD Responses:
{
"type":-102109,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"result":
{
"hex":"02000000019c35dde24b4b3ca57b51c20e4093ce0f412e9cec18b767acf92e0544a11dd363000000006a473044022047985ce08d3dcdbd80c4c9f87b919660a94a2680b192ea90e70f8cb3c36b1b7b0220519bc547641574ade1275c864db58bd97682296649222bc1dccb11298721a40f012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff02204e00000000000017a9142283a07c4fc44706e540c02edf1a1f3a4c433bfc872eb90a00000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac00000000",
"txid":"a9e2e14939f5edadabd8675be6d160c73762e9d562b35594328150db968e32c3"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of funder. |
to | ------- | body | |
hex | ------- | result | transaction hex. |
txid | ------- | result | transaction id. |
bitcoinFundingCreated
Simple Type -100340 Protocol
Type -100340 Protocol is used to notify the success of funding BTC to the counterpart of the channel.
Websocket Request: Message Type -100340
Request:
{
"type":-100340,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf", "funding_tx_hex":"0200000001f2ad47c834d41507642d8007ed3e43d408ad29ad2bf1d563d98ff7694db40ef7000000006a473044022051bde2fea20a92f7ce71a99cfda2055bb5e0fc47af3e9ed429c70b6d00e5be2302201dbab200fcfa15431cb541bfe1cd6055c95f12825f29d211d412d4171378cf30012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff02f82a00000000000017a914f222f1986a60a01e33f6f813a13c7507492f4ac28732bf0a00000000001976a91484902564ba3ce47952d86a0d53c17402b3cce96588ac00000000"
}
}
Parameter | default | placement | Description |
---|---|---|---|
temporary_channel_id | ------- | data | temporary channel id. |
channel_address_private_key | ------- | data | private key of the channel that Alice holds. |
funding_tx_hex | ------- | data | funding transaction hex. |
Websocket Response: Message Type -110340
OBD Responses:
{
"type":-110340,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"result":{
"funding_btc_hex":"02000000019c35dde24b4b3ca57b51c20e4093ce0f412e9cec18b767acf92e0544a11dd363000000006a473044022047985ce08d3dcdbd80c4c9f87b919660a94a2680b192ea90e70f8cb3c36b1b7b0220519bc547641574ade1275c864db58bd97682296649222bc1dccb11298721a40f012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff02204e00000000000017a9142283a07c4fc44706e540c02edf1a1f3a4c433bfc872eb90a00000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac00000000",
"funding_redeem_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000920047304402206cc5fa2e47a9d7772eb114ba2223e62481ac76a9f34c98349d0b306490280e3c02207cd41cfd3aa98758b76d08f867424e6e17f95925f7fc4c5412996203243fe059010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff0150490000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac00000000",
"funding_txid":"a9e2e14939f5edadabd8675be6d160c73762e9d562b35594328150db968e32c3",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of funder. |
to | ------- | body | peer id of fundee. |
funding_btc_hex | ------- | result | btc funding transaction hex. |
funding_redeem_hex | ------- | result | |
funding_txid | ------- | result | funding transaction id. |
temporary_channel_id | ------- | result | temporary channel id. |
bitcoinFundingSigned
Simple Type -100350 Protocol
Websocket Request: Message Type -100350
Request:
{
"type":-100350,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd",
"funding_txid":"603bfad3a62e7bf5480bc851e763c53adb276b16b02edc9451be6dd23cc07ba4",
"signed_miner_redeem_transaction_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"approval":true
}
}
Parameter | default | placement | Description |
---|---|---|---|
temporary_channel_id | ------- | data | temporary channel id. |
channel_address_private_key | ------- | data | private key of the channel that Bob holds. |
funding_txid | ------- | data | funding transaction id. |
signed_miner_redeem_transaction_hex | ------- | data | the hex signed at client side. |
approval | ------- | data | true or false. |
Websocket Response: Message Type -110350
OBD Responses:
{
"type":-110350,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"result":{
"approval":true, "funding_redeem_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000d90047304402206cc5fa2e47a9d7772eb114ba2223e62481ac76a9f34c98349d0b306490280e3c02207cd41cfd3aa98758b76d08f867424e6e17f95925f7fc4c5412996203243fe05901473044022069466e582dcd465dfeb4407f1d65138cbb7fb16d8aed4309a6ac99049aeb0f9402201149356dd472e1f032fc574c5d6e138661c0da830a50b48fd6b6b24b9b6a7bc70147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff0150490000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac00000000",
"funding_txid":"a9e2e14939f5edadabd8675be6d160c73762e9d562b35594328150db968e32c3",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of fundee. |
to | ------- | body | peer id of funder. |
funding_redeem_hex | ------- | result | funding redeemscript hex. |
funding_txid | ------- | result | funding tx id. |
temporary_channel_id | ------- | result | temporary channel id |
fundingAsset
Simple Type -102120 Protocol
Alice starts to deposit omni assets to the channel. This is quite similar to the the btc funding procedure.
Alice's example data:
address: mre4gBmjKiBm8gwZmpCNcnnHiDY7TXr2wD
privkey: cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf
channel address:2MvPieQLzkS2mhexzYExsSkXGTExJJzzANw
Websocket Request: Message Type -102120
Request:
{
"type":-102120,
"data":{
"from_address":"mre4gBmjKiBm8gwZmpCNcnnHiDY7TXr2wD",
"from_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf",
"to_address":"2MvPieQLzkS2mhexzYExsSkXGTExJJzzANw",
"amount":20,
"property_id":137
}
}
Parameter | default | placement | Description |
---|---|---|---|
from_address | ------- | data | address of funder, from where the BTC is transferred. |
from_address_private_key | ------- | data | private key. |
to_address | ------- | data | the channel multi-sig address. |
amount | ------- | data | |
property_id | ------- | data | the omni asset id that has been funding. |
Websocket Response:
OBD Responses:
{
"type":-102120,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"result":{
"hex":"0200000001e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d9010000006a47304402202616b9a0c38865c5a3cba97cdb228698272d954f315771c1b1fbd9e1310d4d150220589c13f8e2e4fd6b6cfd09e59f62faa899ff898f7b040cc972d5a09d6a448c11012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff034a070a00000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e69000000000000008900000000773594001c0200000000000017a9142283a07c4fc44706e540c02edf1a1f3a4c433bfc8700000000"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of funder. |
to | ------- | body | peer id of fundee. |
hex | ------- | result | funding transaction hex. |
assetFundingCreated
Simple Type -100034 Protocol
Type -100034 Protocol is used to notify the success of omni asset funding transaction to the counterparty of the channel.
Websocket Request: Message Type -100034
Request:
{
"type":-100034,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef", "funding_tx_hex":"0200000001c0c7ec0dabae15d2a5e3fd8e740952839c588cd68d8eafe00ed5d3c0f01bf229000000006a473044022045405d082bd9826e00819094cc693c0b2e40926b1a30cefc18e171c9c12e60be02206ba7479690f849cca828a6711a484a5149d79299fc9c4e179bffcad5e7bfb773012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff03f61c0c00000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e69000000000000008900000000b2d05e001c0200000000000017a914fcbbb71abf965dfde49fbf7442a4696ce2dd6c5f8700000000",
"temp_address_pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"temp_address_private_key":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo",
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf"
}
}
Parameter | default | placement | Description |
---|---|---|---|
temporary_channel_id | ------- | data | temporary channel id. |
funding_tx_hex | ------- | data | asset funding transaction hex. |
temp_address_pub_key | ------- | data | temporary address pub key. |
temp_address_private_key | ------- | data | temporary address private key. |
channel_address_private_key | ------- | data | private key of the channel that Alice holds. |
Websocket Response: Message Type -110034
OBD Responses:
{
"type":-110034,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"result"{
"c1a_rsmc_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a9000000009200473044022048d693d88f34ff98ae1ca34e56f3c88394569caa491ef3d08b7f0a06c0515e1b022020b155a9ca07be5cf854200157781169a1e402018b3dd9418f26651924176c59010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9146816548153dd030f92540b24e9605c0c565cc378870000000000000000166a146f6d6e69000000000000008900000000773594001c0200000000000017a9146816548153dd030f92540b24e9605c0c565cc3788700000000", "funding_omni_hex":"0200000001e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d9010000006a47304402202616b9a0c38865c5a3cba97cdb228698272d954f315771c1b1fbd9e1310d4d150220589c13f8e2e4fd6b6cfd09e59f62faa899ff898f7b040cc972d5a09d6a448c11012102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc66ffffffff034a070a00000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e69000000000000008900000000773594001c0200000000000017a9142283a07c4fc44706e540c02edf1a1f3a4c433bfc8700000000",
"rsmc_temp_address_pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of funder. |
to | ------- | body | peer id of fundee. |
c1a_rsmc_hex | ------- | result | hex of the first commitment transaction constructed. |
funding_omni_hex | ------- | result | omni asset funding transaction hex. |
rsmc_temp_address_pub_key | ------- | result | pub key of the temporary address that used to accept tokens RSMC output. |
temporary_channel_id | ------- | result | temporary channel id. |
assetFundingSigned
Simple Type -100035 Protocol
Websocket Request: Message Type -100035
Request:
{
"type":-100035,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef",
"fundee_channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd",
"signed_alice_rsmc_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......"
}
}
Parameter | default | placement | Description |
---|---|---|---|
temporary_channel_id | ------- | data | temporary channel id. |
fundee_channel_address_private_key | ------- | data | private key of the channel that Bob holds, used to sign the commitment transactions. |
signed_alice_rsmc_hex | ------- | data | the hex signed at client side. |
Websocket Response: Message Type -110035
OBD Responses:
{
"type":-110035,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"result":{
"channelId":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"temporary_channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false. |
from | ------- | body | peer id of fundee. |
to | ------- | body | peer id of funder. |
channel_id | ------- | result | officially generates the channel ID. |
temporary_channel_id | ------- | result | temporary channel id, won't appear again in following messages. |
commitmentTransactionCreated
Simple Type -100351 Protocol
Type -100351 Protocol is used for paying omni assets by Revocable Sequence Maturity Contract(RSMC) within a channel.
Here(in the right) are the example data generated by OBD used in contructing temporary multi-sig addresses and temporary transactions for i-th commitment transaction. You shall find your corresponding temporary data within the responses of your OBD.
example data:
last_temp_address:
{
"address":"mkPtXTRyA53ddhknMnVqNCDdeN2FsXmtwe",
"index":12,
"pub_key":"02fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed8",
"wif":"cTiDwaM3y5LE2HuWWgvRTC9mgHiovf2zntjSgCPyLLeuUTmKk1BY"
}
curr_temp_address:
{
"address":"mhAMwJW2bMtJ5iW4dp1EUT8nGi9LF1PXgj",
"index":6,
"pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"wif":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo"
}
Websocket Request: Message Type -100351
Request:
{
"type":-100351,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"amount":3,
"curr_temp_address_pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"curr_temp_address_private_key":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo",
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf",
"last_temp_address_private_key":"cTiDwaM3y5LE2HuWWgvRTC9mgHiovf2zntjSgCPyLLeuUTmKk1BY"
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | |
amount | ------- | data | amount to pay. |
curr_temp_address_pub_key | ------- | data | temporary multi-sig address. |
curr_temp_address_private_key | ------- | data | the private key of the temporary multi-sig address currently in use. |
channel_address_private_key | ------- | data | Alice's private key of the channel. |
last_temp_address_private_key | ------- | data | the private key of the previous temporary multi-sig address. |
Websocket Response: Message Type -100351
OBD Responses:
{
"type":-110351,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"result":{
"amount":3,
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"commitment_tx_hash":"c9ddb048fd69db8f9df0ba37a72d1d6979da2edc8bb258dbafcf263937d8b0c6",
"curr_temp_address_pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"last_temp_address_private_key":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo", "rsmc_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000920047304402200f031ad0f55b2303179a1a48270149f76784cdd20926180085b69c64e0e46eff02207c3ab2bb56a9f9863c33f609d84b51b03e7b592e28dec63f06f65f7b853cc9ae010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9146816548153dd030f92540b24e9605c0c565cc378870000000000000000166a146f6d6e690000000000000089000000006553f1001c0200000000000017a9146816548153dd030f92540b24e9605c0c565cc3788700000000", "to_counterparty_tx_hex":"0200000003e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d900000000920047304402201e687dae90d407e4200081052826c4586af4c11360bc208315a5fba9e8d731f802207b31fce12e77806bf3b5681297e94ae4aa04f8628ed00aea89c6152f043e7c69010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffffea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cdeb0200000092004730440220656924074ebf39dfb94915f23ffa6dae36cf1c59954af5d29c7e749c8cdc847a022057049291636cfcaa8d97a80e1af7687e9e1d2809162908783f22813a1260859f010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aefffffffffcabe9c10966c7640e41fcbc1e597991d4da4edc2f6e257c6159c1d7c34a8b820000000092004730440220057a058dcab077217aaedd778a524a69757de4cb37a0954f2d6ae3a3b75ee98f02203c3e0aa61550a5da0ae1641c236de5005ea1e0c48167723a6add2f11d389144e010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03ea930000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e6900000000000000890000000011e1a30022020000000000001976a914ceb05f96f5b3cbd12d7bff5f9f45252b3f67bf7088ac00000000"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | peer id of funder |
to | ------- | body | peer id of fundee |
amount | ------- | result | |
channel_id | ------- | result | |
commitment_tx_hash | ------- | result | commitment transaction hahs. |
curr_temp_address_pub_key | ------- | result | |
last_temp_address_private_key | ------- | result | the private key of the previous temporary multi-sig address. |
rsmc_hex | ------- | result | to RSMC(the multi-sig temp address) transaction hex. |
to_counterparty_tx_hex | ------- | result | to counterparty(the address of counterparty) transaction hex. |
commitmentTransactionAccepted(Debug mode only)
Simple Type -100352 Protocol
Receiver revokes the previous commitment transaction and ackonwledge the new transaction.
example data:
last_temp_pub_key:
address n2wKQgrfM5fFXmmA6xNWjWPPFPktJHnqEj
privkey cU78aif2a4YR5xK8HxBTrPKjdjhD8W4SSZNTw4yFEdwi59JMrYQY
pubkey 0298bdca47bbb76b1022eb7d18534961a12ce6dd80308c839576602b771e324fba
curr_temp_address:
{
"address":"mo9sVgTYnrx1rdxxj3XYswAcUwnQKmGKoN",
"index":7,
"pub_key":"03b2e7ecc5ff62feb342943a1364f555e8302f507f78c6392c82b9e12c95ccb40b",
"wif":"cPnHVbg3ZZoXhvgu5pWSx18zf9Dw5jfp7wMaDEx4JzHd9zqh1etk"
}
Websocket Request: Message Type -100352
Request:
{
"type":-100352,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"msg_hash":"853a6adee774f65daf2bb4b59ffb3500293cd79e55c22d414438111320824a4f",
"c2a_rsmc_signed_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"c2a_counterparty_signed_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd",
"curr_temp_address_pub_key":"03b2e7ecc5ff62feb342943a1364f555e8302f507f78c6392c82b9e12c95ccb40b",
"curr_temp_address_private_key":"cPnHVbg3ZZoXhvgu5pWSx18zf9Dw5jfp7wMaDEx4JzHd9zqh1etk",
"last_temp_address_private_key":"cU78aif2a4YR5xK8HxBTrPKjdjhD8W4SSZNTw4yFEdwi59JMrYQY",
"approval":true
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | the channel id. |
msg_hash | ------- | data | |
c2a_rsmc_signed_hex | ------- | data | the hex signed at client side. |
c2a_counterparty_signed_hex | ------- | data | the hex signed at client side. |
channel_address_private_key | ------- | data | private key of the channel that payee holds. |
curr_temp_address_pub_key | ------- | data | current multi-sig temp address pubkey. |
curr_temp_address_private_key | ------- | data | current multi-sig temp address private key. |
last_temp_address_private_key | ------- | data | previous multi-sig temp address private key. |
approval | ------- | data | true or false |
HTLC Payment
wsAddInvoice
Simple Type -100402 Protocol
create an invoice.
Websocket Request: Message Type -100402
Request:
req
{
"type":-100402,
"data":{
"property_id":137,
"amount":4,
"h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"expiry_time":"2020-07-15",
"description":"description",
"is_private":false
}
}
Parameter | default | placement | Description |
---|---|---|---|
property_id | ------- | data | assets id |
amount | ------- | data | amount of transfer |
h | ------- | data | the hash of r used to lock a HTLC. |
expiry_time | ------- | data | expiry time. |
description | ------- | data | short memo. |
is_private | ------- | data | true to private channel or false to open channel. |
Websocket Response: Message Type 100402
OBD Responses:
{
"type":-100402,
"data": {
"invoice":"obtb400000000s1pqzyfnpwQmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiontuzq1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2hzz035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933xq8p0sm45qdqtdescriptionjf4"
}
}
Parameter | default | placement | Description |
---|---|---|---|
invoice | ------- | data | the invoice string encoded by beth32. |
payInvoice
A SDK Function
Pay an invoice. This function firstly seeks a full path of nodes, decides which path is the optimistic one, in terms of hops, node's histroy service quility, and fees. Then it construct an HTLC and pay to the payee who creates the invoice.
Request:
Request:
{
"data": {
"invoice":"obtb400000000s1pqzyfnpwQmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiontuzq1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2hzz035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933xq8p0sm45qdqtdescriptionjf4"
}
}
Parameter | default | placement | Description |
---|---|---|---|
invoice | ------- | data | the invoice string encoded by beth32. |
HTLCFindPath
Simple Type -100401 Protocol
This protocol is the first step of a payment, which seeks a full path of nodes, decide which path is the optimistic one, in terms of hops, node's histroy service quility, and fees.
There is two ways to do it. One is through an invoice and the other is through some detail data.
Websocket Request: Message Type -100401
Request:
{
"type":-100401,
"data": {
"invoice":"obtb400000000s1pqzyfnpwQmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiontuzq1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2hzz035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933xq8p0sm45qdqtdescriptionjf4"
}
}
OR
{
"type":-100401,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data"{
"property_id":137,
"amount":4,
"h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"expiry_time":"2020-07-15",
"description":"description",
"is_private":false
}
}
Parameter | default | placement | Description |
---|---|---|---|
invoice | ------- | data | the invoice string encoded by beth32. |
OR
Parameter | default | placement | Description |
---|---|---|---|
property_id | ------- | data | assets id |
amount | ------- | data | amount of transfer |
h | ------- | data | the hash of r used to lock a HTLC. |
expiry_time | ------- | data | expiry time. |
description | ------- | data | short memo. |
is_private | ------- | data | true to private channel or false to open channel. |
Websocket Response: Message Type -100401
Response:
{
"type":-100401,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/3001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"result":{
"min_cltv_expiry":1,
"next_node_peerId":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"routing_packet":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9"
}
}
Parameter | default | placement | Description |
---|---|---|---|
min_cltv_expiry | ------- | result | min cltv expiry. |
next_node_peerId | ------- | result | next hop. |
routing_packet | ------- | result | routing packet. |
addHTLC
Simple Type -100040 Protocol
Add an HTLC.
current stage before adding a new HTLC:
H and R
{
"address":"mgxXToovRhRictkY1oDZfPn36Kx6hu2rtV",
"index":16,
"pub_key":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"wif":"cUAa45B7TWp6FbK6N15WLq5pXDCKUJj98RSXm4QTV5WsQNeF6tmn"
}
alice's previous temp rsmc
{
"address":"mhAMwJW2bMtJ5iW4dp1EUT8nGi9LF1PXgj",
"index":6,
"pub_key":"03985e8880628058da7c49b0968e4e7d2819240b60255a1c9b5f2407a4056b5f54",
"wif":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo"
}
alice's current rsmc
{
"address":"mirZzX7MRF87hpw7ST3JS8RvnKh7EZ1P4s",
"index":13,
"pub_key":"0253a778da18945a91fccfa40ad09ac4d276991ab70ad6e5b1009b68434d57b8b3",
"wif":"cNwgTtsRaWdDWdNVA4aPEoumS9prpYirE3Q1BuARrphjH9THVeH2"
}
alice's htlc
{
"address":"mudzJLK5ncD1awLbZf2FhWJgbfe3sWKDMj",
"index":14,
"pub_key":"03f40b44a99393408d705806b09531c47d042ab332e7cd59c39e2aa67df0bc926c",
"wif":"cRVqzokvBvtzw91Nv4zkvmad7uRBf5eMfr5t5EDL7q2U6VxBTmoy"
}
alice's ht1a
{
"address":"mj8Pressjgn2mfzPTB2G7U2unvtVmSh6Aa",
"index":15,
"pub_key":"036266f3a46ef8e413211c55d9c48a54b237ce5479470535ddc82880e19740f7a8",
"wif":"cUxBiu8jVgk9gDhdgpF3S4wFrpFBkAFujCEVgCRYBsQaTDtUdVMb"
}
Websocket Request: Message Type -100040
Request:
{
"type":-100040,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
// "property_id":137,
"amount":4,
"memo":"memo",
"h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"routing_packet":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"cltv_expiry":1,
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf",
"last_temp_address_private_key":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo",
"curr_rsmc_temp_address_pub_key":"0253a778da18945a91fccfa40ad09ac4d276991ab70ad6e5b1009b68434d57b8b3",
"curr_rsmc_temp_address_private_key":"cNwgTtsRaWdDWdNVA4aPEoumS9prpYirE3Q1BuARrphjH9THVeH2",
"curr_htlc_temp_address_pub_key":"03f40b44a99393408d705806b09531c47d042ab332e7cd59c39e2aa67df0bc926c",
"curr_htlc_temp_address_private_key":"cRVqzokvBvtzw91Nv4zkvmad7uRBf5eMfr5t5EDL7q2U6VxBTmoy",
"curr_htlc_temp_address_for_ht1a_pub_key":"036266f3a46ef8e413211c55d9c48a54b237ce5479470535ddc82880e19740f7a8",
"curr_htlc_temp_address_for_ht1a_private_key":"cUxBiu8jVgk9gDhdgpF3S4wFrpFBkAFujCEVgCRYBsQaTDtUdVMb"
}
}
Payer requests his OBD by sending the created pub/priv keys and other info about the payee.
Parameter | default | placement | Description |
---|---|---|---|
<!-- property_id | ------- | data | assets id. --> |
amount | ------- | data | amount of transfer. |
memo | ------- | data | short memo for this tranfer. |
h | ------- | data | preimage of r to Lock a HTLC. |
routing_packet | ------- | data | routing info of next hop. |
cltv_expiry | ------- | data | cltv expiry. |
channel_address_private_key | ------- | data | payer's private key of channel address. |
last_temp_address_private_key | ------- | data | previous private key of temporary multi-sig address that stores money of pay-to-rsmc. |
curr_rsmc_temp_address_pub_key | ------- | data | rsmc temp address for current HTLC. |
curr_rsmc_temp_address_private_key | ------- | data | private key of rsmc temp address for current HTLC. |
curr_htlc_temp_address_pub_key | ------- | data | pub key of htlc temp address. |
curr_htlc_temp_address_private_key | ------- | data | private key of htlc temp address. |
curr_htlc_temp_address_for_ht1a_pub_key | ------- | data | pub key of ht1a temp address. |
curr_htlc_temp_address_for_ht1a_private_key | ------- | data | private key of ht1a temp address. |
Websocket Response: Message Type -110040
OBD Responses:
{
"type":-110040,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"result":{
"amount":4,
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"cltv_expiry":1,
"commitment_tx_hash":"4a5854c6cc0d1930500e05353aff416b8cdd1859dc2c2af44b46089e23938023", "counterparty_tx_hex":"0200000002ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cdeb020000009200473044022042a2b6efa34c52409cdbd4971526824830e6fb1d49a7747634f9ab5ece6f28ad02206f40b96b2f13144eee9e2d686eaa7e880e8da29999c5a840662b04f221e537ad010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aefffffffffcabe9c10966c7640e41fcbc1e597991d4da4edc2f6e257c6159c1d7c34a8b8200000000920047304402200f7c74406f0c6553fd141caf19305c42d9dcdf487dda56e30144a02325a76ebd02205eba8119193b05fa1829c4d3117c9582987347e7a2e5cdccd7cd151a2a8e5128010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03d7470000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e6900000000000000890000000011e1a30022020000000000001976a914ceb05f96f5b3cbd12d7bff5f9f45252b3f67bf7088ac00000000",
"curr_htlc_temp_address_for_ht1a_pub_key":"036266f3a46ef8e413211c55d9c48a54b237ce5479470535ddc82880e19740f7a8",
"curr_htlc_temp_address_pub_key":"03f40b44a99393408d705806b09531c47d042ab332e7cd59c39e2aa67df0bc926c",
"curr_rsmc_temp_address_pub_key":"0253a778da18945a91fccfa40ad09ac4d276991ab70ad6e5b1009b68434d57b8b3",
"h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933", "htlc_tx_hex":"0200000001e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d900000000920047304402204709f197d1def131fdee07957ff110fca149a33db87ec8e59032000034668c99022009e0dfe7af7c0b065c1770e94f7733684b9df1f000ad85d105824238b0e8d232010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9147abd515aab0f074a6ae0b993e75f10107dd382bb870000000000000000166a146f6d6e6900000000000000890000000017d784001c0200000000000017a9147abd515aab0f074a6ae0b993e75f10107dd382bb8700000000",
"last_temp_address_private_key":"cTLc9tx1Hihqfu6jXXWQ8pFeiQb5aJ8ck88ik8RJuutP95dqTuqo",
"memo":"memo",
"routing_packet":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9", "rsmc_tx_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000920047304402205868611dc0c9437adc3fc6ef9e2b14b1d8449f66c8d20758a58287733118324f0220454da7c12c60ae0639af6fd0d4f87cf8608318bd00ecd75e455efbad8d479b08010047522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9143e19c938d5330b5d5a244573c778acfaf7e674c3870000000000000000166a146f6d6e690000000000000089000000004d7c6d001c0200000000000017a9143e19c938d5330b5d5a244573c778acfaf7e674c38700000000"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
amount | ------- | result | amount of transfer |
channel_id | ------- | result | channel id |
cltv_expiry | ------- | result | cltv expiry |
commitment_tx_hash | ------- | result | cltv expiry |
counterparty_tx_hex | ------- | result | cltv expiry |
curr_htlc_temp_address_for_ht1a_pub_key | ------- | result | pub key of curr temp address for ht1a |
curr_htlc_temp_address_pub_key | ------- | result | pub key of curr htlc temp address |
curr_rsmc_temp_address_pub_key | ------- | result | pub key of curr rsmc temp address |
h | ------- | result | preimage of r to Lock a HTLC. |
htlc_tx_hex | ------- | result | hex of the htlc transaction. |
last_temp_address_private_key | ------- | result | private key of the previous temp address |
memo | ------- | result | short memo for this tranfer. |
routing_packet | ------- | result | routing info of next hop. |
rsmc_tx_hex | ------- | result | rsmc transaction hex |
HTLCSigned
Simple Type -100041 Protocol
Type -100041 Protocol is used to response an incoming HTLC.
current stage before signing a new incoming HTLC:
bob's lastest temp rsmc
{
"address":"mo9sVgTYnrx1rdxxj3XYswAcUwnQKmGKoN",
"index":7,
"pub_key":"03b2e7ecc5ff62feb342943a1364f555e8302f507f78c6392c82b9e12c95ccb40b",
"wif":"cPnHVbg3ZZoXhvgu5pWSx18zf9Dw5jfp7wMaDEx4JzHd9zqh1etk"
}
bob's rsmc
{
"address":"myz18rSHrtZR4DSHGy1WUPTK1QCrsxJJow",
"index":25,
"pub_key":"0360917f53381f2b05bb3ec299b6bf7e7446a5c6ed287d65cfc6e38858c3800172",
"wif":"cTWtQC6WWosXNaqFbnotZdqHi5Y74vEARaqGoqPHX3285QKdz1wD"
}
bob's htlc
{
"address":"n39P3nHJbS4BMm8tuMwoFmrfgMBQzZG3TJ",
"index":26,
"pub_key":"0218da225a18821ec4353cd4d4c10735e5ce56552166c072e43d977bb50da30f18",
"wif":"cUYShY9qJdX3S1d74dK9Q3QYAypKPMVG9gYvB3iZe3J9GyLCG9G6"
}
Websocket Request: Message Type -100041
Request:
{
"type":-100041,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"payer_commitment_tx_hash":"4a5854c6cc0d1930500e05353aff416b8cdd1859dc2c2af44b46089e23938023",
"c3a_complete_signed_rsmc_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"c3a_complete_signed_counterparty_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"c3a_complete_signed_htlc_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd",
"curr_rsmc_temp_address_pub_key":"0360917f53381f2b05bb3ec299b6bf7e7446a5c6ed287d65cfc6e38858c3800172",
"curr_rsmc_temp_address_private_key":"cTWtQC6WWosXNaqFbnotZdqHi5Y74vEARaqGoqPHX3285QKdz1wD",
"curr_htlc_temp_address_pub_key":"0218da225a18821ec4353cd4d4c10735e5ce56552166c072e43d977bb50da30f18",
"curr_htlc_temp_address_private_key":"cUYShY9qJdX3S1d74dK9Q3QYAypKPMVG9gYvB3iZe3J9GyLCG9G6",
"last_temp_address_private_key":"cPnHVbg3ZZoXhvgu5pWSx18zf9Dw5jfp7wMaDEx4JzHd9zqh1etk"
}
}
Parameter | default | placement | Description |
---|---|---|---|
payer_commitment_tx_hash | ------- | data | payer's commitment tx hash. |
c3a_complete_signed_rsmc_hex | ------- | data | the hex signed at client side. |
c3a_complete_signed_counterparty_hex | ------- | data | the hex signed at client side. |
c3a_complete_signed_htlc_hex | ------- | data | the hex signed at client side. |
channel_address_private_key | ------- | data | payee's private key of the channel address. |
curr_rsmc_temp_address_pub_key | ------- | data | payee's pub key of current rsmc temp address. |
curr_rsmc_temp_address_private_key | ------- | data | payee's private key of current rsmc temp address. |
curr_htlc_temp_address_pub_key | ------- | data | payee's pub key of current htlc temp address. |
curr_htlc_temp_address_private_key | ------- | data | payee's private key of current htlc temp address. |
last_temp_address_private_key | ------- | data | private key of payee's last temp address. |
Websocket Response: Message Type -41
OBD Responses:
{
"type":-110041,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"result":{
"amount_to_counterparty":3,
"amount_to_htlc":4,
"amount_to_rsmc":13,
"begin_block_height":1764129,
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"create_at":"2020-06-09T16:17:12.2961533+08:00",
"create_by":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"curr_hash":"4a5854c6cc0d1930500e05353aff416b8cdd1859dc2c2af44b46089e23938023",
"curr_state":11, "from_counterparty_side_for_me_tx_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000d900473044022027a4d0d62644f35397259b935fb1b5a12e7fb5ba4d2ecb95c6594462b03f0bf1022055a667b71720c1d69f0cc9276e73abbe037aaf4d273c4182d727326e87093fbd0147304402204b82eae5542ed8359463cef4fbb195b5c0b0f5e7f48fa359342d041ae163254702207ce784d75958d20137b0990cd112d2a4156c2fe34a5b92f7db31262de64e01000147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9143990d4cce9619dcaf5bb619fb19f36d0f43c38ac870000000000000000166a146f6d6e6900000000000000890000000011e1a3001c0200000000000017a9143990d4cce9619dcaf5bb619fb19f36d0f43c38ac8700000000",
"htlc_cltv_expiry":1,
"htlc_h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"htlc_multi_address":"2N4SDDibGaVVxggNTs9wufh22qQH39Tj3gq",
"htlc_multi_address_script_pub_key":"a9147abd515aab0f074a6ae0b993e75f10107dd382bb87",
"htlc_r":"", "htlc_redeem_script":"522103f40b44a99393408d705806b09531c47d042ab332e7cd59c39e2aa67df0bc926c21028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52ae",
"htlc_routing_packet":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"htlc_sender":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"htlc_temp_address_pub_key":"03f40b44a99393408d705806b09531c47d042ab332e7cd59c39e2aa67df0bc926c", "htlc_tx_hex":"0200000001e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d900000000d90047304402204709f197d1def131fdee07957ff110fca149a33db87ec8e59032000034668c99022009e0dfe7af7c0b065c1770e94f7733684b9df1f000ad85d105824238b0e8d2320147304402204875292df9ca67b03c5f1337574a4eb65814077097779ed6423ad64e2cc4722c02204936d4b6b923e004fcea4d4746b29a8e409d2b89d7232c938cbfe814d35c378d0147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9147abd515aab0f074a6ae0b993e75f10107dd382bb870000000000000000166a146f6d6e6900000000000000890000000017d784001c0200000000000017a9147abd515aab0f074a6ae0b993e75f10107dd382bb8700000000",
"htlc_txid":"3f3a44ce9e42b6e38b9dc6aad770ab4e453211427d6e2c1cb169898fc7d0e871",
"id":30,
"input_amount":20,
"input_txid":"ebcdb6658a38cd5e072646fc51d8061571b5df59a66c4898a3cf4b86b19650ea",
"input_vout":2,
"last_commitment_tx_id":29,
"last_edit_time":"2020-06-09T16:17:12.2961533+08:00",
"last_hash":"1ea1bf809c292a594d40fff5a701b7544cf24478522d77af7fe0d045b7ba89e0",
"owner":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"peer_id_a":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"peer_id_b":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"property_id":137,
"rsmc_input_txid":"",
"rsmc_multi_address":"2MxuampceMui3WgELn4SoXxohNvdyvdQebn",
"rsmc_multi_address_script_pub_key":"a9143e19c938d5330b5d5a244573c778acfaf7e674c387", "rsmc_redeem_script":"52210253a778da18945a91fccfa40ad09ac4d276991ab70ad6e5b1009b68434d57b8b321028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52ae",
"rsmc_temp_address_pub_key":"0253a778da18945a91fccfa40ad09ac4d276991ab70ad6e5b1009b68434d57b8b3", "rsmc_tx_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000d90047304402205868611dc0c9437adc3fc6ef9e2b14b1d8449f66c8d20758a58287733118324f0220454da7c12c60ae0639af6fd0d4f87cf8608318bd00ecd75e455efbad8d479b0801473044022071b1ab8ce14e612a595741cb02bba57d3ab2c114c8fc0fe9eb2be6baeae11d54022003e9979b46f45a6629f50028563cb59b319a28569afb462bf5350ab7ffa941f40147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a9143e19c938d5330b5d5a244573c778acfaf7e674c3870000000000000000166a146f6d6e690000000000000089000000004d7c6d001c0200000000000017a9143e19c938d5330b5d5a244573c778acfaf7e674c38700000000",
"rsmc_txid":"2904a9967cbbb5a43a0376f50342e75555d1a71986bbc6cff26142f2309a12a1",
"send_at":"0001-01-01T00:00:00Z",
"sign_at":"2020-06-09T16:20:15.1304179+08:00", "to_counterparty_tx_hex":"0200000002ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cdeb02000000d900473044022042a2b6efa34c52409cdbd4971526824830e6fb1d49a7747634f9ab5ece6f28ad02206f40b96b2f13144eee9e2d686eaa7e880e8da29999c5a840662b04f221e537ad0147304402204151fdb70c4ad5b4732268d9ab0f9c6fbb1539322224ffa277f7f1f3e4573a1e022034cee39ccacbaffaa2d85e1361290a3ab9a281b51f9fc70e098c230d0e3f58140147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aefffffffffcabe9c10966c7640e41fcbc1e597991d4da4edc2f6e257c6159c1d7c34a8b8200000000d90047304402200f7c74406f0c6553fd141caf19305c42d9dcdf487dda56e30144a02325a76ebd02205eba8119193b05fa1829c4d3117c9582987347e7a2e5cdccd7cd151a2a8e51280147304402201b0034af1fdb7c4134eb32a01bc605e6010101eb39cb4dc53e7f4c8f1dfaaa7302201be53089f8fae856404e31a73e60acf744d05eef188bf0e00f1180b83a0761380147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03d7470000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e6900000000000000890000000011e1a30022020000000000001976a914ceb05f96f5b3cbd12d7bff5f9f45252b3f67bf7088ac00000000",
"to_counterparty_txid":"4fa372d11bb2cbb5637e67fe2e68b9b21265ac04456a921d9aa599ff12dd72a1",
"tx_type":1
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
approval | ------- | result | true or false |
amount_to_counterparty | ------- | result | portion of this payment to the counterparty. |
amount_to_htlc | ------- | result | portion of this payment to the HTLC temporary address. |
amount_to_rsmc | ------- | result | portion of this payment to the RSMC temporary address. |
begin_block_height | ------- | result | current block height using in timing. |
A HTLC has three output: to counterparty, to htlc, to rsmc. The three fields are filled by payee's obd when constructing HTLC transactions on payee's obd. The remaining fields are for notifying purpose when obd module developers debug. For wallet developers, these fields shall be ignored.
forwardR
Simple Type -100045 Protocol
Type -100045 Protocol is used to forward R to a user.
Bob asks Carol if Carol can present an unknown 20-byte random R subject to Hash(R) = H, within two days for example, then Bob will settle the contract by paying assets. This message is from Bob's client to Bob's OBD.
Websocket Request: Message Type -100045
Request:
{
"type":-100045,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"r":"cUAa45B7TWp6FbK6N15WLq5pXDCKUJj98RSXm4QTV5WsQNeF6tmn",
"channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd"
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | the channel id. |
r | ------- | data | Preimage_R |
channel_address_private_key | ------- | data | bob's private key of channel address. |
Websocket Response: Message Type -110045
OBD Responses:
{
"type":-110045,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"result":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"he1b_temp_pub_key":"02d93e3a855ec5603d74c6f379da184c5fcc05372ca48b4791e1afa1d6587db715",
"he1b_tx_hex":"02000xxxxxxxxxxxxxxxxxbf97538700000000",
"herd1b_tx_hex":"6f6d6xxxxxxxxxxxxxxx001976a914ceb05f",
"msg_hash":"5f28fc568453f3c5625a5dc4e918a3d5b3aa75f7a447ee44166880698d2dc61e",
"r":"cUAa45B7TWp6FbK6N15WLq5pXDCKUJj98RSXm4QTV5WsQNeF6tmn"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
id | ------- | result | |
channel_id | ------- | result | |
he1b_temp_pub_key | ------- | result | temp pub key of HE1B. |
he1b_tx_hex | ------- | result | transaction hex of HE1B. |
herd1b_tx_hex | ------- | result | transaction hex of HERD1B. |
msg_hash | ------- | result | |
r | ------- | result | the preimage. |
signR
Simple Type -100046 Protocol
Type -100046 Protocol is used to accept R and notify the sender.
Websocket Request: Message Type -100046
Request:
{
"type":-100046,
"recipient_node_peer_id":"QmVQZ6byysojM1mYyxNrDXy8gG96BbH8ZDW9pnuHFGWazn",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"channel_id":"80d34c072c35b83a70f82fcb791025b4756db6f8aad37d6f50fbde763168abf5",
"c3b_htlc_herd_complete_signed_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"c3b_htlc_hebr_partial_signed_hex":"c851e763c53adb27dc9451be6dd23cc07ba4......",
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf"
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | hash of this HTLC request |
c3b_htlc_herd_complete_signed_hex | ------- | data | the hex signed at client side. |
c3b_htlc_hebr_partial_signed_hex | ------- | data | the hex signed at client side. |
channel_address_private_key | ------- | data | bob's private key of channel address. |
Websocket Response: Message Type -110046
OBD Responses:
{
"type":-110046,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVQZ6byysojM1mYyxNrDXy8gG96BbH8ZDW9pnuHFGWazn",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/QmVQZ6byysojM1mYyxNrDXy8gG96BbH8ZDW9pnuHFGWazn",
"result":{
"commitmentTxInfo":{
"amount_to_counterparty":13,
"amount_to_htlc":4,
"amount_to_rsmc":3,
"begin_block_height":1764129,
"channel_id":"80d34c072c35b83a70f82fcb791025b4756db6f8aad37d6f50fbde763168abf5",
"create_at":"2020-06-09T16:19:57.4116087+08:00",
"create_by":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"curr_hash":"191947428ead76964da30881524696a8b3ebbaee2bc365c8cd29467a54e011ae",
"curr_state":12,
"from_counterparty_side_for_me_tx_hex":"0200000 xxxxxxxxx 7088ac00000000",
"htlc_cltv_expiry":1,
"htlc_h":"035be1bc8f26ac7318d83663bd5dab10c843a74d11e573731a6a9abee5b9d46933",
"htlc_multi_address":"2NAS4M4CCzew1BFnq59nuDJBNGoigo1oAyV",
"htlc_multi_address_script_pub_key":"a914bc86aa4fe56c2efda016bb1b0fa928372b8c51ab87",
"htlc_r":"cUAa45B7TWp6FbK6N15WLq5pXDCKUJj98RSXm4QTV5WsQNeF6tmn",
"htlc_redeem_script":"52210218da225a18 xxxxxxx 95bb6391ce5d6d4fc6652ae",
"htlc_routing_packet":"80d34c072c35b83a70f82fcb791025b4756db6f8aad37d6f50fbde763168abf5",
"htlc_sender":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"htlc_temp_address_pub_key":"0218da225a18821ec4353cd4d4c10735e5ce56552166c072e43d977bb50da30f18",
"htlc_tx_hex":"0200000 xxxxx c51ab8700000000",
"htlc_txid":"14b1caad63717b4a2b8f7bf51964f33c707b4f2adbb145aad21777ac5da64516",
"id":19,
"input_amount":20,
"input_txid":"ebcdb6658a38cd5e072646fc51d8061571b5df59a66c4898a3cf4b86b19650ea",
"input_vout":2,
"last_commitment_tx_id":18,
"last_edit_time":"2020-06-09T16:19:57.4116087+08:00",
"last_hash":"6ec57103f76f17e0c3b7d3d21ae2e35682be87a52d324bff58934c3a7c22717c",
"owner":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"peer_id_a":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"peer_id_b":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"property_id":137,
"rsmc_input_txid":"",
"rsmc_multi_address":"2MxVc1GcmtyHgn6s2gzHD8Vjv94YV4bkwqd",
"rsmc_multi_address_script_pub_key":"a9143990d4cce9619dcaf5bb619fb19f36d0f43c38ac87",
"rsmc_redeem_script":"522103609 xxxxx 95bb6391ce5d6d4fc6652ae",
"rsmc_temp_address_pub_key":"0360917f53381f2b05bb3ec299b6bf7e7446a5c6ed287d65cfc6e38858c3800172",
"rsmc_tx_hex":"0200000001c33 xxxxxx c8700000000",
"rsmc_txid":"058f36e8fd80e970f299c84b843de16fe909d4dfdf046a2d200ac2f3f3a13fc0",
"send_at":"0001-01-01T00:00:00Z",
"sign_at":"0001-01-01T00:00:00Z",
"to_counterparty_tx_hex":"0200000 xxxxxxxx 8ac00000000",
"to_counterparty_txid":"66f327f8df014c641839081397211561def01757ca19392b44dff8bf1f434027",
"tx_type":1
}
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
id | ------- | result | |
commitmentTxInfo | ------- | result | returns the params in this commitment transaction. |
closeHTLC
Simple Type -100049 Protocol
Type -100049 message is used to close a HTLC.
Websocket Request: Message Type -100049
Request:
{
"type":-100049,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"data":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"channel_address_private_key":"cVV22tLgBbLv1K1uW6z2doR4Copat1mejjND1jtW8CVkRLUSpPxf",
"last_rsmc_temp_address_private_key":"cNwgTtsRaWdDWdNVA4aPEoumS9prpYirE3Q1BuARrphjH9THVeH2",
"last_htlc_temp_address_private_key":"cRVqzokvBvtzw91Nv4zkvmad7uRBf5eMfr5t5EDL7q2U6VxBTmoy",
"last_htlc_temp_address_for_htnx_private_key":"cUxBiu8jVgk9gDhdgpF3S4wFrpFBkAFujCEVgCRYBsQaTDtUdVMb",
"curr_rsmc_temp_address_pub_key":"02fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed8",
"curr_rsmc_temp_address_private_key":"cTiDwaM3y5LE2HuWWgvRTC9mgHiovf2zntjSgCPyLLeuUTmKk1BY"
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | Id of a channel |
channel_address_private_key | ------- | data | Alice's private key of the channel address. |
last_rsmc_temp_address_private_key | ------- | data | Alice's private key of last rsmc temp address. |
last_htlc_temp_address_private_key | ------- | data | Alice's private key of last htlc temp address. |
last_htlc_temp_address_for_htnx_private_key | ------- | data | Alice's private key of last htlc temp address for htnx. |
curr_rsmc_temp_address_pub_key | ------- | data | Alice's pub key of current rsmc temp address. |
curr_rsmc_temp_address_private_key | ------- | data | Alice's private key of curr rsmc temp address. |
Websocket Response: Message Type -100049
OBD Responses:
{
"type":-100049,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/3001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/3001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"result":{
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"commitment_tx_hash":"7a9f1db251531e6846812638cb7d7b2d1e9a25bab93a0c6d8f2ecb404754fdab",
"curr_rsmc_temp_address_pub_key":"02fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed8",
"last_htlc_temp_address_for_htnx_private_key":"cUxBiu8jVgk9gDhdgpF3S4wFrpFBkAFujCEVgCRYBsQaTDtUdVMb",
"last_htlc_temp_address_private_key":"cRVqzokvBvtzw91Nv4zkvmad7uRBf5eMfr5t5EDL7q2U6VxBTmoy",
"last_rsmc_temp_address_private_key":"cNwgTtsRaWdDWdNVA4aPEoumS9prpYirE3Q1BuARrphjH9THVeH2",
"msg_hash":"ed80ad44aeeca449e6f686d3adbf6c231fa9667c9e560d20d874df8b92ec02d6",
"rsmc_hex":"020xxxxxxxxxxxxxxxxxd7dbe2d391d22d19014e6cb4a8b6c33251d28700000000",
"to_counterparty_tx_hex":"02000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc988ac00000000"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
channel_id | ------- | result | channel id. |
commitment_tx_hash | ------- | result | commitment tx hash. |
curr_rsmc_temp_address_pub_key | ------- | result | curr rsmc temp address pub key. |
last_htlc_temp_address_for_htnx_private_key | ------- | result | |
last_htlc_temp_address_private_key | ------- | result | |
last_rsmc_temp_address_private_key | ------- | result | |
msg_hash | ------- | result | |
rsmc_hex | ------- | result | |
to_counterparty_tx_hex | ------- | result |
closeHTLCSigned
Simple Type -100050 Protocol
Type -49 Protocol is used to response the request of close HTLC .
Websocket Request: Message Type -100050
Request:
{
"type":-100050,
"recipient_node_peer_id":"Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"msg_hash":"45620c2a09d610e7eaa85d4f7fe48d38cf9a5b801e0196259ff89da41bba6a47",
"channel_address_private_key":"cTWBhAwXyDtM5XxBwibUxMzH5R2na7WHCTXcnL2xq3y25S4mpAMd",
"last_rsmc_temp_address_private_key":"cTWtQC6WWosXNaqFbnotZdqHi5Y74vEARaqGoqPHX3285QKdz1wD",
"last_htlc_temp_address_private_key":"cUYShY9qJdX3S1d74dK9Q3QYAypKPMVG9gYvB3iZe3J9GyLCG9G6",
"last_htlc_temp_address_for_htnx_private_key":"cVpq1dvQdh16iyR1j1FbCDCMxXD27GXMRU7mna3Pe6yPvSVrmgUG",
"curr_rsmc_temp_address_pub_key":"0298bdca47bbb76b1022eb7d18534961a12ce6dd80308c839576602b771e324fba",
"curr_rsmc_temp_address_private_key":"cU78aif2a4YR5xK8HxBTrPKjdjhD8W4SSZNTw4yFEdwi59JMrYQY"
}
}
Parameter | default | placement | Description |
---|---|---|---|
msg_hash | ------- | data | hash of this closing request |
channel_address_private_key | ------- | data | Bob's private key of the channel address. |
last_rsmc_temp_address_private_key | ------- | data | Bob's private key of previous rsmc temp address. |
last_htlc_temp_address_private_key | ------- | data | Bob's private key of previous htlc temp address. |
last_htlc_temp_address_for_htnx_private_key | ------- | data | Bob's private key of previous htlc temp address for htnx. |
curr_rsmc_temp_address_pub_key | ------- | data | Bob's pub key of curr rsmc temp address. |
curr_rsmc_temp_address_private_key | ------- | data | Bob's private key of curr rsmc temp address. |
Websocket Response: Message Type -110050
OBD Responses:
{
"type":-110050,
"status":true,
"from":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/Qmd3a2GWMwJuC98x1sthzvqXXhaVSz5rFzJYCekBU5ihPP",
"result":{
"latestCommitmentTxInfo":{
"amount_to_counterparty":7,
"amount_to_htlc":0,
"amount_to_rsmc":13,
"begin_block_height":0,
"channel_id":"ea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cde9",
"create_at":"2020-06-09T16:24:09.9204628+08:00",
"create_by":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"curr_hash":"f08463542b83b17da8328624dc06443184bac742937f40ddbbaeccbd059561df",
"curr_state":10,
"from_counterparty_side_for_me_tx_hex":"",
"htlc_cltv_expiry":0,
"htlc_h":"",
"htlc_multi_address":"",
"htlc_multi_address_script_pub_key":"",
"htlc_r":"",
"htlc_redeem_script":"",
"htlc_routing_packet":"",
"htlc_sender":"",
"htlc_temp_address_pub_key":"",
"htlc_tx_hex":"",
"htlc_txid":"",
"id":31,
"input_amount":20,
"input_txid":"ebcdb6658a38cd5e072646fc51d8061571b5df59a66c4898a3cf4b86b19650ea",
"input_vout":2,
"last_commitment_tx_id":30,
"last_edit_time":"2020-06-09T16:24:09.9204628+08:00",
"last_hash":"4a5854c6cc0d1930500e05353aff416b8cdd1859dc2c2af44b46089e23938023",
"owner":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"peer_id_a":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"peer_id_b":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"property_id":137,
"rsmc_input_txid":"a9e2e14939f5edadabd8675be6d160c73762e9d562b35594328150db968e32c3",
"rsmc_multi_address":"2N1CTdYvAfopS1qWQLGjqwTTqmKyWrSfuVY",
"rsmc_multi_address_script_pub_key":"a914573b2587a9f4672b6a2964c234d9b9d34d188dba87", "rsmc_redeem_script":"522102fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed821028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52ae",
"rsmc_temp_address_pub_key":"02fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed8", "rsmc_tx_hex":"0200000001c3328e96db5081329455b362d5e96237c760d1e65b67d8abadedf53949e1e2a900000000d900473044022037fa3ac0917d3bc965ede51cb330f0baf5cfe4da91e54988a521205378e66e4c022034d5c8cc347d617dd54f0f66fd4a2b47fb1aa8d417f575bbb45d5fa20add0c080147304402207c0f867a8fa3f2a02d0c09fe37af564170cda0090650974ca0eac993ff84ba1902206910dea102e9fcec49bd6453fb33579457e80f66cbaaaec46c7a4bb50613f0440147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03344700000000000017a914573b2587a9f4672b6a2964c234d9b9d34d188dba870000000000000000166a146f6d6e690000000000000089000000004d7c6d001c0200000000000017a914573b2587a9f4672b6a2964c234d9b9d34d188dba8700000000",
"rsmc_txid":"fa7751984b5991d025c07a59045e437477e6e2904e3141e0d2fd144210822c9f",
"send_at":"0001-01-01T00:00:00Z",
"sign_at":"2020-06-09T16:26:01.9381622+08:00", "to_counterparty_tx_hex":"0200000003e062124a8f5476cd4cff020894525d360f6d0ab4a8d2b357a90f328c3dabe2d900000000d90047304402207449af13fff3ea7cd979e348722859b1c49a59b163637276c83e2f625df4aece0220290e7b3e0208b1d0f896f554db33f097b5dac30c6fe825bfd4cc02789ea72e640147304402205121ded0913dc12e87cd1df3b1974f1bf3f14bd0c0d43bd9b05d74d67d143b9202207315984b7bdc16b623e7bd540c6d16f1c1a2412fd3d26cbe8d65b661caf13c100147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffffea5096b1864bcfa398486ca659dfb5711506d851fc4626075ecd388a65b6cdeb02000000d90047304402200aca4baf1229076ba939196e709be7eeb7efecba53ea935b3927dc2f238aa75c02205dac78ef8955dcd705e2dae5e3ae0947ab7196255b473e2fdc6ed268668ceb290147304402205c8fa21796390bbe4d3bb242f1b4b1bc660390824105d31dee1a685be1e94b69022035da7fba16c599735b0ae29d21ef8292b846e1800ef606c3e3f57fac5a3501d80147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aefffffffffcabe9c10966c7640e41fcbc1e597991d4da4edc2f6e257c6159c1d7c34a8b8200000000d900473044022045c297ed55c1909324b5c9ab3b4d4c8b7666c74eaada24c586324814b5e854bf02205b96cb0f81bbae680d228d5c023c20ed14d1a6eeb1aed98da4ef1330afecab40014730440220110a42b75af5e395d61aaf777ea8acf4eecf734f958f3cd9465d48e2a504c199022077fbd0618f7ba25b6d8de0a1a783d300f5621eba44700ed03ecb33c60499d2540147522102c57b02d24356e1d31d34d2e3a09f7d68a4bdec6c0556595bb6391ce5d6d4fc6621028f49447e1a20d4211c8c621976cff3d2ae00d4af79be3e74e05f1ed4e23f319e52aeffffffff03ea930000000000001976a9147a019f584f6a65d114d5f17264c9eb32f763d72c88ac0000000000000000166a146f6d6e6900000000000000890000000029b9270022020000000000001976a914ceb05f96f5b3cbd12d7bff5f9f45252b3f67bf7088ac00000000",
"to_counterparty_txid":"1a3960c81384be425d7364a6f10c416c4f49d15497b8012e63731593b2cf0a3d",
"tx_type":0
}
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
latestCommitmentTxInfo | ------- | result | the latest Commitment transaction infomation, for debugging purpose only. |
closeChannel
Simple Type -100038 Protocol
Type -100038 Protocol is used to close a channel.
Websocket Request: Message Type -100038
Request:
{
"type": -100038,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef"
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
Websocket Response: Message Type -110038
OBD Responses:
{
"type": -110038,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"to be updated": to be updated according to latest obd release.
}
}
closeChannelSigned
Simple Type -100039 Protocol
Type -100039 Protocol is used to response the request of closing a channel.
Websocket Request: Message Type -100039
Request:
{
"type":-100039,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id":"38e41ef5ba61c11642b2fa3ea93e8026ab7b057b06b64215f255669acf8dc0ef", "request_close_channel_hash":"4453e70ba9f2a805433b3696e43fd4175cabf45daf36aa59368ecf210f5773cb",
"approval":true
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data | |
request_close_channel_hash | ------- | data | hash of channel |
approval | ------- | data | true or false |
Websocket Response: Message Type -100039
OBD Responses:
{
"type": -100039,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2@/ip4/127.0.0.1/tcp/4001/p2p/QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"to":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"to be updated": to be updated according to latest obd release.
}
}
Contracts
atomicSwap
Simple Type -100080 Protocol
Type -100080 message notifies the counterparty an atomic swap is created. The background and process of atomic swap can be found here in chapter 5 of the OmniBOLT specification,
Websocket Request: Message Type -100080
Request:
{
"type":-100080,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id_from":"2e90c8e98074c9d711ef33c9b8ae9ff4437640f032e60ecf5626a4ca9b432b02",
"channel_id_to":"35b10b403eaf04ed9efc15d756105c4cd9c921f1d871411eda54d499409ec8e8",
"recipient_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0 ",
"property_sent":121,
"amount":20,
"exchange_rate":1.2,
"property_received":123,
"transaction_id":"238822cdb245dd8a392a5d0479b5488e38b21ce4192e77fa03f408796037d88e",
"time_locker":11
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id_from | ------- | data | the channel where the HTLC 1 for swap(pay token A for token B) is created. |
channel_id_to | ------- | data | the channel that need to create the corresponding HTLC 2 to pay token B. |
recipient_peer_id | ------- | body | the counterparty who accepts the swap, i.e the onwer of token B. |
property_sent | ------- | data | Token A. |
amount | ------- | data | Amount of token A. |
exchange_rate | ------- | data | exchange rate, which is price(token A)/price(token B). |
property_received | ------- | data | Token B. |
transaction_id | ------- | data | The transaction ID of the commitment tranaction of this HTLC 1. |
time_locker | ------- | data | The time locker of HTLC 1. |
Websocket Response: Message Type -110080
OBD Responses:
{
"type":-110080,
"status":true,
"from":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"to":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"result":{
"amount":20,
"channel_id_from":"2e90c8e98074c9d711ef33c9b8ae9ff4437640f032e60ecf5626a4ca9b432b02",
"channel_id_to":"35b10b403eaf04ed9efc15d756105c4cd9c921f1d871411eda54d499409ec8e8",
"exchange_rate":1.2,
"property_received":0,
"property_sent":121,
"recipient_peer_id":"39e8b1f3e7aec51a368d70eac6d47195099e55c6963d38bcd729b22190dcdae0",
"time_locker":11,
"transaction_id":"238822cdb245dd8a392a5d0479b5488e38b21ce4192e77fa03f408796037d88e"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false if the message is succesfully delivered. |
from | ------- | body | peer ID who creates the HTLC 1 for swap. |
to | ------- | body | peer ID who accept the swap or reject. |
channel_id_from | ------- | data | the channel where the HTLC 1 for swap(pay token A for token B) is created. |
channel_id_to | ------- | data | the channel that need to create the corresponding HTLC 2 to pay token B. |
recipient_peer_id | ------- | data | the counterparty who accepts the swap, i.e the onwer of token B. |
property_sent | ------- | data | Token A. |
amount | ------- | data | Amount of token A. |
exchange_rate | ------- | data | exchange rate, which is price(token A)/price(token B). |
property_received | ------- | data | Token B. |
transaction_id | ------- | data | The transaction ID of the commitment tranaction of this HTLC 1. |
time_locker | ------- | data | The time locker HTLC 1. |
acceptSwap
Simple Type -100081 Protocol
Type -100081 Protocol accepts or rejects a swap.
Websocket Request: Message Type -100081
Request:
{
"type":-100081,
"recipient_node_peer_id":"QmVEoTmyofsbEnsoFwQXHngafECHJuVfEgGyb2bZtyiont",
"recipient_user_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"data":{
"channel_id_from":"35b10b403eaf04ed9efc15d756105c4cd9c921f1d871411eda54d499409ec8e8",
"channel_id_to":"2e90c8e98074c9d711ef33c9b8ae9ff4437640f032e60ecf5626a4ca9b432b02",
"recipient_peer_id":"1f1dbb3518c1fb12f263d065c1d18576d13f88dff55bfc25ef52afaa2c97a5d2",
"property_sent":123,
"amount":20,
"exchange_rate":1.2,
"property_received":121,
"transaction_id":"f63385baf4607a59b87af4b85db7a6fc7ac3a785986e4ebd7fc008610335dfcc",
"target_transaction_id":"238822cdb245dd8a392a5d0479b5488e38b21ce4192e77fa03f408796037d88e",
"time_locker":11
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id_from | ------- | data | the channel that creates the corresponding HTLC 2 to pay token B. |
channel_id_to | ------- | data | the channel where the HTLC 1 for swap(pay token A for token B) is created. |
recipient_peer_id | ------- | body | the onwer of token A. |
property_sent | ------- | data | Token B. |
amount | ------- | data | Amount of token B. |
exchange_rate | ------- | data | exchange rate, which is price(token A)/price(token B). |
property_received | ------- | data | Token A. |
transaction_id | ------- | data | The transaction ID of the commitment tranaction of this HTLC 2. |
target_transaction_id | ------- | data | The transaction ID of the commitment tranaction of this HTLC 1. |
time_locker | ------- | data | The time locker of HTLC 2. |
Websocket Response: Message Type -100081
Query
getAllCommitmentTransactions
Simple Type -35101 Protocol
Type -35101 Protocol is used to get a list of commitment transactions in one channel.
Websocket Request: Message Type -35101
Request:
{
"type": -35101,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
Websocket Response:
OBD Responses:
{
"type": -35101,
"status":true,
"from":"<user_id>",
"to":"<user_id>",
"result":[{
"amount_b":0,
"amount_m":6,
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197],
"create_at":"2019-09-21T01:01:54.262628+08:00",
"create_by":"<user_id>",
"curr_hash":"8a55f150c34e2720a587dde3809e81959701e1dd3f78c1e1fc9960c132566fe0",
"curr_state":10,
"id":4,
"input_amount":6,
"input_txid":"c734f981de217a95764e565ffeb6464507fda588118754df3d4ec5cbe487fd3b",
"input_vout":2,
"last_commitment_tx_id":0,
"last_edit_time":"2019-09-21T01:01:54.262628+08:00",
"last_hash":"",
"multi_address":"2N3zxWFsT2nocWPiM7Qpc8rngQDv7PEX6yz",
"owner":"<user_id>",
"peer_id_a":"<user_id>",
"peer_id_b":"<user_id>",
"property_id":121,
"redeem_script":"522103ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952ae",
"script_pub_key":"a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac87",
"send_at":"0001-01-01T00:00:00Z",
"sign_at":"2019-09-21T01:01:54.704956+08:00",
"temp_address_pub_key":"03ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d",
"transaction_sign_hex_to_other":"",
"transaction_sign_hex_to_temp_multi_address":"0200000001685a7e84bc2d24fa01550674176a6b4bf366a99e001b5b52f2fc16c8b6146b2600000000d900473044022008df14db1d40c4c53dbf87903ed3604e6075a80d96c8efbdc0899218c813d1df02203dde10f2139286ba4a533ea28f3b25c1394a359e1bf7db0a8b4245981a2aab3b014730440220194ed787685360c7c3b1dc67328db680e8e8d9e201753550c585efcf355beee1022023bf97e53ae59110f0c5f4160a2df723747ba61d65db5d6af7cc93ba70cc5ace01475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff033c1900000000000017a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac870000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac8700000000",
"txid_to_other":"",
"txid_to_temp_multi_address":"8656156b4e70670745f0f9e46b64a84c7366bbad3182ebf135b6a5b60f10b1f1"
}]
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | peer id of fundee |
to | ------- | body | peer id of funder |
amount_m | ------- | result | total tokens in this channel |
channel_id | ------- | result | |
create_at | ------- | result | |
create_by | ------- | result | |
curr_hash | ------- | result | |
curr_state | ------- | result | |
id | ------- | result | |
input_amount | ------- | result | |
input_txid | ------- | result | |
input_vout | ------- | result | |
last_commitment_tx_id | ------- | result | |
last_edit_time | ------- | result | |
last_hash | ------- | result | |
multi_address | ------- | result | |
owner | ------- | result | |
peer_id_a | ------- | result | |
peer_id_b | ------- | result | |
property_id | ------- | result | |
redeem_script | ------- | result | |
script_pub_key | ------- | result | |
send_at | ------- | result | |
sign_at | ------- | result | |
temp_address_pub_key | ------- | result | |
transaction_sign_hex_to_other | ------- | result | |
transaction_sign_hex_to_temp_multi_address | ------- | result | |
txid_to_other | ------- | result | |
txid_to_temp_multi_address | ------- | result |
getLatestCommitmentTransaction
Simple Type -35104 Protocol
Type -35104 Protocol is used to get a latest commitment transaction.
Websocket Request: Message Type -35104
Request:
{
"type": -35104,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
Websocket Response:
OBD Responses:
{
"type": -35104,
"status":true,
"from":"<user_id>",
"to":"<user_id>",
"result":{
"amount_b":0,
"amount_m":6,
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197],
"create_at":"2019-09-21T01:01:54.262628+08:00",
"create_by":"<user_id>",
"curr_hash":"8a55f150c34e2720a587dde3809e81959701e1dd3f78c1e1fc9960c132566fe0",
"curr_state":10,
"id":4,
"input_amount":6,
"input_txid":"c734f981de217a95764e565ffeb6464507fda588118754df3d4ec5cbe487fd3b",
"input_vout":2,
"last_commitment_tx_id":0,
"last_edit_time":"2019-09-21T01:01:54.262628+08:00",
"last_hash":"",
"multi_address":"2N3zxWFsT2nocWPiM7Qpc8rngQDv7PEX6yz",
"owner":"<user_id>",
"peer_id_a":"<user_id>",
"peer_id_b":"<user_id>",
"property_id":121,
"redeem_script":"522103ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952ae","script_pub_key":"a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac87",
"send_at":"0001-01-01T00:00:00Z",
"sign_at":"2019-09-21T01:01:54.704956+08:00",
"temp_address_pub_key":"03ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d",
"transaction_sign_hex_to_other":"",
"transaction_sign_hex_to_temp_multi_address":"0200000001685a7e84bc2d24fa01550674176a6b4bf366a99e001b5b52f2fc16c8b6146b2600000000d900473044022008df14db1d40c4c53dbf87903ed3604e6075a80d96c8efbdc0899218c813d1df02203dde10f2139286ba4a533ea28f3b25c1394a359e1bf7db0a8b4245981a2aab3b014730440220194ed787685360c7c3b1dc67328db680e8e8d9e201753550c585efcf355beee1022023bf97e53ae59110f0c5f4160a2df723747ba61d65db5d6af7cc93ba70cc5ace01475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff033c1900000000000017a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac870000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a91475f6a2aa9461985bed4b847104ca81b73cf2f1ac8700000000",
"txid_to_other":"",
"txid_to_temp_multi_address":"8656156b4e70670745f0f9e46b64a84c7366bbad3182ebf135b6a5b60f10b1f1"
}
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | peer id of funder |
to | ------- | body | peer id of fundee |
amount_b | ------- | result | none required |
amount_m | ------- | result | how much has been funded |
channel_id | ------- | result | |
create_at | ------- | result | |
create_by | ------- | result | created by the funder |
curr_hash | ------- | result | |
curr_state | ------- | result | |
id | ------- | result | |
input_amount | ------- | result | |
input_txid | ------- | result | |
input_vout | ------- | result | |
last_commitment_tx_id | ------- | result | |
last_edit_time | ------- | result | |
last_hash | ------- | result | |
multi_address | ------- | result | |
owner | ------- | result | |
peer_id_a | ------- | result | |
peer_id_b | ------- | result | |
property_id | ------- | result | |
redeem_script | ------- | result | |
script_pub_key | ------- | result | |
send_at | ------- | result | |
sign_at | ------- | result | |
temp_address_pub_key | ------- | result | |
transaction_sign_hex_to_other | ------- | result | |
transaction_sign_hex_to_temp_multi_address | ------- | result | |
txid_to_other | ------- | result | |
txid_to_temp_multi_address | ------- | result |
getLatestRevockableDeliveryTransaction
Simple Type -35105 Protocol
Type -35105 Protocol is used to get a latest Revockable Delivery transaction.
Websocket Request: Message Type -35105
Request:
{
"type": -35105,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getLatestBreachRemedyTransaction
Simple Type -35106 Protocol
Type -35106 Protocol is used to get a latest Breach Remedy transaction.
Websocket Request: Message Type -35106
Request:
{
"type": -35106,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getAllRevockableDeliveryTransactions
Simple Type -35108 Protocol
Type -35108 Protocol is used to get all of Revockable Delivery transactions.
Websocket Request: Message Type -35108
Request:
{
"type": -35108,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getAllBreachRemedyTransactions
Simple Type -35109 Protocol
Type -35109 Protocol is used to get all of Breach Remedy transactions.
Websocket Request: Message Type -35109
Request:
{
"type": -35109,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getAllChannels
Simple Type -3202 Protocol
Type -3202 Protocol is used to get all of channels.
Websocket Request: Message Type -3202
Request:
{
"type": -3202,
}
This message has no arguments.
getChannelDetail
Simple Type -3207 Protocol
Type -3207 Protocol is used to get detail data of a channel.
Websocket Request: Message Type -3207
Request:
{
"type": -3207,
"data": <id>,
}
Parameter | default | placement | Description |
---|---|---|---|
id | ------- | data | id of channel in database table |
getAllBroadcastedCommitmentTransactions
Simple Type -35110 Protocol
Type -35110 Protocol is used to get all of Broadcasted Commitment Transactions.
Websocket Request: Message Type -35110
Request:
{
"type": -35110,
"data":{
"channel_id":[59,253,135,228,203,197,78,61,223,84,135,17,136,165,253,7,69,70,182,254,95,86,78,118,149,122,33,222,129,249,52,197]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getH
Simple Type -4001 Protocol
Type -4001 Protocol is used to get a list of H (Hash_Preimage_R).
Only HTLC creator can query
Websocket Request: Message Type -4001
Request:
{
"type": -4001
}
This message has no arguments.
getR
Simple Type -4101 Protocol
Type -4101 Protocol is used to get a list of R (Preimage_R).
Only HTLC Receiever can query
Websocket Request: Message Type -4101
Request:
{
"type": -4101
}
This message has no arguments.
Websocket Response:
OBD Responses:
{
"type": -4101,
"status": true,
"from": "<user_id>",
"to": "<user_id>",
"result": [
{
"amount": 5,
"create_at": "2019-11-04T15:02:25.2004375+08:00",
"create_by": "<user_id>",
"curr_state": 20,
"h": "83519233492eb05ddd547757f2c3d151ad9392b2ebf48fc1a88e07e61dd82a45",
"id": 1,
"property_id": 121,
"r": "2de142c8006a3462241e96a610b59f3d92d8259c",
"recipient_peer_id": "<user_id>",
"request_hash": "742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
"sender_peer_id": "<user_id>",
"sign_at": "2019-11-04T15:08:31.5417759+08:00",
"sign_by": "<user_id>"
},
{
"amount": 5,
"create_at": "2019-11-06T08:02:50.8302374+08:00",
"create_by": "<user_id>",
"curr_state": 20,
"h": "e7626f2b7207006d6515399c587c09c3bfb5ed3b12f63c12b0d40e634f9dd9a3",
"id": 2,
"property_id": 121,
"r": "2de142c8006a3462241e96a610b59f3d92d8259c",
"recipient_peer_id": "<user_id>",
"request_hash": "1fe82bc9152741670c4ee2b4853df9346c1cc63fce6d1c896e7eeca8cc62c9d9",
"sender_peer_id": "<user_id>",
"sign_at": "2019-11-06T08:03:41.3545586+08:00",
"sign_by": "<user_id>"
}
]
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
amount | ------- | result | |
create_at | ------- | result | |
create_by | ------- | result | |
curr_state | ------- | result | |
h | ------- | result | |
id | ------- | result | |
property_id | ------- | result | |
r | ------- | result | |
recipient_peer_id | ------- | result | |
request_hash | ------- | result | |
sender_peer_id | ------- | result | |
sign_at | ------- | result | |
sign_by | ------- | result |
getRWithChannelID
Simple Type -4103 Protocol
Type -4103 Protocol is used to get the R (Preimage_R) by a channel id.
Only middleman node can query
Websocket Request: Message Type -4103
Request:
{
"type":-4103,
"data":{
"channel_id":[223,177,75,185,186,22,47,155,145,238,242,1,158,247,192,1,48,183,197,192,190,72,49,233,62,65,156,103,111,172,109,51]
}
}
Parameter | default | placement | Description |
---|---|---|---|
channel_id | ------- | data |
getRoutingWithH
Simple Type -4104 Protocol
Type -4104 Protocol is used to get routing info by the H (Hash_Preimage_R).
Websocket Request: Message Type -4104
Request:
{
"type":-4104,
"data":"77aba5c815ad8143da057a3fcc6c1132368110302431987c5d6f260253956f3b"
}
Parameter | default | placement | Description |
---|---|---|---|
h | ------- | data | the H (Hash_Preimage_R) |
getRWithH
Simple Type -4105 Protocol
Type -4105 Protocol is used to get the R (Preimage_R) by a H (Hash_Preimage_R).
HTLC Receiever can query
Websocket Request: Message Type -4105
Request:
{
"type":-4105,
"data":"e7626f2b7207006d6515399c587c09c3bfb5ed3b12f63c12b0d40e634f9dd9a3"
}
Parameter | default | placement | Description |
---|---|---|---|
H | ------- | data | Hash_Preimage_R |
Websocket Response:
OBD Responses:
{
"type": -4105,
"status": true,
"from": "<user_id>",
"to": "<user_id>",
"result": "\"2de142c8006a3462241e96a610b59f3d92d8259c\""
}
Parameter | default | placement | Description |
---|---|---|---|
status | ------- | body | true or false |
from | ------- | body | sender |
to | ------- | body | receiever |
r | ------- | result | the R (Preimage_R) |
OBD gRPC API Reference
This is the gRPC API reference documentation for omnibolt daemon.
The grpc API is offered when your obd runs in exclusive mode, which is that only you are able to connect the obd instance. This is the mode same to lnd. We suggest you to visit the link below for obd architecture:
https://omnilaboratory.github.io/obd/#/Architecture?id=exclusive-mode
In exclusive mode, connection type is http protocol between client and obd currently.
The proto files are here:
https://github.com/omnilaboratory/obd/tree/master/proxy/pb
Code examples invoking obd API use grpcurl
command line tool:
Github repo is here: https://github.com/fullstorydev/grpcurl/
HTLC
AddInvoice
Unary RPC
AddInvoice attempts to add a new invoice to the invoice database.
$ grpcurl -plaintext -d '{"cltv_expiry":<string>, "value":<double>, "property_id":<int64>, "private":<bool>}' localhost:50051 proxy.Htlc/AddInvoice
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('htlc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let htlc = new obdrpc.Htlc('localhost:50051', grpc.credentials.createInsecure());
let request = {
property_id: <int64>,
value: <double>,
memo: <string>,
cltv_expiry: <string>,
private: <bool>,
};
htlc.AddInvoice(request, function(err, response) {
console.log(response);
});
gRPC Request: [Invoice]
Parameter | Type | Description |
---|---|---|
property_id | int64 | assets id |
value | double | amount of transfer |
memo | string | |
cltv_expiry | string | expiry time. |
private | bool | true to private channel or false to open channel. |
gRPC Response: [AddInvoiceResponse]
Parameter | Type | Description |
---|---|---|
payment_request | string |
ListInvoices
Unary RPC
ListInvoices returns a list of all the invoices currently stored within the database. Any active debug invoices are ignored. It has full support for paginated responses, allowing users to query for specific invoices through their add_index. This can be done by using either the first_index_offset or last_index_offset fields included in the response as the index_offset of the next request. By default, the first 100 invoices created will be returned. Backwards pagination is also supported through the Reversed flag.
$ grpcurl -plaintext -d '{"index_offset":<uint64>, "num_max_invoices":<uint64>, "reversed":<bool>}' localhost:50051 proxy.Htlc/ListInvoices
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('htlc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let htlc = new obdrpc.Htlc('localhost:50051', grpc.credentials.createInsecure());
let request = {
index_offset: <uint64>,
num_max_invoices: <uint64>,
reversed: <bool>,
};
htlc.ListInvoices(request, function(err, response) {
console.log(response);
});
gRPC Request: [ListInvoiceRequest]
Parameter | Type | Description |
---|---|---|
index_offset | uint64 | The index of an invoice that will be used as either the start or end of a query to determine which invoices should be returned in the response. |
num_max_invoices | uint64 | The max number of invoices to return in the response to this query. |
reversed | bool | If set, the invoices returned will result from seeking backwards from the specified index offset. This can be used to paginate backwards. |
gRPC Response: [ListInvoiceResponse]
Parameter | Type | Description |
---|---|---|
invoices | Invoice | A list of invoices from the time slice of the time series specified in the request. |
last_index_offset | uint64 | The index of the last item in the set of returned invoices. This can be used to seek further, pagination style. |
first_index_offset | uint64 | The index of the last item in the set of returned invoices. This can be used to seek backwards, pagination style. |
ParseInvoice
Unary RPC
ParseInvoice decodes the payment_request
and get out all of details from an invoice.
$ grpcurl -plaintext -d '{"payment_request":<string>}' localhost:50051 proxy.Htlc/ParseInvoice
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('htlc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let htlc = new obdrpc.Htlc('localhost:50051', grpc.credentials.createInsecure());
let request = {
payment_request: <string>,
};
htlc.ParseInvoice(request, function(err, response) {
console.log(response);
});
gRPC Request: [ParseInvoiceRequest]
Parameter | Type | Description |
---|---|---|
payment_request | string |
gRPC Response: [ParseInvoiceResponse]
Parameter | Type | Description |
---|---|---|
property_id | int64 | assets id |
value | double | amount of transfer |
memo | string | |
cltv_expiry | string | expiry time. |
private | bool | true to private channel or false to open channel. |
h | string | preimage |
recipient_node_peer_id | string | |
recipient_user_peer_id | string |
SendPayment
Unary RPC
SendPayment attempts to route a payment described by the passed PaymentRequest to the final destination. The call returns payment data.
$ grpcurl -plaintext -d '{"payment_request":<string>, "invoice_detail":<ParseInvoiceResponse>}' localhost:50051 proxy.Htlc/SendPayment
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('htlc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let htlc = new obdrpc.Htlc('localhost:50051', grpc.credentials.createInsecure());
let request = {
payment_request: <string>,
invoice_detail: <ParseInvoiceResponse>,
};
htlc.SendPayment(request, function(err, response) {
console.log(response);
});
gRPC Request: [SendRequest]
Parameter | Type | Description |
---|---|---|
payment_request | string | |
invoice_detail | ParseInvoiceResponse |
gRPC Response: [SendResponse]
Parameter | Type | Description |
---|---|---|
payment_hash | string | |
payment_preimage | string | |
amount_to_rsmc | double | |
amount_to_htlc | double | |
amount_to_counterparty | double |
Lightning
ChannelBalance
Unary RPC
ChannelBalance returns a report on the total funds across all open channels, categorized in local/remote, pending local/remote and unsettled local/remote balances.
$ grpcurl -plaintext localhost:50051 proxy.Lightning/ChannelBalance
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
lightning.ChannelBalance(request, function(err, response) {
console.log(response);
});
gRPC Request: [ChannelBalanceRequest]
This request has no parameters.
gRPC Response: [ChannelBalanceResponse]
Parameter | Type | Description |
---|---|---|
local_balance | double | Sum of channels local balances. |
remote_balance | double | Sum of channels remote balances. |
unsettled_local_balance | double | Sum of channels local unsettled balances. |
unsettled_remote_balance | double | Sum of channels remote unsettled balances. |
pending_open_local_balance | double | Sum of channels pending local balances. |
pending_open_remote_balance | double | Sum of channels pending remote balances. |
ConnectPeer
Unary RPC
ConnectPeer attempts to establish a connection to a remote peer. This is at the networking level, and is used for communication between nodes. This is distinct from establishing a channel with a peer.
$ grpcurl -plaintext -d '{"addr":<string>}' localhost:50051 proxy.Lightning/ConnectPeer
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
addr: <string>,
};
lightning.ConnectPeer(request, function(err, response) {
console.log(response);
});
gRPC Request: [ConnectPeerRequest]
Parameter | Type | Description |
---|---|---|
addr | string | address of the peer |
gRPC Response: [ConnectPeerResponse]
This response has no parameters.
DisconnectPeer
Unary RPC
DisconnectPeer attempts to disconnect one peer from another identified. In the case that we currently have a pending or active channel with the target peer, then this action will be not be allowed.
$ grpcurl -plaintext -d '{"addr":<string>}' localhost:50051 proxy.Lightning/DisconnectPeer
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
addr: <string>,
};
lightning.DisconnectPeer(request, function(err, response) {
console.log(response);
});
gRPC Request: DisconnectPeerRequest
Parameter | Type | Description |
---|---|---|
addr | string | address of the peer |
gRPC Response: DisconnectPeerResponse
This response has no parameters.
FundChannel
Unary RPC
FundChannel attempts to fund some bitcoin for miner fee and omni assets into a channel.
$ grpcurl -plaintext -d '{"template_channel_id":<string>, "btc_amount":<double>, "property_id":<int64>, "asset_amount":<double>, "recipientInfo":<RecipientNodeInfo>}' localhost:50051 proxy.Lightning/FundChannel
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
template_channel_id: <string>,
btc_amount: <double>,
property_id: <int64>,
asset_amount: <double>,
recipientInfo: <RecipientNodeInfo>,
};
lightning.FundChannel(request, function(err, response) {
console.log(response);
});
gRPC Request: [FundChannelRequest]
Parameter | Type | Description |
---|---|---|
template_channel_id | string | |
btc_amount | double | bitcoin for miner fee |
property_id | int64 | ID of an omni asset |
asset_amount | double | |
recipientInfo | RecipientNodeInfo |
gRPC Response: [FundChannelResponse]
Parameter | Type | Description |
---|---|---|
channel_id | string |
GetTransactions
Unary RPC
GetTransactions returns a list describing all the known transactions relevant to a specified channel.
$ grpcurl -plaintext -d '{"channel_id":<string>, "page_size":<int32>, "page_index":<int32>}' localhost:50051 proxy.Lightning/GetTransactions
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
channel_id: <string>,
page_size: <int32>,
page_index: <int32>,
};
lightning.GetTransactions(request, function(err, response) {
console.log(response);
});
gRPC Request: [GetTransactionsRequest]
Parameter | Type | Description |
---|---|---|
channel_id | string | |
page_size | int32 | |
page_index | int32 |
gRPC Response: [TransactionDetails]
Parameter | Type | Description |
---|---|---|
transactions | Transaction | The list of transactions relevant to the specified channel. |
total_count | int32 | |
page_size | int32 | |
page_index | int32 |
LatestTransaction
Unary RPC
LatestTransaction returns the latest transaction from specified channel.
$ grpcurl -plaintext -d '{"channel_id":<string>}' localhost:50051 proxy.Lightning/LatestTransaction
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
channel_id: <string>,
};
lightning.LatestTransaction(request, function(err, response) {
console.log(response);
});
gRPC Request: [LatestTransactionRequest]
Parameter | Type | Description |
---|---|---|
channel_id | string |
gRPC Response: [Transaction]
Parameter | Type | Description |
---|---|---|
channel_id | string | |
amount_a | double | |
amount_b | double | |
peer_a | string | |
peer_b | string | |
curr_state | int32 | |
tx_hash | string | |
tx_type | int32 | |
h | string | |
r | string | |
amount_htlc | string |
ListChannels
Unary RPC
ListChannels returns a description of all the open channels that this node is a participant in.
$ grpcurl -plaintext -d '{"active_only":<bool>, "inactive_only":<bool>, "public_only":<bool>, "private_only":<bool>, "peer":<bytes>, "page_size":<int32>, "page_index":<int32>}' localhost:50051 proxy.Lightning/ListChannels
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
active_only: <bool>,
inactive_only: <bool>,
public_only: <bool>,
private_only: <bool>,
peer: <bytes>,
page_size: <int32>,
page_index: <int32>,
};
lightning.ListChannels(request, function(err, response) {
console.log(response);
});
gRPC Request: [ListChannelsRequest]
Parameter | Type | Description |
---|---|---|
active_only | bool | |
inactive_only | bool | |
public_only | bool | |
private_only | bool | |
peer | bytes | Filters the response for channels with a target peer's pubkey. If peer is empty, all channels will be returned. |
page_size | int32 | |
page_index | int32 |
gRPC Response: [ListChannelsResponse]
Parameter | Type | Description |
---|---|---|
channels | Channel | The list of active channels |
OpenChannel
Unary RPC
OpenChannel attempts to open a singly funded channel specified in the request to a remote peer.
$ grpcurl -plaintext -d '{"node_pubkey_string":<string>, "private":<bool>, "recipientInfo":<RecipientNodeInfo>}' localhost:50051 proxy.Lightning/OpenChannel
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
node_pubkey_string: <string>,
private: <bool>,
recipientInfo: <RecipientNodeInfo>,
};
lightning.OpenChannel(request, function(err, response) {
console.log(response);
});
gRPC Request: [OpenChannelRequest]
Parameter | Type | Description |
---|---|---|
node_pubkey_string | string | The pubkey of the node to open a channel with. |
private | bool | true to private channel or false to open channel. |
recipientInfo | RecipientNodeInfo |
gRPC Response: [OpenChannelResponse]
Parameter | Type | Description |
---|---|---|
template_channel_id | string |
PendingChannels
Unary RPC
PendingChannels returns a list of all the channels that are currently considered "pending". A channel is pending if it has finished the funding workflow and is waiting for confirmations for the funding txn, or is in the process of closure, either initiated cooperatively or non-cooperatively.
$ grpcurl -plaintext -d '{"page_size":<int32>, "page_index":<int32>}' localhost:50051 proxy.Lightning/PendingChannels
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let lightning = new obdrpc.Lightning('localhost:50051', grpc.credentials.createInsecure());
let request = {
page_size: <int32>,
page_index: <int32>,
};
lightning.PendingChannels(request, function(err, response) {
console.log(response);
});
gRPC Request: [PendingChannelsRequest]
Parameter | Type | Description |
---|---|---|
page_size | int32 | |
page_index | int32 |
gRPC Response: [ListChannelsResponse]
Parameter | Type | Description |
---|---|---|
channels | Channel | The list of active channels |
Rsmc
RsmcPayment
Unary RPC
RsmcPayment attempts to send a payment with RSMC.
$ grpcurl -plaintext -d '{"channel_id":<string>, "amount":<double>, "recipientInfo":<RecipientNodeInfo>}' localhost:50051 proxy.Rsmc/RsmcPayment
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rsmc.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let rsmc = new obdrpc.Rsmc('localhost:50051', grpc.credentials.createInsecure());
let request = {
channel_id: <string>,
amount: <double>,
recipientInfo: <RecipientNodeInfo>,
};
rsmc.RsmcPayment(request, function(err, response) {
console.log(response);
});
gRPC Request: [RsmcPaymentRequest]
Parameter | Type | Description |
---|---|---|
channel_id | string | |
amount | double | |
recipientInfo | RecipientNodeInfo |
gRPC Response: [RsmcPaymentResponse]
Parameter | Type | Description |
---|---|---|
channel_id | string | |
amount_a | double | |
amount_b | double |
Wallet
ChangePassword
Unary RPC
ChangePassword change the password as known the login_token
that used to login by administrator.
$ grpcurl -plaintext -d '{"current_password":<string>, "new_password":<string>}' localhost:50051 proxy.Wallet/ChangePassword
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
current_password: <string>,
new_password: <string>,
};
wallet.ChangePassword(request, function(err, response) {
console.log(response);
});
gRPC Request: [ChangePasswordRequest]
Parameter | Type | Description |
---|---|---|
current_password | string | |
new_password | string |
gRPC Response: [ChangePasswordResponse]
Parameter | Type | Description |
---|---|---|
result | string |
EstimateFee
Unary RPC
EstimateFee asks the chain backend to estimate the fee rate and total fees for a transaction that pays to multiple specified outputs.
$ grpcurl -plaintext -d '{"conf_target":<int32>}' localhost:50051 proxy.Wallet/EstimateFee
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
conf_target: <int32>,
};
wallet.EstimateFee(request, function(err, response) {
console.log(response);
});
gRPC Request: [EstimateFeeRequest]
Parameter | Type | Description |
---|---|---|
conf_target | int32 | The target number of blocks that this transaction should be confirmed by. |
gRPC Response: [EstimateFeeResponse]
Parameter | Type | Description |
---|---|---|
sat_per_kw | int64 | The total fee in satoshis. |
GetInfo
Unary RPC
GetInfo returns general information concerning the lightning node including it's identity pubkey, alias, the chains it is connected to, and information concerning the number of open+pending channels.
$ grpcurl -plaintext localhost:50051 proxy.Wallet/GetInfo
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
wallet.GetInfo(request, function(err, response) {
console.log(response);
});
gRPC Request: [GetInfoRequest]
This request has no parameters.
gRPC Response: [GetInfoResponse]
Parameter | Type | Description |
---|---|---|
user_peerId | string | |
node_peerId | string | |
node_address | string | |
htlc_fee_rate | double | |
htlc_max_fee | double | |
chain_node_type | string | |
is_admin | bool |
GenSeed
Unary RPC
GenSeed is the first method that should be used to instantiate a new obd instance. This method allows a caller to generate a new aezeed cipher seed given an optional passphrase.
$ grpcurl -plaintext -d '{"aezeed_passphrase":<bytes>, "seed_entropy":<bytes>}' localhost:50051 proxy.Wallet/GenSeed
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
aezeed_passphrase: <bytes>,
seed_entropy: <bytes>,
};
wallet.GenSeed(request, function(err, response) {
console.log(response);
});
gRPC Request: [GenSeedRequest]
Parameter | Type | Description |
---|---|---|
aezeed_passphrase | bytes | aezeed_passphrase is an optional user provided passphrase that will be used to encrypt the generated aezeed cipher seed. |
seed_entropy | bytes | seed_entropy is an optional 16-bytes generated via CSPRNG. If not specified, then a fresh set of randomness will be used to create the seed. |
gRPC Response: [GenSeedResponse]
Parameter | Type | Description |
---|---|---|
cipher_seed_mnemonic | string | cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed cipher seed obtained by the user. This field is optional, as if not provided, then the daemon will generate a new cipher seed for the user. Otherwise, then the daemon will attempt to recover the wallet state linked to this cipher seed. |
enciphered_seed | string | enciphered_seed are the raw aezeed cipher seed bytes. This is the raw cipher text before run through our mnemonic encoding scheme. |
ListPeers
Unary RPC
ListPeers returns a verbose listing of all currently active peers.
$ grpcurl -plaintext localhost:50051 proxy.Wallet/ListPeers
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
wallet.ListPeers(request, function(err, response) {
console.log(response);
});
gRPC Request: [ListPeersRequest]
This request has no parameters.
gRPC Response: [ListPeersResponse]
Parameter | Type | Description |
---|---|---|
peers | Peer | The list of currently connected peers |
Login
Unary RPC
Login attempts to login to an obd instance with administrator role.
$ grpcurl -plaintext -d '{"mnemonic":<string>, "login_token":<string>}' localhost:50051 proxy.Wallet/Login
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
mnemonic: <string>,
login_token: <string>,
};
wallet.Login(request, function(err, response) {
console.log(response);
});
gRPC Request: [LoginRequest]
Parameter | Type | Description |
---|---|---|
mnemonic | string | mnemonic words |
login_token | string | as known password |
gRPC Response: [LoginResponse]
Parameter | Type | Description |
---|---|---|
user_peerId | string | |
node_peerId | string | |
node_address | string | |
htlc_fee_rate | double | |
htlc_max_fee | double | |
chain_node_type | string |
Logout
Unary RPC
Logout attempts to logout from an obd instance.
$ grpcurl -plaintext localhost:50051 proxy.Wallet/Logout
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
wallet.Logout(request, function(err, response) {
console.log(response);
});
gRPC Request: [LogoutRequest]
This request has no parameters.
gRPC Response: [LogoutResponse]
This response has no parameters.
NextAddr
Unary RPC
NextAddr returns the next unused address within the wallet.
$ grpcurl -plaintext localhost:50051 proxy.Wallet/NextAddr
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
wallet.NextAddr(request, function(err, response) {
console.log(response);
});
gRPC Request: [AddrRequest]
This request has no parameters.
gRPC Response: [AddrResponse]
Parameter | Type | Description |
---|---|---|
addr | string | The address encoded using a bech32 format. |
NewAddress
Unary RPC
NewAddress creates a new address under control of the local wallet.
$ grpcurl -plaintext localhost:50051 proxy.Wallet/NewAddress
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('wallet.proto', loaderOptions);
const obdrpc = grpc.loadPackageDefinition(packageDefinition).proxy;
let wallet = new obdrpc.Wallet('localhost:50051', grpc.credentials.createInsecure());
let request = {
};
wallet.NewAddress(request, function(err, response) {
console.log(response);
});
gRPC Request: [NewAddressRequest]
This request has no parameters.
gRPC Response: [NewAddressResponse]
Parameter | Type | Description |
---|---|---|
addr | string | The address encoded using a bech32 format. |