parent
adc80eabb0
commit
d3e3c3c95b
15 changed files with 117 additions and 349 deletions
@ -1,3 +1,3 @@ |
||||
name = "basicswap" |
||||
|
||||
__version__ = "0.13.1" |
||||
__version__ = "0.13.2" |
||||
|
@ -1,160 +0,0 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package basicswap; |
||||
|
||||
/* Step 1, seller -> network */ |
||||
message OfferMessage { |
||||
uint32 protocol_version = 1; |
||||
uint32 coin_from = 2; |
||||
uint32 coin_to = 3; |
||||
uint64 amount_from = 4; |
||||
uint64 amount_to = 5; |
||||
uint64 min_bid_amount = 6; |
||||
uint64 time_valid = 7; |
||||
enum LockType { |
||||
NOT_SET = 0; |
||||
SEQUENCE_LOCK_BLOCKS = 1; |
||||
SEQUENCE_LOCK_TIME = 2; |
||||
ABS_LOCK_BLOCKS = 3; |
||||
ABS_LOCK_TIME = 4; |
||||
} |
||||
LockType lock_type = 8; |
||||
uint32 lock_value = 9; |
||||
uint32 swap_type = 10; |
||||
|
||||
/* optional */ |
||||
string proof_address = 11; |
||||
string proof_signature = 12; |
||||
bytes pkhash_seller = 13; |
||||
bytes secret_hash = 14; |
||||
|
||||
uint64 fee_rate_from = 15; |
||||
uint64 fee_rate_to = 16; |
||||
|
||||
bool amount_negotiable = 17; |
||||
bool rate_negotiable = 18; |
||||
|
||||
bytes proof_utxos = 19; /* 32 byte txid 2 byte vout, repeated */ |
||||
} |
||||
|
||||
/* Step 2, buyer -> seller */ |
||||
message BidMessage { |
||||
uint32 protocol_version = 1; |
||||
bytes offer_msg_id = 2; |
||||
uint64 time_valid = 3; /* seconds bid is valid for */ |
||||
uint64 amount = 4; /* amount of amount_from bid is for */ |
||||
uint64 amount_to = 5; |
||||
bytes pkhash_buyer = 6; /* buyer's address to receive amount_from */ |
||||
string proof_address = 7; |
||||
string proof_signature = 8; |
||||
|
||||
bytes proof_utxos = 9; /* 32 byte txid 2 byte vout, repeated */ |
||||
|
||||
/* optional */ |
||||
bytes pkhash_buyer_to = 10; /* When pubkey hash is different on the to-chain */ |
||||
} |
||||
|
||||
/* For tests */ |
||||
message BidMessage_test { |
||||
uint32 protocol_version = 1; |
||||
bytes offer_msg_id = 2; |
||||
uint64 time_valid = 3; |
||||
uint64 amount = 4; |
||||
uint64 rate = 5; |
||||
} |
||||
|
||||
/* Step 3, seller -> buyer */ |
||||
message BidAcceptMessage { |
||||
bytes bid_msg_id = 1; |
||||
bytes initiate_txid = 2; |
||||
bytes contract_script = 3; |
||||
bytes pkhash_seller = 4; |
||||
} |
||||
|
||||
message OfferRevokeMessage { |
||||
bytes offer_msg_id = 1; |
||||
bytes signature = 2; |
||||
} |
||||
|
||||
message BidRejectMessage { |
||||
bytes bid_msg_id = 1; |
||||
uint32 reject_code = 2; |
||||
} |
||||
|
||||
message XmrBidMessage { |
||||
/* MSG1L, F -> L */ |
||||
uint32 protocol_version = 1; |
||||
bytes offer_msg_id = 2; |
||||
uint64 time_valid = 3; /* seconds bid is valid for */ |
||||
uint64 amount = 4; /* amount of amount_from bid is for */ |
||||
uint64 amount_to = 5; |
||||
|
||||
bytes pkaf = 6; |
||||
|
||||
bytes kbvf = 7; |
||||
bytes kbsf_dleag = 8; |
||||
|
||||
bytes dest_af = 9; |
||||
} |
||||
|
||||
message XmrSplitMessage { |
||||
bytes msg_id = 1; |
||||
uint32 msg_type = 2; /* 1 XmrBid, 2 XmrBidAccept */ |
||||
uint32 sequence = 3; |
||||
bytes dleag = 4; |
||||
} |
||||
|
||||
message XmrBidAcceptMessage { |
||||
bytes bid_msg_id = 1; |
||||
|
||||
bytes pkal = 2; |
||||
bytes kbvl = 3; |
||||
bytes kbsl_dleag = 4; |
||||
|
||||
/* MSG2F */ |
||||
bytes a_lock_tx = 5; |
||||
bytes a_lock_tx_script = 6; |
||||
bytes a_lock_refund_tx = 7; |
||||
bytes a_lock_refund_tx_script = 8; |
||||
bytes a_lock_refund_spend_tx = 9; |
||||
bytes al_lock_refund_tx_sig = 10; |
||||
} |
||||
|
||||
message XmrBidLockTxSigsMessage { |
||||
/* MSG3L */ |
||||
bytes bid_msg_id = 1; |
||||
bytes af_lock_refund_spend_tx_esig = 2; |
||||
bytes af_lock_refund_tx_sig = 3; |
||||
} |
||||
|
||||
message XmrBidLockSpendTxMessage { |
||||
/* MSG4F */ |
||||
bytes bid_msg_id = 1; |
||||
bytes a_lock_spend_tx = 2; |
||||
bytes kal_sig = 3; |
||||
} |
||||
|
||||
message XmrBidLockReleaseMessage { |
||||
/* MSG5F */ |
||||
bytes bid_msg_id = 1; |
||||
bytes al_lock_spend_tx_esig = 2; |
||||
} |
||||
|
||||
message ADSBidIntentMessage { |
||||
/* L -> F Sent from bidder, construct a reverse bid */ |
||||
uint32 protocol_version = 1; |
||||
bytes offer_msg_id = 2; |
||||
uint64 time_valid = 3; /* seconds bid is valid for */ |
||||
uint64 amount_from = 4; /* amount of offer.coin_from bid is for */ |
||||
uint64 amount_to = 5; /* amount of offer.coin_to bid is for, equivalent to bid.amount */ |
||||
} |
||||
|
||||
message ADSBidIntentAcceptMessage { |
||||
/* F -> L Sent from offerer, construct a reverse bid */ |
||||
bytes bid_msg_id = 1; |
||||
|
||||
bytes pkaf = 2; |
||||
bytes kbvf = 3; |
||||
bytes kbsf_dleag = 4; |
||||
bytes dest_af = 5; |
||||
} |
@ -1,54 +0,0 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: messages.proto |
||||
# Protobuf Python Version: 4.25.3 |
||||
"""Generated protocol buffer code.""" |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import descriptor_pool as _descriptor_pool |
||||
from google.protobuf import symbol_database as _symbol_database |
||||
from google.protobuf.internal import builder as _builder |
||||
# @@protoc_insertion_point(imports) |
||||
|
||||
_sym_db = _symbol_database.Default() |
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0emessages.proto\x12\tbasicswap\"\xc0\x04\n\x0cOfferMessage\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x11\n\tcoin_from\x18\x02 \x01(\r\x12\x0f\n\x07\x63oin_to\x18\x03 \x01(\r\x12\x13\n\x0b\x61mount_from\x18\x04 \x01(\x04\x12\x11\n\tamount_to\x18\x05 \x01(\x04\x12\x16\n\x0emin_bid_amount\x18\x06 \x01(\x04\x12\x12\n\ntime_valid\x18\x07 \x01(\x04\x12\x33\n\tlock_type\x18\x08 \x01(\x0e\x32 .basicswap.OfferMessage.LockType\x12\x12\n\nlock_value\x18\t \x01(\r\x12\x11\n\tswap_type\x18\n \x01(\r\x12\x15\n\rproof_address\x18\x0b \x01(\t\x12\x17\n\x0fproof_signature\x18\x0c \x01(\t\x12\x15\n\rpkhash_seller\x18\r \x01(\x0c\x12\x13\n\x0bsecret_hash\x18\x0e \x01(\x0c\x12\x15\n\rfee_rate_from\x18\x0f \x01(\x04\x12\x13\n\x0b\x66\x65\x65_rate_to\x18\x10 \x01(\x04\x12\x19\n\x11\x61mount_negotiable\x18\x11 \x01(\x08\x12\x17\n\x0frate_negotiable\x18\x12 \x01(\x08\x12\x13\n\x0bproof_utxos\x18\x13 \x01(\x0c\"q\n\x08LockType\x12\x0b\n\x07NOT_SET\x10\x00\x12\x18\n\x14SEQUENCE_LOCK_BLOCKS\x10\x01\x12\x16\n\x12SEQUENCE_LOCK_TIME\x10\x02\x12\x13\n\x0f\x41\x42S_LOCK_BLOCKS\x10\x03\x12\x11\n\rABS_LOCK_TIME\x10\x04\"\xe7\x01\n\nBidMessage\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x14\n\x0coffer_msg_id\x18\x02 \x01(\x0c\x12\x12\n\ntime_valid\x18\x03 \x01(\x04\x12\x0e\n\x06\x61mount\x18\x04 \x01(\x04\x12\x11\n\tamount_to\x18\x05 \x01(\x04\x12\x14\n\x0cpkhash_buyer\x18\x06 \x01(\x0c\x12\x15\n\rproof_address\x18\x07 \x01(\t\x12\x17\n\x0fproof_signature\x18\x08 \x01(\t\x12\x13\n\x0bproof_utxos\x18\t \x01(\x0c\x12\x17\n\x0fpkhash_buyer_to\x18\r \x01(\x0c\"s\n\x0f\x42idMessage_test\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x14\n\x0coffer_msg_id\x18\x02 \x01(\x0c\x12\x12\n\ntime_valid\x18\x03 \x01(\x04\x12\x0e\n\x06\x61mount\x18\x04 \x01(\x04\x12\x0c\n\x04rate\x18\x05 \x01(\x04\"m\n\x10\x42idAcceptMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x15\n\rinitiate_txid\x18\x02 \x01(\x0c\x12\x17\n\x0f\x63ontract_script\x18\x03 \x01(\x0c\x12\x15\n\rpkhash_seller\x18\x04 \x01(\x0c\"=\n\x12OfferRevokeMessage\x12\x14\n\x0coffer_msg_id\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\";\n\x10\x42idRejectMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x13\n\x0breject_code\x18\x02 \x01(\r\"\xb7\x01\n\rXmrBidMessage\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x14\n\x0coffer_msg_id\x18\x02 \x01(\x0c\x12\x12\n\ntime_valid\x18\x03 \x01(\x04\x12\x0e\n\x06\x61mount\x18\x04 \x01(\x04\x12\x11\n\tamount_to\x18\x05 \x01(\x04\x12\x0c\n\x04pkaf\x18\x06 \x01(\x0c\x12\x0c\n\x04kbvf\x18\x07 \x01(\x0c\x12\x12\n\nkbsf_dleag\x18\x08 \x01(\x0c\x12\x0f\n\x07\x64\x65st_af\x18\t \x01(\x0c\"T\n\x0fXmrSplitMessage\x12\x0e\n\x06msg_id\x18\x01 \x01(\x0c\x12\x10\n\x08msg_type\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\x12\r\n\x05\x64leag\x18\x04 \x01(\x0c\"\x80\x02\n\x13XmrBidAcceptMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x0c\n\x04pkal\x18\x02 \x01(\x0c\x12\x0c\n\x04kbvl\x18\x03 \x01(\x0c\x12\x12\n\nkbsl_dleag\x18\x04 \x01(\x0c\x12\x11\n\ta_lock_tx\x18\x05 \x01(\x0c\x12\x18\n\x10\x61_lock_tx_script\x18\x06 \x01(\x0c\x12\x18\n\x10\x61_lock_refund_tx\x18\x07 \x01(\x0c\x12\x1f\n\x17\x61_lock_refund_tx_script\x18\x08 \x01(\x0c\x12\x1e\n\x16\x61_lock_refund_spend_tx\x18\t \x01(\x0c\x12\x1d\n\x15\x61l_lock_refund_tx_sig\x18\n \x01(\x0c\"r\n\x17XmrBidLockTxSigsMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12$\n\x1c\x61\x66_lock_refund_spend_tx_esig\x18\x02 \x01(\x0c\x12\x1d\n\x15\x61\x66_lock_refund_tx_sig\x18\x03 \x01(\x0c\"X\n\x18XmrBidLockSpendTxMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x17\n\x0f\x61_lock_spend_tx\x18\x02 \x01(\x0c\x12\x0f\n\x07kal_sig\x18\x03 \x01(\x0c\"M\n\x18XmrBidLockReleaseMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x1d\n\x15\x61l_lock_spend_tx_esig\x18\x02 \x01(\x0c\"\x81\x01\n\x13\x41\x44SBidIntentMessage\x12\x18\n\x10protocol_version\x18\x01 \x01(\r\x12\x14\n\x0coffer_msg_id\x18\x02 \x01(\x0c\x12\x12\n\ntime_valid\x18\x03 \x01(\x04\x12\x13\n\x0b\x61mount_from\x18\x04 \x01(\x04\x12\x11\n\tamount_to\x18\x05 \x01(\x04\"p\n\x19\x41\x44SBidIntentAcceptMessage\x12\x12\n\nbid_msg_id\x18\x01 \x01(\x0c\x12\x0c\n\x04pkaf\x18\x02 \x01(\x0c\x12\x0c\n\x04kbvf\x18\x03 \x01(\x0c\x12\x12\n\nkbsf_dleag\x18\x04 \x01(\x0c\x12\x0f\n\x07\x64\x65st_af\x18\x05 \x01(\x0c\x62\x06proto3') |
||||
|
||||
_globals = globals() |
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) |
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'messages_pb2', _globals) |
||||
if _descriptor._USE_C_DESCRIPTORS == False: |
||||
DESCRIPTOR._options = None |
||||
_globals['_OFFERMESSAGE']._serialized_start=30 |
||||
_globals['_OFFERMESSAGE']._serialized_end=606 |
||||
_globals['_OFFERMESSAGE_LOCKTYPE']._serialized_start=493 |
||||
_globals['_OFFERMESSAGE_LOCKTYPE']._serialized_end=606 |
||||
_globals['_BIDMESSAGE']._serialized_start=609 |
||||
_globals['_BIDMESSAGE']._serialized_end=840 |
||||
_globals['_BIDMESSAGE_TEST']._serialized_start=842 |
||||
_globals['_BIDMESSAGE_TEST']._serialized_end=957 |
||||
_globals['_BIDACCEPTMESSAGE']._serialized_start=959 |
||||
_globals['_BIDACCEPTMESSAGE']._serialized_end=1068 |
||||
_globals['_OFFERREVOKEMESSAGE']._serialized_start=1070 |
||||
_globals['_OFFERREVOKEMESSAGE']._serialized_end=1131 |
||||
_globals['_BIDREJECTMESSAGE']._serialized_start=1133 |
||||
_globals['_BIDREJECTMESSAGE']._serialized_end=1192 |
||||
_globals['_XMRBIDMESSAGE']._serialized_start=1195 |
||||
_globals['_XMRBIDMESSAGE']._serialized_end=1378 |
||||
_globals['_XMRSPLITMESSAGE']._serialized_start=1380 |
||||
_globals['_XMRSPLITMESSAGE']._serialized_end=1464 |
||||
_globals['_XMRBIDACCEPTMESSAGE']._serialized_start=1467 |
||||
_globals['_XMRBIDACCEPTMESSAGE']._serialized_end=1723 |
||||
_globals['_XMRBIDLOCKTXSIGSMESSAGE']._serialized_start=1725 |
||||
_globals['_XMRBIDLOCKTXSIGSMESSAGE']._serialized_end=1839 |
||||
_globals['_XMRBIDLOCKSPENDTXMESSAGE']._serialized_start=1841 |
||||
_globals['_XMRBIDLOCKSPENDTXMESSAGE']._serialized_end=1929 |
||||
_globals['_XMRBIDLOCKRELEASEMESSAGE']._serialized_start=1931 |
||||
_globals['_XMRBIDLOCKRELEASEMESSAGE']._serialized_end=2008 |
||||
_globals['_ADSBIDINTENTMESSAGE']._serialized_start=2011 |
||||
_globals['_ADSBIDINTENTMESSAGE']._serialized_end=2140 |
||||
_globals['_ADSBIDINTENTACCEPTMESSAGE']._serialized_start=2142 |
||||
_globals['_ADSBIDINTENTACCEPTMESSAGE']._serialized_end=2254 |
||||
# @@protoc_insertion_point(module_scope) |
Loading…
Reference in new issue