mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
protocol: Enable private offers
Users can send private offers that will only be seen by one address. To send a private offer: 1. recipient creates a new address to receive offers on 2. recipient sends the pubkey for the newly created address to the offerer 3. offerer imports the recipient's pubkey 4. offerer sends a new offer to the recipients key instead of the public network Nodes will ignore offers sent on keys other than the network key or keys created for offer-receiving.
This commit is contained in:
@@ -38,6 +38,13 @@ class MessageTypes(IntEnum):
|
||||
OFFER_REVOKE = auto()
|
||||
|
||||
|
||||
class AddressTypes(IntEnum):
|
||||
OFFER = auto()
|
||||
BID = auto()
|
||||
RECV_OFFER = auto()
|
||||
SEND_OFFER = auto()
|
||||
|
||||
|
||||
class SwapTypes(IntEnum):
|
||||
SELLER_FIRST = auto()
|
||||
BUYER_FIRST = auto()
|
||||
@@ -239,11 +246,15 @@ def strTxType(tx_type):
|
||||
return 'Unknown'
|
||||
|
||||
|
||||
def strMessageType(msg_type):
|
||||
if msg_type == MessageTypes.OFFER:
|
||||
return 'Offers'
|
||||
if msg_type == MessageTypes.BID:
|
||||
return 'Bids'
|
||||
def strAddressType(addr_type):
|
||||
if addr_type == AddressTypes.OFFER:
|
||||
return 'Offer'
|
||||
if addr_type == AddressTypes.BID:
|
||||
return 'Bid'
|
||||
if addr_type == AddressTypes.RECV_OFFER:
|
||||
return 'Offer recv'
|
||||
if addr_type == AddressTypes.SEND_OFFER:
|
||||
return 'Offer send'
|
||||
return 'Unknown'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user