NAV Navbar
shell javascript golang

OmniBOLT Daemon Websocket Messages 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), which provides the complete services of token transactions on bitcoin network. 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:

For kernel developers in our community, the above steps are the easiest way to get started. Just open LightningOnOmni project with your favorit golang editor, run OBD in debug mode, setup break points, and send messages from your websocket-test-client. You may intercept the messages and track message flows of OBD kernel.

SignUp

Simple Type 101 Protocol

Type 101 Protocol is used to sign up a new user by hirarchecal deterministic wallet system. It returns mnemonic words as a UserID.

Websocket Request: Message Type 101

Sign up request:

{
    "type":101
}

This request has no parameters.

Websocket Response:

OBD Response:

{
    "type":101,
    "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 response data from OBD

LogIn

Simple Type 1 Protocol

Type 1 Protocol is used to login to OBD.

Websocket Request: Message Type 1

Login request:

{
    "type":1,
    "data":{
        "mnemonic":"< mnemonic words generated by OBD >"
    }
}
Parameter default placement Description
mnemonic ------- data mnemonic words generated by OBD

Websocket Response:

OBD Response:

{
    "type":1,
    "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

OpenChannel

Simple Type -32 Protocol

Type -32 Protocol is used to request to create a channel with someone.

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 -32

Request:

{
    "type":-32,
    "data":{
        "funding_pubkey":"021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d"
    },
    "recipient_peer_id":"<user_id>"
}
Parameter default placement Description
funding pubkey ------- data public key of funder, who wish to deposite BTC and other tokens to the channel
recipient_peer_id ------- body peer id of the fundee.

Websocket Response:

OBD Response:

{
    "type":-32,
    "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":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "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

ChannelAcceptor

Simple Type -33 Protocol

Type -33 Protocol is used to response to request of creating channel.

Bob replies to accept, his OBD completes his message and routes it to Alice's OBD. Then Alice sees the response of acceptance.

Websocket Request: Message Type -33

Request:

{
    "type":-33,
    "data":{
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "funding_pubkey":"03efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce9",
        "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 or false to deny.

Websocket Response:

OBD Response:

{
    "type":-33,
    "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":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "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":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "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

SendBitcoin

Simple Type 1009 Protocol

Type 1009 Protocol is used for transfering bitcoin.

Websocket Request: Message Type 1009

Request:

{
    "type":1009,
    "data":{
        "from_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
        "from_address_private_key":"cUAdadTkjeVFsNz5ifhkETfAzk5PvhnLWtmdSKgbyTTjSCE4MYWy",
        "to_address":"2N1DFjaE4yCcECdFwgLQcLmNrLV5zetgQtE",
        "amount":0.0001,
        "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
miner_fee 0.00001 data

Websocket Response:

OBD Responses:

{
    "type":1009,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":
    {
        "hex":"0200000001c77e31c262301a13d0fa6cec9827b25017bd30fb1ad3793b2c8ff66461fc7ab5000000006a473044022047c441b3f34bcce960f667391941a4db29de16bb00dbee97d4c85f60995d4b5102201a4f2d13a0cc22e7e62ee3fe04d0cc7dd36e375108a9242ede7aa718a5c5578a0121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff02102700000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468748170f00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac00000000",
        "txid":"266b14b6c816fcf2525b1b009ea966f34b6b6a1774065501fa242dbc847e5a68"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
hex ------- result
txid ------- result transaction id

NotifySendingBitcoin

Simple Type -3400 Protocol

Type -3400 Protocol is used to notify the transfering bitcoin event to the partner of the channel .

Alice tells her OBD to notify Bob that she created the funding transaction by payloads packed in the message -3400.

Websocket Request: Message Type -3400

Request:

{
    "type":-3400,
    "data":{
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "channel_address_private_key":"cUAdadTkjeVFsNz5ifhkETfAzk5PvhnLWtmdSKgbyTTjSCE4MYWy",           "funding_tx_hex":"0200000001c77e31c262301a13d0fa6cec9827b25017bd30fb1ad3793b2c8ff66461fc7ab5000000006a473044022047c441b3f34bcce960f667391941a4db29de16bb00dbee97d4c85f60995d4b5102201a4f2d13a0cc22e7e62ee3fe04d0cc7dd36e375108a9242ede7aa718a5c5578a0121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff02102700000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468748170f00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac00000000"
    }
}
Parameter default placement Description
temporary_channel_id ------- data
channel_address_private_key ------- data private key of the channel that Alice holds
funding_tx_hex ------- data

Websocket Response:

OBD Responses:

{
    "type":-3400,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":
    {
        "amount":0.0001,
        "funding_txid":"266b14b6c816fcf2525b1b009ea966f34b6b6a1774065501fa242dbc847e5a68",
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183]
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
amount ------- result
funding_txid ------- result funding transaction id
temporary_channel_id ------- result

ResponseSendingBitcoin

Simple Type -3500 Protocol

Type -3500 Protocol is used to response the transfering bitcoin event by the partner of the channel .

Bob tells his OBD to reply Alice that he knows the funding by message -3500.

Websocket Request: Message Type -3500

Request:

{
    "type":-3500,
    "data":{
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "channel_address_private_key":"cV6dif91LHD8Czk8BTgvYZR3ipUrqyMDMtUXSWsThqpHaQJUuHKA",
        "funding_txid":"266b14b6c816fcf2525b1b009ea966f34b6b6a1774065501fa242dbc847e5a68",
        "approval":true
        }
}
Parameter default placement Description
temporary_channel_id ------- data
channel_address_private_key ------- data private key of the channel that Bob holds
funding_txid ------- data
approval ------- data true or false

Websocket Response:

OBD Responses:

{
    "type":-3500,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":
    {
        "channel_id":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
        "create_at":"2019-09-21T00:14:42.17012+08:00",
        "id":3,
        "owner":"<user_id>",
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],
        "tx_hash":"0200000001685a7e84bc2d24fa01550674176a6b4bf366a99e001b5b52f2fc16c8b6146b2600000000d90047304402206724a55a5f58c8cc0325e5b2d7e9bce844c621194777a2bac4ae18f0794fe316022038beaa93be8cd70b7337b68c9fb48377c4833739a1165e3104db8b50a6d75573014730440220723785063cd4767cd275d6f861ab3147b29ba8035123ca140d6c09f329562cac02200d3e25d2b2e10975bcf98241715c87d8c380e92fa5aad7e8470da1d2e260ff3701475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff01581b0000000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac00000000",
        "txid":"cd30f25260a7d5971949802974f57da45341146404ebb26db3917ef5bc841b9e"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of fundee
to ------- body peer id of funder
channel_id ------- result
create_at ------- result
id ------- result
owner ------- result the funder is the owner
temporary_channel_id ------- result
tx_hash ------- result hash of transaction
txid ------- result transaction id

SendOmniAsset

Simple Type 2001 Protocol

Type 2001 Protocol is used for transfering omni assets.

Websocket Request: Message Type 2001

Request:

{
    "type":2001,
    "data":{
        "from_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
        "from_address_private_key":"cUAdadTkjeVFsNz5ifhkETfAzk5PvhnLWtmdSKgbyTTjSCE4MYWy",
        "to_address":"2N1DFjaE4yCcECdFwgLQcLmNrLV5zetgQtE",
        "amount":6,
        "property_id": 121
    }
}
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":2001,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":{
        "hex":"02000000016aabc30d6ef0d7e1d02572ca30450421a7541b7bf3d9b9937240b977b228215c010000006a473044022077352945e8cbc96475ba6e8af7f808980eeb93560ecca416dc5e94e561af0ebe022044a1c15a436594bade0db2a955e05b629d8611f15b3603aea13100b0ec2798900121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff0384b30e00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac0000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468700000000"
        "txid":"missing??? our development team?"   
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
hex ------- result
txid ------- result transaction id

NotifySendingOmniAsset

Simple Type -34 Protocol

Type -34 Protocol is used to notify the transfering omni asset event to the partner of the channel .

Websocket Request: Message Type -34

Request:

{
    "type":-34,
    "data":{
        "temporary_channel_id":[43,207,125,166,133,84,214,91,184,177,149,10,111,209,133,201,147,178,48,245,6,18,162,239,207,45,105,158,251,200,138,183],            "funding_tx_hex":"02000000016aabc30d6ef0d7e1d02572ca30450421a7541b7bf3d9b9937240b977b228215c010000006a473044022077352945e8cbc96475ba6e8af7f808980eeb93560ecca416dc5e94e561af0ebe022044a1c15a436594bade0db2a955e05b629d8611f15b3603aea13100b0ec2798900121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff0384b30e00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac0000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468700000000",        
        "temp_address_pub_key":"03ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d",
        "temp_address_private_key":"cSgTisoiZLzH5vrwHBMAXLC5nvND2ffcqqDtejMg12rEVrUMeP5R",
        "channel_address_private_key":"cUAdadTkjeVFsNz5ifhkETfAzk5PvhnLWtmdSKgbyTTjSCE4MYWy"
    }
}
Parameter default placement Description
temporary_channel_id ------- data
funding_tx_hex ------- data
temp_address_pub_key ------- data
temp_address_private_key ------- data
channel_address_private_key ------- data private key of the channel that Alice holds

Websocket Response:

OBD Responses:

{
    "type":-34,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":{
        "amount_a":6,
        "amount_b":0,
        "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],
        "channel_info_id":2,
        "create_at":"2019-09-21T00:58:55.448353+08:00",
        "create_by":"<user_id>",
        "curr_state":10,
        "fundee_sign_at":"0001-01-01T00:00:00Z",
        "funder_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
        "funder_pub_key_2_for_commitment":"03ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d",
        "funding_output_index":2,"funding_tx_hex":"02000000016aabc30d6ef0d7e1d02572ca30450421a7541b7bf3d9b9937240b977b228215c010000006a473044022077352945e8cbc96475ba6e8af7f808980eeb93560ecca416dc5e94e561af0ebe022044a1c15a436594bade0db2a955e05b629d8611f15b3603aea13100b0ec2798900121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff0384b30e00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac0000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468700000000",
        "funding_txid":"c734f981de217a95764e565ffeb6464507fda588118754df3d4ec5cbe487fd3b",
        "id":2,
        "peer_id_a":"<user_id>",
        "peer_id_b":"<user_id>",
        "property_id":121
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
amount_a ------- result how much has been funded
amount_b ------- result none required
channel_id ------- result channel officially created
channel_info_id ------- result
create_at ------- result
create_by ------- result created by the funder
curr_state ------- result
fundee_sign_at ------- result
funder_address ------- result
funder_pub_key_2_for_commitment ------- result
funding_output_index" ------- result
funding_tx_hex ------- result
funding_txid ------- result
id ------- result
peer_id_a ------- result
peer_id_b ------- result
property_id ------- result

ResponseSendingOmniAsset

Simple Type -35 Protocol

Type -35 Protocol is used to response the transfering omni asset event by the partner of the channel .

Bob tells his OBD to reply Alice that he knows the funding by message -35, and OBD has created commitment transactions (C1a & RD1a)

Websocket Request: Message Type -35

Request:

{
    "type":-35,
    "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],
        "fundee_channel_address_private_key":"cV6dif91LHD8Czk8BTgvYZR3ipUrqyMDMtUXSWsThqpHaQJUuHKA",
        "approval":true
    }
}
Parameter default placement Description
channel_id ------- data
fundee_channel_address_private_key ------- data private key of the channel that Bob holds
approval ------- data true or false

Websocket Response:

OBD Responses:

{
    "type":-35,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":{
        "amount_a":6,
        "amount_b":0,
        "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],
        "channel_info_id":2,
        "create_at":"2019-09-21T00:58:55.448353+08:00",
        "create_by":"<user_id>",
        "curr_state":20,
        "fundee_sign_at":"2019-09-21T01:01:53.970256+08:00",
        "funder_address":"mx4TDCXP2DedxcuA8RXaQ6c4q2GKAimUPs",
        "funder_pub_key_2_for_commitment":"03ea01f8b137df5744ec2b0b91bc46139cabf228403264df65f6233bd7f0cbd17d",
        "funding_output_index":2,
        "funding_tx_hex":"02000000016aabc30d6ef0d7e1d02572ca30450421a7541b7bf3d9b9937240b977b228215c010000006a473044022077352945e8cbc96475ba6e8af7f808980eeb93560ecca416dc5e94e561af0ebe022044a1c15a436594bade0db2a955e05b629d8611f15b3603aea13100b0ec2798900121021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32dffffffff0384b30e00000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac0000000000000000166a146f6d6e6900000000000000790000000023c346001c0200000000000017a9145761a1d45b8a6e7caa10a4bcecca97630c67af468700000000",
        "funding_txid":"c734f981de217a95764e565ffeb6464507fda588118754df3d4ec5cbe487fd3b",
        "id":2,
        "peer_id_a":"<user_id>",
        "peer_id_b":"<user_id>",
        "property_id":121
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of fundee
to ------- body peer id of funder
channel_id ------- result
amount_a ------- result how much the funder deposited
amount_b ------- result none required
channel_id ------- result
channel_info_id ------- result
create_at ------- result
create_by ------- result
curr_state ------- result
fundee_sign_at ------- result
funder_address ------- result
funder_pub_key_2_for_commitment ------- result
funding_output_index ------- result
funding_tx_hex ------- result
funding_txid ------- result
id ------- result
peer_id_a ------- result
property_id ------- result

PaymentInChannel

Simple Type -351 Protocol

Type -351 Protocol is used for payment omni asset in channel through the Omni Lightning Network.

Now Alice can use this channel to pay to Bob. Here are some data generated by OBD used in contructing temporary multi-sig addresses and temporary transactions of i-th commitment transaction, which will be invalidated after new(i+1) commitment transaction is created.

Websocket Request: Message Type -351

Request:

{
    "type":-351,
    "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],
        "amount":0.1,
        "curr_temp_address_pub_key":"02b8302d22a50fd84f34d528ff98998a6959bc7fb8f45b5f3fb44e23101aa5d8f2",
        "curr_temp_address_private_key":"cP8vR19XbtytyHgyBh1SV5dVAMLrLR2rzSU9EAcQTCUHij61u5C2",
        "property_id":121,
        "channel_address_private_key":"cUAdadTkjeVFsNz5ifhkETfAzk5PvhnLWtmdSKgbyTTjSCE4MYWy",
        "last_temp_address_private_key":"cSgTisoiZLzH5vrwHBMAXLC5nvND2ffcqqDtejMg12rEVrUMeP5R"
    }
}
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.
property_id ------- data the omni asset id that has been funding.
channel_address_private_key ------- data Alice's private key of the channel
last_temp_address_private_key ------- data the private key of the last temporary multi-sig address

Websocket Response:

OBD Responses:

{
    "type":-351,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":{
        "amount":0.1,
        "channel_address_private_key":"",
        "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],
        "curr_temp_address_private_key":"",
        "curr_temp_address_pub_key":"02b8302d22a50fd84f34d528ff98998a6959bc7fb8f45b5f3fb44e23101aa5d8f2",
        "last_temp_address_private_key":"",
        "property_id":121,
        "request_commitment_hash":"8a55f150c34e2720a587dde3809e81959701e1dd3f78c1e1fc9960c132566fe0"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
amount ------- result
channel_address_private_key ------- result
channel_id ------- result
curr_temp_address_private_key ------- result
curr_temp_address_pub_key ------- result
last_temp_address_private_key ------- result
property_id ------- result
request_commitment_hash ------- result

ResponsePaymentInChannel

Simple Type -352 Protocol

Type -352 Protocol is used to response the payment omni asset in channel.

Websocket Request: Message Type -352

Request:

 {
    "type":-352,
    "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],
        "curr_temp_address_pub_key":"0277bf9e0df3ffe2d8f22356fb198e9b0a2237b8c51bde77e3c7da5df09a4dba05",
        "curr_temp_address_private_key":"cQm58g783uvXbFjTjLN5STR3TrPiKueC5f9SCkAc9kSew4dj2Y2i",
        "last_temp_private_key":"",
        "request_commitment_hash":"8a55f150c34e2720a587dde3809e81959701e1dd3f78c1e1fc9960c132566fe0",
        "channel_address_private_key":"cV6dif91LHD8Czk8BTgvYZR3ipUrqyMDMtUXSWsThqpHaQJUuHKA",
        "approval":true
    }
}
Parameter default placement Description
channel_id ------- data
curr_temp_address_pub_key ------- data to be added
curr_temp_address_private_key ------- data to be added
last_temp_private_key ------- data to be added
request_commitment_hash ------- data to be added
channel_address_private_key ------- data private key of the channel that Bob holds
approval ------- data true or false

Websocket Response:

OBD Responses:

{
    "type":-352,
    "status":true,
    "from":"<user_id>",
    "to":"<user_id>",
    "result":{
        "amount_b":0.1,
        "amount_m":5.9,"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:38:02.249498+08:00",
        "create_by":"<user_id>",
        "curr_hash":"235d465eae3bb8c71e97ca08cca295598461cc8d23a9bdf4e6ff09e4e9f9323f",
        "curr_state":10,
        "id":5,
        "input_amount":6,
        "input_txid":"c734f981de217a95764e565ffeb6464507fda588118754df3d4ec5cbe487fd3b",
        "input_vout":2,"last_commitment_tx_id":4,"last_edit_time":"2019-09-21T01:38:02.249498+08:00",
        "last_hash":"8a55f150c34e2720a587dde3809e81959701e1dd3f78c1e1fc9960c132566fe0",
        "multi_address":"2Mz8QZz1RxwpHioy1bgyPA4rhXXWwEkFDtW",
        "owner":"<user_id>",
        "peer_id_a":"<user_id>",
        "peer_id_b":"<user_id>",
        "property_id":121,
        "redeem_script":"522102b8302d22a50fd84f34d528ff98998a6959bc7fb8f45b5f3fb44e23101aa5d8f22103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952ae",
        "script_pub_key":"a9144b7ecd257a459e0fabf75b72fdfd98a54a12e7c187",
        "send_at":"0001-01-01T00:00:00Z",
        "sign_at":"2019-09-21T01:38:03.119512+08:00",
        "temp_address_pub_key":"02b8302d22a50fd84f34d528ff98998a6959bc7fb8f45b5f3fb44e23101aa5d8f2",
        "transaction_sign_hex_to_other":"02000000043bfd87e4cbc54e3ddf54871188a5fd074546b6fe5f564e76957a21de81f934c702000000d900473044022068d84ef3d9d6db850d1c348ae52158ee542758ed4f82f1359a901999657ea8d902202e63d2c3e7ddba77b69fd6d71eee072964f9e0fd6972b11922ae64b4d4b5d7fa0147304402202903a8784eeb72dc7f32e048a50134f217a4b7ccf371066ddce2c7fafa863a9c0220117307e4e7efe7e74321707310e6a2c387e4a5002fd3bc654d1860275ee157e801475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff6aabc30d6ef0d7e1d02572ca30450421a7541b7bf3d9b9937240b977b228215c00000000d90047304402205536325b0b93f34528c4cb8d31f0f43c39bd035db521bc3dca54ae8a99accd0902203bd9ca2bce0ee8314f5a8998a0cb64a0edc17abe8f60ad813e0e41f1ddaf9bdc014730440220628681cd6a6fc23ce8074788ce13c7da998dc94af9fd9d1d0bbe8ad98f86ddbd02205c016cabce74eaf577b6702760129cd3f86173b6ffeb008cca7783240634dde901475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffffd8f2a3c2a2b2e6678d21025aed46cbc905ba25ac55e0dfd50a2d719b687f1c5203000000d900473044022001e87986132f4f8ad3e4264044fecdd1afe813aeed1a540ff96f11c159774c0f022016b7cb615ae10e48d911b5fddf3e8770829e489f61971203e9462854c81b493a0147304402206e46182bf84fe5c4d1f7b5c78b80c315bb6a5f7922a6f33afa68cec3a84f79ad02205168f413d7345fbb1d22f7f2540588934e5851d2243c3ad03f6ac1e04ccf26d001475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffffdea307c20723ced3445b67d801c2c28a7cc371092e9500dac8f96d5c892abba402000000d90047304402204586943539db1a9087b26678a7c6a20cadc38e2545d061ab8c2a25c245d817de02202f8bfb63e5448054be581ffffb64db1297ca95728bdf4be8f0b6ffff7107dbe8014730440220750202e5eef02556b22b124bc1bb2452918df7e02fb639e07432fc0e42829a4502204071fc1b6d60d3275b081920085777134547f4c986f15bbb5284989fc07d3ebb01475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff039a460000000000001976a914b5770ba3d6d34f5fdd8d582f81fb383975bb9c6d88ac0000000000000000166a146f6d6e690000000000000079000000000098968022020000000000001976a914c2e30e5f058df787de0529e0742d7ef7a13231ab88ac00000000","transaction_sign_hex_to_temp_multi_address":"0200000001685a7e84bc2d24fa01550674176a6b4bf366a99e001b5b52f2fc16c8b6146b2600000000d90047304402207fdf6d9de273352f215b7139a169b9c6046fc33f5e5c26a4012c6b32e07137aa02200a437ce51e3a02478c59d8c21a8c71ea6fda6dac62c5032ec5f131f21a7e8ee20147304402205eccc7e4b8bcae3269d6eb25aeb6823d88562f308c203590b86073d35f9d3d7e02203130cf67e48b539d7b3c17400a7fba88c812315f465a42dabab046d65a52054c01475221021d475729c52f86df24b36aa231945bd090f9c23ccbfb91e4ade6813b2419d32d2103efd8923f1829ece87202892d31cd75c20b7a7b5adf888f7ba04fa2c1bc931ce952aeffffffff033c1900000000000017a9144b7ecd257a459e0fabf75b72fdfd98a54a12e7c1870000000000000000166a146f6d6e69000000000000007900000000232aaf801c0200000000000017a9144b7ecd257a459e0fabf75b72fdfd98a54a12e7c18700000000","txid_to_other":"3065fa232bb5dec89104bc487359ac12b2480bb0762f64abbebd6adf0795bc13","txid_to_temp_multi_address":"74cffd8987cf01ed02d355aad82c38aadd991c4f185b3e394c5bade55d2ceb73"
    }
}

Parameter default placement Description
status ------- body true or false
from ------- body peer id of funder
to ------- body peer id of fundee
amount_b ------- result how much has been payed
amount_m ------- result the balance of the sender
channel_id ------- result channel officially created
create_at ------- result
create_by ------- result created by the funder
curr_state ------- result
id ------- result
input_amount ------- result
input_txid ------- result
input_vout ------- result
last_commitment_tx_id ------- result to be added
last_edit_time ------- result
last_hash ------- result
multi_address ------- result to be added
owner ------- result
peer_id_a ------- result
peer_id_b ------- result
property_id ------- result
redeem_script ------- result to be added
script_pub_key ------- result to be added
send_at ------- result
sign_at ------- result
temp_address_pub_key ------- result to be added
transaction_sign_hex_to_other ------- result to be added
transaction_sign_hex_to_temp_multi_address ------- result
txid_to_other ------- result to be added
txid_to_temp_multi_address ------- result to be added

NewAddress

Simple Type 1001 Protocol

Type 1001 Protocol is used to create a new address by omni core rpc command.

Websocket Request: Message Type 1001

Request:

{
    "type": 1001
}

This message has no arguments.

Websocket Response:

OBD Responses:

{
    "type":1001,
    "status":true,
    "from":"434ecdd4-a8e4-4771-b194-c23dd55fcd20",
    "to":"434ecdd4-a8e4-4771-b194-c23dd55fcd20",
    "result":"mpzfjjB1Yv2BSrfeLAjDLrJzxzh4LYFe7x"
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
address ------- result The newly generated wallet address

NewAddressWithMnemonic

Simple Type -200 Protocol

Type -200 Protocol is used to create a new address with mnemonic words.

Websocket Request: Message Type -200

Request:

{
    "type": -200
}

This message has no arguments.

Websocket Response:

OBD Responses:

{
    "type":-200,
    "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

GetAddressInfo

Simple Type -201 Protocol

Type -201 Protocol is used to get detail info of a address generated by mnemonic words.

Websocket Request: Message Type -201

Request:

{
    "type":-201,
    "data":0
}
Parameter default placement Description
index ------- data number of generated sort with mnemonic words

Websocket Response:

OBD Responses:

{
    "type":-201,
    "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

HTLCPayment

Simple Type -40 Protocol

Type -40 Protocol is used to launch a payment by HTLC system.

Websocket Request: Message Type -40

Request:

{
    "type": -40,
    "data": {
        "property_id": 121,
        "amount": 5,
        "recipient_peer_id": "<user_id>"
    }
}
Parameter default placement Description
property_id ------- data assets id
amount ------- data amount of transfer
recipient_peer_id ------- data peer id of receiever

Websocket Response:

OBD Responses:

{
    "type": -40, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "amount": 5, 
        "approval": false, 
        "property_id": 121, 
        "request_hash": "742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
amount ------- result amount of transfer
approval ------- result true or false
property_id ------- result assets id
request_hash ------- result hash of this HTLC request

ResponseHTLCPayment

Simple Type -41 Protocol

Type -41 Protocol is used to response HTLC Payment request.

Websocket Request: Message Type -41

Request:

{
    "type": -41,
    "data": {
        "request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
        "property_id": 121,
        "amount": 5,
        "approval":true
    }
}
Parameter default placement Description
request_hash ------- data hash of this HTLC request
property_id ------- data assets id
amount ------- data amount of transfer
approval ------- data true or false

Websocket Response:

OBD Responses:

{
    "type": -41, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "approval": true, 
        "h": "83519233492eb05ddd547757f2c3d151ad9392b2ebf48fc1a88e07e61dd82a45", 
        "id": 1, 
        "request_hash": "742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
approval ------- result true or false
h ------- result Hash_Preimage_R
id ------- result
request_hash ------- result hash of this HTLC request

SendH2Middleman

Simple Type -42 Protocol

Type -42 Protocol is used for looking for a path to transfer to target and Send H to middleman.

Websocket Request: Message Type -42

Request:

{
    "type": -42,
    "data": {
        "h":"83519233492eb05ddd547757f2c3d151ad9392b2ebf48fc1a88e07e61dd82a45"
    }
}
Parameter default placement Description
h ------- data Hash of the preimage R

Websocket Response:

OBD Responses:

{
    "type": -42, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "h": "83519233492eb05ddd547757f2c3d151ad9392b2ebf48fc1a88e07e61dd82a45", 
        "request_hash": "742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
h ------- result Hash of the preimage R
request_hash ------- result hash of this HTLC request

ResponseByMiddleman

Simple Type -44 Protocol

Type -44 Protocol is used to response a routing request by middleman.

Websocket Request: Message Type -44

Request:

{
    "type": -44,
    "data": {
        "request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
        "approval":true,
        "channel_address_private_key":"cTr7SHQ7FR6Ej8ZU8vDpbt3y9GuF3hnBqn81Tv9Tdi5TeakqKavt",
        "last_temp_address_private_key":"cURFDvYsF49hazcGK3i4344H1r3pSjHwdqL2yQ85qxdzpub3rozx",
        "curr_rsmc_temp_address_pub_key":"03c5d2756dea6d6259080d7e1ab3f8597e7e9a83b5667eff70ea49ca3addb6f293",
        "curr_rsmc_temp_address_private_key":"cN3o7Se2qcSq7Z3wYL9DLxn1cr5Du5rmmxsQeoeF6LC7yXcZZotN",
        "curr_htlc_temp_address_pub_key":"03d2edfe1f0a527f70473dbacb386e4e6a9cc0ea0cabf71f6c0a3dd516a8e6099f",
        "curr_htlc_temp_address_private_key":"cPRy5pB8Ek2DabfQ74x8giqDdPtwTvptgRnq8qEP7KduzdmMFmJM"
    }
}
Parameter default placement Description
request_hash ------- data hash of this HTLC request
approval ------- data true or false
channel_address_private_key ------- data
last_temp_address_private_key ------- data
curr_rsmc_temp_address_pub_key ------- data
curr_rsmc_temp_address_private_key ------- data
curr_htlc_temp_address_pub_key ------- data
curr_htlc_temp_address_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -44, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "approval": true, 
        "request_hash": "742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
approval ------- result true or false
request_hash ------- result hash of this HTLC request

CreateHtlcCTx

Simple Type -45 Protocol

Type -45 Protocol is used to create HTLC commitment transactions.

Websocket Request: Message Type -45

Request:

{
    "type": -45,
    "data": {
        "request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
        "channel_address_private_key":"cToieuvo3JjkEUKa3tjd6J98RXKDTo1d2hUSVgKpZ1KwBvGhQFL8",
        "last_temp_address_private_key":"cVsKRbL4ijWULmbU78nghKYL79GLYo7q9ccgmSR5c6zJWKfEEdJN",
        "curr_rsmc_temp_address_pub_key":"03dab6d7b005e8b15a2dc8d7005b45111876813c24a54ff15316a76ba376cf020f",
        "curr_rsmc_temp_address_private_key":"cSYJ3vwcgMPDqegXFJ2YgCYNNgKS9tNxCaRkZnn3ourQSdGNkJCk",
        "curr_htlc_temp_address_pub_key":"03d16de84b72460055b18e6d572b49c4ab0e1d889c0bf0705becb22e16b65ca916",
        "curr_htlc_temp_address_private_key":"cR7wXNwPjMrDCpnJoinTiMK384YyKNTfyctLQ2CCdQobdanEqgAs",
        "curr_htlc_temp_address_for_ht1a_pub_key":"030cb3034f7374d5bb614e27169df99d346748a1a7a365a27b1138f5db7ad2b0f3",
        "curr_htlc_temp_address_for_ht1a_private_key":"cNzNyejXtgC4ySXCVXqa6egVinYLDtGhkRkGd271ZW6AJrVKYZ2w"
    }
}
Parameter default placement Description
request_hash ------- data hash of this HTLC request
channel_address_private_key ------- data
last_temp_address_private_key ------- data
curr_rsmc_temp_address_pub_key ------- data
curr_rsmc_temp_address_private_key ------- data
curr_htlc_temp_address_pub_key ------- data
curr_htlc_temp_address_private_key ------- data
curr_htlc_temp_address_for_ht1a_pub_key ------- data
curr_htlc_temp_address_for_ht1a_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -45, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "h": "e7626f2b7207006d6515399c587c09c3bfb5ed3b12f63c12b0d40e634f9dd9a3", 
        "h_and_r_info_request_hash": "1fe82bc9152741670c4ee2b4853df9346c1cc63fce6d1c896e7eeca8cc62c9d9"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
h ------- result Hash of the preimage R
h_and_r_info_request_hash ------- result hash of this HTLC request

SendH2NextNode

Simple Type -43 Protocol

Type -43 Protocol is used to send the H to next node.

Bob (middleman) Send H to Carol (destination)

Websocket Request: Message Type -43

Request:

{
    "type": -43,
    "data": {
        "h":"83519233492eb05ddd547757f2c3d151ad9392b2ebf48fc1a88e07e61dd82a45",
        "h_and_r_info_request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636"
    }
}
Parameter default placement Description
h ------- data Hash of the preimage R
h_and_r_info_request_hash ------- data hash of this HTLC request

Websocket Response:

OBD Responses:

{
    "type": -43, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "h": "e7626f2b7207006d6515399c587c09c3bfb5ed3b12f63c12b0d40e634f9dd9a3", 
        "request_hash": "1fe82bc9152741670c4ee2b4853df9346c1cc63fce6d1c896e7eeca8cc62c9d9"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
h ------- result Hash of the preimage R
request_hash ------- result hash of this HTLC request

SendR

Simple Type -46 Protocol

Type -46 Protocol is used to send R to a node.

Carol (destination) Send R (Preimage_R) to Bob (middleman)

So, from previous step (Setp 2), Bob ask Carol if Carol can produce to Bob an unknown 20-byte random input data R from a known hash H, within two days, then Bob will settle the contract by paying assets.

Of course Carol has the preimage R, because she generated it. Then now, Carol send R to Bob.

Websocket Request: Message Type -46

Request:

{
    "type": -46,
    "data": {
        "request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
        "r":"d77d7df74ca33a672802387fffc6575a09dc7c45",
        "channel_address_private_key":"cMxR8h9z5oKrdyuXVR9uzBbyyaJz1karxH1FW5xezhKzxQc7sCJV",
        "curr_htlc_temp_address_private_key":"cVW35aEjd56ZFHTSDtq9iUzHAfH6rWGVJcmYBn9QEp9ygSfkgZeG",        
        "curr_htlc_temp_address_for_he1b_pub_key":"020eaa8f0c0f2761215af43dd7fccb11df8cafffcff4e8f186bd1b8a8a11e5f680",
        "curr_htlc_temp_address_for_he1b_private_key":"cR14XVjQ4yXunTnpqXZ1FMangq5bZNqsQ4gnsVpJ1KAMkxZVqo3F"
    }
}
Parameter default placement Description
request_hash ------- data hash of this HTLC request
r ------- data Preimage_R
channel_address_private_key ------- data
curr_htlc_temp_address_private_key ------- data
curr_htlc_temp_address_for_he1b_pub_key ------- data
curr_htlc_temp_address_for_he1b_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -46, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "id": 4, 
        "r": "2de142c8006a3462241e96a610b59f3d92d8259c", 
        "request_hash": "1fe82bc9152741670c4ee2b4853df9346c1cc63fce6d1c896e7eeca8cc62c9d9"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
id ------- result
r ------- result Preimage_R
request_hash ------- result hash of this HTLC request

ResponseSendR

Simple Type -47 Protocol

Type -47 Protocol is used to response the request of send R.

Bob receieved the R, and check out if R is correct. If correct, then create rest HTLC commitment transactions.

Bob replies and create rest HTLC commitment transactions.

Websocket Request: Message Type -47

Request:

{
    "type": -47,
    "data": {
        "request_hash":"742db9677d53316b8faef7c9f40766e4f39dd6b82487c103960e9170de8ce636",
        "r":"d77d7df74ca33a672802387fffc6575a09dc7c45",
        "channel_address_private_key":"cTr7SHQ7FR6Ej8ZU8vDpbt3y9GuF3hnBqn81Tv9Tdi5TeakqKavt",
        "curr_htlc_temp_address_private_key":"cNon6RZ9uLq6EPpGYt8tDZjQLMWVZDAXcrFy3LH1ZmHQJDbKWnye"
    }
}
Parameter default placement Description
request_hash ------- data hash of this HTLC request
r ------- data Preimage_R
channel_address_private_key ------- data
curr_htlc_temp_address_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -47, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "r": "2de142c8006a3462241e96a610b59f3d92d8259c", 
        "request_hash": "1fe82bc9152741670c4ee2b4853df9346c1cc63fce6d1c896e7eeca8cc62c9d9"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
r ------- result Preimage_R
request_hash ------- result hash of this HTLC request

CloseHTLC

Simple Type -48 Protocol

Type -48 Protocol is used to close a HTLC channel.

For continue using OBD to transfer assets OR some reasons Alice need to close this HTLC channel between she and Bob. Then Alice launch the closing request.

Websocket Request: Message Type -48

Request:

{
    "type": -48,
    "data": {
        "channel_id":[174,36,154,103,145,76,58,237,32,61,201,81,17,156,135,216,66,28,83,203,251,152,138,102,158,113,131,32,241,229,43,75],
        "channel_address_private_key":"cToieuvo3JjkEUKa3tjd6J98RXKDTo1d2hUSVgKpZ1KwBvGhQFL8",
        "last_rsmc_temp_address_private_key":"cSYJ3vwcgMPDqegXFJ2YgCYNNgKS9tNxCaRkZnn3ourQSdGNkJCk",
        "last_htlc_temp_address_private_key":"cR7wXNwPjMrDCpnJoinTiMK384YyKNTfyctLQ2CCdQobdanEqgAs",
        "last_htlc_temp_address_for_htnx_private_key":"cNzNyejXtgC4ySXCVXqa6egVinYLDtGhkRkGd271ZW6AJrVKYZ2w",
        "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
last_rsmc_temp_address_private_key ------- data
last_htlc_temp_address_private_key ------- data
last_htlc_temp_address_for_htnx_private_key ------- data
curr_rsmc_temp_address_pub_key ------- data
curr_rsmc_temp_address_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -48, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "channel_id": [174,36,154,103,145,76,58,237,32,61,201,81,17,156,135,216,66,28,83,203,251,152,138,102,158,113,131,32,241,229,43,75],
        "create_at": "2019-11-06T08:45:40.4120228+08:00", 
        "create_by": "<user_id>", 
        "curr_rsmc_temp_address_pub_key": "02fed65567b2ab00e2cbb28b46a687ce8fd0894486989cba54975b45bbc6a85ed8", 
        "curr_state": 10, 
        "id": 5, 
        "request_hash": "fa6cdcd0974eeabbeffca3d70d0a66cd7549b002de7cd56eee1c7e60b94dc0be"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
channel_id ------- result Id of a channel
create_at ------- result time of created
create_by ------- result creator
curr_rsmc_temp_address_pub_key ------- result
curr_state ------- result
id ------- result
request_hash ------- result hash of this HTLC request

ResponseCloseHTLC

Simple Type -49 Protocol

Type -49 Protocol is used to response the request of close HTLC channel.

Bob replies and create BR & a newer commitment transactions

Websocket Request: Message Type -49

Request:

{
    "type": -49,
    "data": {
        "request_close_htlc_hash":"fa6cdcd0974eeabbeffca3d70d0a66cd7549b002de7cd56eee1c7e60b94dc0be",
        "channel_address_private_key":"cToieuvo3JjkEUKa3tjd6J98RXKDTo1d2hUSVgKpZ1KwBvGhQFL8",
        "last_rsmc_temp_address_private_key":"cTr7SHQ7FR6Ej8ZU8vDpbt3y9GuF3hnBqn81Tv9Tdi5TeakqKavt",
        "last_htlc_temp_address_private_key":"cPRy5pB8Ek2DabfQ74x8giqDdPtwTvptgRnq8qEP7KduzdmMFmJM",
        "last_htlc_temp_address_for_htnx_private_key":"cTeQ2e9Hw6y1RHjCCF9x3MR7pn3yPySgxSYy5rtvmVvM7ZNh9jUZ",
        "curr_rsmc_temp_address_pub_key":"0298bdca47bbb76b1022eb7d18534961a12ce6dd80308c839576602b771e324fba",
        "curr_rsmc_temp_address_private_key":"cU78aif2a4YR5xK8HxBTrPKjdjhD8W4SSZNTw4yFEdwi59JMrYQY"
    }
}
Parameter default placement Description
request_close_htlc_hash ------- data hash of this closing request
channel_address_private_key ------- data
last_rsmc_temp_address_private_key ------- data
last_htlc_temp_address_private_key ------- data
last_htlc_temp_address_for_htnx_private_key ------- data
curr_rsmc_temp_address_pub_key ------- data
curr_rsmc_temp_address_private_key ------- data

Websocket Response:

OBD Responses:

{
    "type": -49, 
    "status": true, 
    "from": "<user_id>", 
    "to": "<user_id>", 
    "result": {
        "msg": "close htlc success"
    }
}
Parameter default placement Description
status ------- body true or false
from ------- body sender
to ------- body receiever
msg ------- result success or failed

CloseHtlcChannel

Simple Type -50 Protocol

Type -50 Protocol is used to close HTLC channel.

Websocket Request: Message Type -50

Request:

{
    "type":-50,
    "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

ResponseCloseHtlcChannel

Simple Type -51 Protocol

Type -51 Protocol is used to response to request of close HTLC channel.

Websocket Request: Message Type -51

Request:

{
    "type":-51,
    "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],      "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

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)