Skip to content

Commit b976570

Browse files
authored
Release/v1.2.0 (bisq-network#3532)
* New trade protocol (bisq-network#3333) * Remove arbitration key, cleanup * Add BuyerAsMakerProcessDepositTxAndDelayedPayoutTxMessage * Adopt trade protocol - Add handler for DepositTxAndDelayedPayoutTxMessage - Change handler for DepositTxPublishedMessage - Add MakerSetsLockTime - Rename MakerProcessPayDepositRequest to MakerProcessPayDepositRequest - Rename MakerSendPublishDepositTxRequest to MakerSendsProvideInputsForDepositTxMessage - Rename DepositTxPublishedMessage to DelayedPayoutTxSignatureRequest - Rename MakerProcessDepositTxPublishedMessage to MakerAsBuyerProcessSignDelayedPayoutTxMessage * Remove arbitratorKey * Add new classes * Add new message classes * Add new task classes * Renamed classed (no functional change yet) * Add lockTime * Add delayedPayoutTxSignature field * Add useReimbursementModel field * Add new classes * Add setting.preferences.useReimbursementModel * Apply renamed classes (new classes not added yet) * Add useReimbursementModel * Add preferences param * Add new methods, cleanup * Add daoFacade param, apply renaming * Add delayedPayoutTx, lockTime and delayedPayoutTxId - Support daoFacade param * Remove DirectMessage interface * Rename emergencySignAndPublishPayoutTx method, add new one for 2of2 MS * Apply new protocol * Apply new protocol * Add renaming (no functional change yet) * Add new messages, apply renaming * Remove unneeded P2SHMultiSigOutputScript * Remove PREFERRED_PROJECT_CODE_STYLE * Refactor: Rename class * Use InputsForDepositTxRequest instead of TradeMessage in handleTakeOfferRequest * Do not sign deposit tx if maker is seller We change behaviour that the maker as seller does not send the pre signed deposit tx to the taker as the seller has more to lose and he wants to control the creation process of the delayed payout tx. * Apply new trade protocol to seller as maker version * Apply new trade protocol Delayed payout tx are now working for all scenarios but we use a small hack to get around an issue with not receiving confirmations and the peers tx. We add a tiny output to both peers, so we see the tx and confirmation. Without that only the publisher sees the tx and confirmations are not displayed. Need further work to get that working without that extra outputs. * Set TRADE_PROTOCOL_VERSION to 2 * Add PeerPublishedDelayedPayoutTxMessage We need add the delayed payout tx to the wallet once the peer publishes it. We will not see the confidence as we do not receive or sent funds from our address. Same is with dispute payouts where one peer does not receive anything. Then the confidence is not set. It seems that is a restriction in BitcoinJ or it requires some extra handling. We set the confidence indicator invisible in the dispute case and that might be an acceptable option here as well. * Add refund agent domain * Add refundAgentNodeAddress * Apply refund domain * Add refund views * Apply refundAgent domain * Support refundAgent * Remove useReimbursementModel field We dont need in the offer anymore the decision if reimbursement or arbitration is chosen. * Apply refundAgent payout * Handle tx info and balances * Remove mediation activation * Add new tac accepted flag for v1.2.0 and adjust text * Fix params for test classes * Signed witness trading (bisq-network#3334) * Added basic UI for account signing for arbitrators * Add domain layer for signed account age witnesses (credits ManfredKarrer and oscarguindzberg) * Remove testing gridlines * Arbitrator sign accountAgeWitnesses Automatically filter to only sign accounts that - have chargeback risk - bought BTC - was winner in dispute * Handle chargebackrisk by currency * Check winners only for closed disputes * Show sign status of paymentaccounts in AccountsView * Rename service to accountAgeWitnessService * Refactor: Move account signing helpers to AccountAgeWitnessService * Refactor: rename hasSignedWitness to myHasSignedWitness * Show if witness is signed in offerbook view * Use witness sign age for age comparison * Refactor: rename to isTaker... to isMyTaker... * Allow trading with signed witnesses * Use witness age for showing account age icon * Move AccountAgeRestrictions into AccountAgeWitnessService * Handle trade limit of unverified accounts as normal case * Avoid optional as argument * Set trade limit depending on trade direction * Avoid optional arguments * Add text for seller as signer * Seller with signer privilege signs buyer witness * Fix merge issues * Remove explicit check for risky offers * Remove sellers explicit account age check * Add limit check based on common accountAgeWitness function * Fix arbitrator key event handling * Filter accounts on tradelimit instead of maturity * Fix test * Buyer sign seller account Add SIGNED_ACCOUNT_AGE_WITNESS capability * Fix checks for signing at end of trade Get correct valid accounts for offer * Rename BuyerDataItem -> TraderDataItem * Arbitrator sign both parties in a buyer payout dispute * Only sign unsigned accountAgeWitnesses * Remove unused code * Add demo for material design icons * Use different account age limits for sell/buy * Fix signing interface for arbitrator * Add signing state column to offer book * Add signing state to fiat accounts overview * Add signing state to selected fiat account * Fix popover padding * Add account signing state to peer info popup * Retrieve only unsigned witnesses for arbitrator to sign * Accounts signed by arbitrators are signers * Disable test due to travis issues * Improve witness handling (bisq-network#3342) * Fix comparison * Add display strings for witness sign state * Fix immaturity check * Use accountAgeWitness age for non risky payment methods * Show information about non risky account types * Fix peer info icon account age text * Complete new trade protocol (bisq-network#3340) * Improve handling of adding tx to wallet * Add delayedPayoutTx to dispute * Fix test * Use RECIPIENT_BTC_ADDRESS from DAO for trade fee * Set lockTime to 10 days for altcoins, 20 days others. - Devmode uses 1 block * Fix params * Update text * Update docs * Update logging if (log.isDebugEnabled()) only matches if logLevel is debug not if it is INFO * Remove log * Remove arbitrator checks * Remove arbitrator address - It works not if not legacy arbitrator is registered. We cannot remove too much from arbitration as we would risk to break account signing and display of old arbitration cases. Though if testing time permits we should try to clean out more of arbitration domain what is not needed anymore. * Use account signing state in accounts view (bisq-network#3365) * Add account signing icons to signing state in account display * Remove unnecessary "." that caused layout issues in the past * Add additional warning in the received payment popup for account signer * Fix Revolut padding issues for currencies * Hide signing icon for non-high-risk payment methods * Add correct icon state and info text for account signing state * Remove not implemented notification part * Test self signing witnesses * Change verified account limit factor to 0.5 * Account Signing: Add information popups for signing state (bisq-network#3374) * Add account signing icons to signing state in account display * Remove not implemented notification part * Hide time since signing column when not needed * Remove fiat rounding popup as feature was introduced a long time ago already * Add information popups for new signed states (only shown once for user) and minor clean-ups * Update core/src/main/resources/i18n/displayStrings.properties Co-Authored-By: sqrrm <[email protected]> * Account Signing: Improve signed state notificaton (bisq-network#3388) * Remove new badge from Altcoin instant feature * Remove new badge from percentage user deposit feature * Fix line break issues in received payment confirmation popup * Check if received payload fulfills signing state condition and not any personal witness * Show additional badge for account sections to guide user to check out new signing states * Fix account signing state in offer book (bisq-network#3390) * Account Signing: Fix verified usage (bisq-network#3392) * Rename witnessHash -> accountAgeWitnessHash * Add enum for SignedWitness verification method * Fix usage of isValidAccountAgeWitness * Revert icon for signstate change * Account signing: add signing state to payment account selection (bisq-network#3403) * Clean up dead code parts * Add account signing state to payment account selection * Account signing: revert dev date setting for trusted accounts (bisq-network#3404) * Revert temporary value for dev testing * Only enable button if there are accounts to be signed * Add trade limit exceptions (bisq-network#3406) * Remove dead code * Add trade limit exception for accounts signed by arbitrator * Update translations to adapt to new unified delay (bisq-network#3409) * NTP: Fix a couple of UI issues in the New Trade Protocol (bisq-network#3410) * Add badge support for refund agent (new arbitrator) tickets * Fix translation typo * Clean up arbitrator issues in translation * Only show refund agent label to support staff Every user should still see this role as arbitration * NTP: Improve differentiation between mediation and new arbitration (bisq-network#3414) * Clean up property exposure * Improve differentiation between mediation and arbitration cases * Go to new refund view if it is no mediation and not open mediation notification if refund is already in progress * Don't sign filtered accounts * NTP: merge with master (bisq-network#3420) * Temporarily disable onion host for @KanoczTomas's BTC node * Add Ergo (ERG) without Bouncy Castle dependency. See bisq-network#3195. * List CTSCoin (CTSC) * Tweak the English name of Japan Bank Transfer payment method * Add mediator prefix to trade statistics * List Faircoin (FAIR) * List uPlexa (UPX) * Remove not used private methods from BisqEnvironment * Add onInitP2pNetwork and onInitWallet to BisqSetupListener - Rename BisqSetupCompleteListener to BisqSetupListener - Add onInitP2pNetwork and onInitWallet to BisqSetupListener - make onInitP2pNetwork and onInitWallet default so no impl. required * Start server at onInitWallet and add wallet password handler - Add onInitWallet to HttpApiMain and start http server there - Add onRequestWalletPassword to BisqSetupListener - Override setupHandlers in HttpApiHeadlessApp and adjust setRequestWalletPasswordHandler (impl. missing) - Add onRequestWalletPassword to HttpApiMain * Add combination (Blockstream.info + Mempool.space) block explorer * Revert "Temporarily disable onion host for @KanoczTomas's BTC node" This reverts commit d333520. * Temporarily disable KanoczTomas btcnode on both onion and clearnet * Refactor BisqApp - update scene size calculation * Refactor BisqApp - update error popup message build * Refactor BisqApp - move icon load into ImageUtil * Remove unused Utilities * Increase minimum TX fee to 2 sats/vByte to fix bisq-network#3106 (bisq-network#3387) * Fix mistakes in English source (bisq-network#3386) * Fix broken placeholders * Replace non existing pending trades screen with open trades screen * Update core/src/main/resources/i18n/displayStrings.properties Co-Authored-By: Steve Jain <[email protected]> * Update message in failed trade popup * Refactor BisqEnvironment * Account Signing: Improve arbitrator signing flow (bisq-network#3421) * Pre-select a point of time 2 months in the past So all arbitrator signed payment accounts will have their limits lifted completely * Only show payment methods with high chargeback risk to be signed * Show connected Bitcoin network peer info * List Ndau (XND) - Official project URL: https://ndau.io/ - Official block explorer URL: https://explorer.service.ndau.tech * List Animecoin (ANI) * Apply rule to not allow BSQ outputs after BTC output for regular txs (bisq-network#3413) * Apply rule to not allow BSQ outputs after BTC output for regular txs * Enforce exactly 1 BSQ output for vote reveal tx * Fix missing balance and button state update * Refactor isBtcOutputOfBurnFeeTx method and add comments and TODOs No functional change. * Handle asset listing fee in custom method We need to enforce a BSQ change output As this is just tx creation code it has no consequences for the hard fork. * Use getPreparedBurnFeeTxForAssetListing * Update comments to not use dust output values * Fix missing balance and button state update * Use same method for asset listing fee and proof of burn Use same method for asset listing fee and proof of burn as tx structure is same. Update comments to be more general. * Use getPreparedProofOfBurnTx * Require mandatory BSQ change output for proposal fee tx. We had in the doc stated that we require a mandatory BSQ change output but it was not enforced in the implementation, causing similar issues as in Asset listing and proof of burn txs. * Add fix for not correctly handled issuance tx * Use new method for issuance tx // For issuance txs we also require a BSQ change output before the issuance output gets added. There was a // minor bug with the old version that multiple inputs would have caused an exception in case there was no // change output (e.g. inputs of 21 and 6 BSQ for BSQ fee of 21 BSQ would have caused that only 1 input was used // and then caused an error as we enforced a change output. This new version handles such cases correctly. * Handle all possible blind vote fee transactions * Move check for invalid opReturn output up * Add dust check at final sign method * Fix incorrect comments * Refactor - Remove requireChangeOutput param which is always false - Remove method which is used only by one caller - Cleanup * Add comment * Fix comments, rename methods * Move code of isBlindVoteBurnedFeeOutput to isBtcOutputOfBurnFeeTx * Update account signing strings for v1.2 release (bisq-network#3435) * Update account signing strings for v1.2 release * Add minor corrections from ripcurlx review * Adjust tradeLimitDueAccountAgeRestriction string So that it describes why an account isn't signed (in general) instead of why it wasn't signed by an arbitrator. * Account Signing/NTP: More improvements and fixes (bisq-network#3436) * Select the the correct sub view when a dispute is created * Require capability REFUND_AGENT to receive RefundAgent Messages * Remove unused return type for account signing * Add new feature popup for account signing and new trade protocol * Return void from account signing * Fix bug with not updating vote result table at vote result block * NTP: improve backwards compatibility for mediation (bisq-network#3439) * Improve readability of offer update * Add type safeguard for dispute lists * Set not existing dispute support type for clients < 1.2.0 from message support type * Enable handling of mediation cases for old trade protocol disputes in 1.2.0 clients * Remove unnecessary forEach * Use correct formatter and add missing value for placeholder * Bump version number * Add sign all checkbox. Fix list entry display (bisq-network#3450) * Add sign all checkbox. Fix list entry display * Add summary to log and clipboard * Use safe version for seednodes (bisq-network#3452) * Apply shutdown and memory check again To not risk issues with the release and seed nodes we merge back the old code base for handling memory check and shutdowns. The newly added changes for cross connecting between seed nodes cause out of memory issues and require more work and testing before it can be used. * Revert code change for periodic updates between seed nodes. The periodic updates code caused out of memory issues and require more work and testing before it can be used. * Arbitrator republish signedWitnesses on startup (bisq-network#3448) * Arbitrator republish signedWitnesses on startup * Keep republish internal to SignedWitnessService * Improve new feature popup for ntp and account signing (bisq-network#3453) * Do not commit delayedPayoutTx to avoid publishing at restart Fixes bisq-network#3463 BitcoinJ publishes automatically committed transactions. We committed it to the wallet to be able to access it later after a restart. We stored the txId in Trade and used that to request the tx from the wallet (as it was committed). Now we store the bitcoin serialized bytes of the tx and do not commit the tx before broadcasting it (if a trader opens refund agent ticket). * [1.2.0] Update client resources (bisq-network#3456) * Update bitcoinj checkpoint file * Update data stores * Update translations * [1.2.0] Improve new feature popup (bisq-network#3465) * Improve layout of new feature popup * Extract external hyperlinks into component to make it easier to update * Comment in necessary showAgain check * Add Raspberry Pi to build process (bisq-network#3466) * Add Raspberry Pi to build process * Rename deploy variable to improve readability * Update informational prompt upon creating fiat account with account signing details (bisq-network#3467) * Update informational prompt upon creating fiat account with account signing details * Fix wrong buyer limit for first 30 days * Set delayedPayoutTxBytes when setting delayedPayoutTx Fixes bisq-network#3473 The delayedPayoutTx is not committed to the wallet as long it is not published. The seller who creates the delayedPayoutTx has not stored the delayedPayoutTxBytes which caused a nullpointer after restart. * Minor updates (bisq-network#3474) * Remove unnecessary log statement This seems to be a left over log statement from debugging. * Use a small delay for MakerSetsLockTime on regtest When testing on regtest, not in devmode, we want a relatively short delay to be able to test the delay period. * Clarify payment limits up to 30 days after signing * Update RECIPIENT_BTC_ADDRESS for regtest (bisq-network#3478) Use an address that is owned by the regtest wallet in the dao-setup.zip file. This allows for easily verifying BTC trading fees are sent to this address correctly. Also, it helps verify spending of the time lock payout. * Remove btc nodes from Manfred Karrer (bisq-network#3480) * Avoid null objects (bisq-network#3481) * Avoid null objects * Remove check for type Historical data can be arbitration instead of mediation (arbitration was fallback at last update), so we need to tolerate the incorrect type here. Is only for tickets from pre 1.2. * Display appropriate account age info header Depending on charge back risk type, accounts should show accountAgeWitness age or time since signing * Set amount for delayed payout tx to 0 (bisq-network#3471) We have shown the spent funds from the deposit tx to the bisq donation address before. But that was incorrect from the wallet perspective and would have lead to incorrect summary of all transaction amounts. We set it now to 0 as we are not spending funds nor receiving any in our wallet. * Check for result phase at activate method Fixes bisq-network#3487 * Only show warning for risky payment menthods (bisq-network#3497) * Fix style issues with dark mode (bisq-network#3495) * Addresses issues mentioned in bisq-network#3482 (comment) (bisq-network#3496) * Clean up trade statistics from duplicate entries (bisq-network#3476) * Clean up trade statistics from duplicate entries At software updates we added new entries to the extraMap which caused duplicate entries (if one if the traders was on the new and the other on the old version or at republishing). We set it now json exclude so avoid that in future and clean up the map. * Avoid repeated calls to addPersistableNetworkPayloadFromInitialRequest For trade stat cleanup we don't want to apply it multiple times as it is a bit expensive. We get from each seed node the initial data response and would pollute with the second response our map again and if our node is a seed node, the seed node itself could not get into a clean state and would continue pollution other nodes. * Refactor Remove not used param Rename method Inline method Cleanups * Change unsigned to N/A * [1.2.0] Update data stores and adding SignedWitnessStore (bisq-network#3494) * Update data stores and adding SignedWitnessStore * Update translations * Update cleaned TradeStatistics2Store and changes in other stores * VoteResultView update results on any block in result phase Avoid updating the result more than once per result phase but make sure it's done if activated during the result phase * [1.2.0] Format maker fee for BTC and BSQ correctly (bisq-network#3498) * Format maker fee for BTC and BSQ correctly * Update tests * Only automatically open popup if result wasn't accepted and disable action button when being accepted (bisq-network#3503) * Fix tradestatistics (bisq-network#3469) * Remove delayed re-publishing of tradeStatistics This was done earlier when only maker was publishing trade statistics. Now both traders do it so we get already higher resilience. * Remove unused method Forgot in prev. commit to remove also the method. * Remove support for TradeStatistics2.ARBITRATOR_ADDRESS * Add comment and set ARBITRATOR_ADDRESS deprecated * Remove setting of arbitrator data from makers side The 2 arbitrator related fields in Trade are only set by the maker and not used anymore for reading, so it can be removed. The whole arbitrator domain should be cleaned out some day, but because of backward compatibility issues it id difficult to do it entirely at release date. With release after v 1.2. when no old offers are out anymore we are able to clean up that domain. * Remove dev log * Update translations * [1.2.0] Improve dispute section (bisq-network#3504) * Improve wording for mediation summary and add specific next steps for refund agent case * Select the first dispute case when entering the support section * Revert to SNAPSHOT version * Fix but with initialRequestApplied (bisq-network#3512) * Fix resource name (bisq-network#3514) * Remove minor version number in news popup * Fix copy SignedWitnessStore db script * Not show payment account details for blocked offers * Use age of accountAgeWitness as basis for sell limits * Bump version number * Revert to SNAPSHOT version * Merge v1.2.0/v1.2.1 with master (bisq-network#3521) * List Krypton (ZOD) * Temporarily disable onion host for @KanoczTomas's BTC node * Add Ergo (ERG) without Bouncy Castle dependency. See bisq-network#3195. * List CTSCoin (CTSC) * Tweak the English name of Japan Bank Transfer payment method * List Animecoin (ANI) * Add mediator prefix to trade statistics * List Faircoin (FAIR) * List uPlexa (UPX) * Remove not used private methods from BisqEnvironment * Add onInitP2pNetwork and onInitWallet to BisqSetupListener - Rename BisqSetupCompleteListener to BisqSetupListener - Add onInitP2pNetwork and onInitWallet to BisqSetupListener - make onInitP2pNetwork and onInitWallet default so no impl. required * Start server at onInitWallet and add wallet password handler - Add onInitWallet to HttpApiMain and start http server there - Add onRequestWalletPassword to BisqSetupListener - Override setupHandlers in HttpApiHeadlessApp and adjust setRequestWalletPasswordHandler (impl. missing) - Add onRequestWalletPassword to HttpApiMain * Add combination (Blockstream.info + Mempool.space) block explorer * Revert "Temporarily disable onion host for @KanoczTomas's BTC node" This reverts commit d333520. * Temporarily disable KanoczTomas btcnode on both onion and clearnet * Refactor BisqApp - update scene size calculation * Refactor BisqApp - update error popup message build * Refactor BisqApp - move icon load into ImageUtil * Remove unused Utilities * Increase minimum TX fee to 2 sats/vByte to fix bisq-network#3106 (bisq-network#3387) * Fix mistakes in English source (bisq-network#3386) * Fix broken placeholders * Replace non existing pending trades screen with open trades screen * Update core/src/main/resources/i18n/displayStrings.properties Co-Authored-By: Steve Jain <[email protected]> * Update message in failed trade popup * Refactor BisqEnvironment * List Ndau (XND) - Official project URL: https://ndau.io/ - Official block explorer URL: https://explorer.service.ndau.tech * Show connected Bitcoin network peer info * Not show payment account details for blocked offers (bisq-network#3425) * Add GitHub issue template for user reported bugs (bisq-network#3454) * Add issue template with steps to reproduce and actual/expected behavior * Fix typo in .github/ISSUE_TEMPLATE.md * Fix wrong auto merge * Add CapabilityRequiringPayload to TradeStatistics2 With v1.2.0 we changed the way how the hash is created. To not create too heavy load for seed nodes from requests from old nodes we use the SIGNED_ACCOUNT_AGE_WITNESS capability to send trade statistics only to new nodes. As trade statistics are only used for informational purpose it will not have any critical issue for the old nodes beside that they don't see the latest trades. * Fix tradestat hash issue (bisq-network#3529) * Recreate hash from protobuf data To ensure all data are using the new hash method (excluding extraMap) we do not use the hash field from the protobug data but pass null which causes to create the hash new based on the new hash method. * Add filter.toString method and log filter in case of wrong signature We have atm a invalid filter (prob. some dev polluted a test filter to mainnet) * Change log level, add log * Refactor: Move code to dump method * Add TRADE_STATISTICS_HASH_UPDATE capability We changed the hash method in 1.2.0 and that requires update to 1.2.2 for handling it correctly, otherwise the seed nodes have to process too much data. * Add logs for size of data exchange messages * Add more data in log * Improve logs * Fix wrong msg in log, cahnge log level * Add check for depositTxId not empty * Remove check for duplicates As we recreate the hash for all trade stat objects we don't need that check anymore. * Add logs * Temporarily remove this part of the statistics It prevents merging with master because through auto merge a duplication of this part of the code is happening and prevents Travis from succeeding
1 parent 2967702 commit b976570

File tree

302 files changed

+34861
-5442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+34861
-5442
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ configure(project(':desktop')) {
274274
apply plugin: 'witness'
275275
apply from: '../gradle/witness/gradle-witness.gradle'
276276

277-
version = '1.1.7-SNAPSHOT'
277+
version = '1.2.1-SNAPSHOT'
278278

279279
mainClassName = 'bisq.desktop.app.BisqAppMain'
280280

common/src/main/java/bisq/common/app/Capability.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ public enum Capability {
3535
RECEIVE_BSQ_BLOCK, // Signaling that node which wants to receive BSQ blocks (DAO lite node)
3636
@Deprecated DAO_STATE, // Not required anymore as no old clients out there not having that support
3737

38-
//TODO can be set deprecated after v1.1.6 as we enforce update there
39-
BUNDLE_OF_ENVELOPES, // Supports bundling of messages if many messages are sent in short interval
38+
@Deprecated BUNDLE_OF_ENVELOPES, // Supports bundling of messages if many messages are sent in short interval
4039

4140
SIGNED_ACCOUNT_AGE_WITNESS, // Supports the signed account age witness feature
42-
MEDIATION // Supports mediation feature
41+
MEDIATION, // Supports mediation feature
42+
REFUND_AGENT, // Supports refund agents
43+
TRADE_STATISTICS_HASH_UPDATE // We changed the hash method in 1.2.0 and that requires update to 1.2.2 for handling it correctly, otherwise the seed nodes have to process too much data.
4344
}

common/src/main/java/bisq/common/app/Version.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Version {
2727
// VERSION = 0.5.0 introduces proto buffer for the P2P network and local DB and is a not backward compatible update
2828
// Therefore all sub versions start again with 1
2929
// We use semantic versioning with major, minor and patch
30-
public static final String VERSION = "1.1.7";
30+
public static final String VERSION = "1.2.1";
3131

3232
public static int getMajorVersion(String version) {
3333
return getSubVersion(version, 0);
@@ -73,7 +73,7 @@ private static int getSubVersion(String version, int index) {
7373
// The version no. for the objects sent over the network. A change will break the serialization of old objects.
7474
// If objects are used for both network and database the network version is applied.
7575
// VERSION = 0.5.0 -> P2P_NETWORK_VERSION = 1
76-
@SuppressWarnings("ConstantConditions")
76+
// With version 1.2.1 we change to version 2 (new trade protocol)
7777
public static final int P2P_NETWORK_VERSION = 1;
7878

7979
// The version no. of the serialized data stored to disc. A change will break the serialization of old objects.
@@ -84,7 +84,8 @@ private static int getSubVersion(String version, int index) {
8484
// A taker will check the version of the offers to see if his version is compatible.
8585
// Offers created with the old version will become invalid and have to be canceled.
8686
// VERSION = 0.5.0 -> TRADE_PROTOCOL_VERSION = 1
87-
public static final int TRADE_PROTOCOL_VERSION = 1;
87+
// Version 1.2.1 -> TRADE_PROTOCOL_VERSION = 2
88+
public static final int TRADE_PROTOCOL_VERSION = 2;
8889
private static int p2pMessageVersion;
8990

9091
public static final String BSQ_TX_VERSION = "1";

common/src/main/proto/pb.proto

Lines changed: 110 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ message NetworkEnvelope {
3636
CloseConnectionMessage close_connection_message = 15;
3737
PrefixedSealedAndSignedMessage prefixed_sealed_and_signed_message = 16;
3838

39-
PayDepositRequest pay_deposit_request = 17;
40-
PublishDepositTxRequest publish_deposit_tx_request = 18;
41-
DepositTxPublishedMessage deposit_tx_published_message = 19;
39+
InputsForDepositTxRequest inputs_for_deposit_tx_request = 17;
40+
InputsForDepositTxResponse inputs_for_deposit_tx_response = 18;
41+
DepositTxMessage deposit_tx_message = 19;
4242
CounterCurrencyTransferStartedMessage counter_currency_transfer_started_message = 20;
4343
PayoutTxPublishedMessage payout_tx_published_message = 21;
4444

@@ -70,6 +70,11 @@ message NetworkEnvelope {
7070
BundleOfEnvelopes bundle_of_envelopes = 43;
7171
MediatedPayoutTxSignatureMessage mediated_payout_tx_signature_message = 44;
7272
MediatedPayoutTxPublishedMessage mediated_payout_tx_published_message = 45;
73+
74+
DelayedPayoutTxSignatureRequest delayed_payout_tx_signature_request = 46;
75+
DelayedPayoutTxSignatureResponse delayed_payout_tx_signature_response = 47;
76+
DepositTxAndDelayedPayoutTxMessage deposit_tx_and_delayed_payout_tx_message = 48;
77+
PeerPublishedDelayedPayoutTxMessage peer_published_delayed_payout_tx_message = 49;
7378
}
7479
}
7580

@@ -144,6 +149,7 @@ message OfferAvailabilityResponse {
144149
string uid = 4;
145150
NodeAddress arbitrator = 5;
146151
NodeAddress mediator = 6;
152+
NodeAddress refund_agent = 7;
147153
}
148154

149155
message RefreshOfferMessage {
@@ -197,7 +203,7 @@ message PrefixedSealedAndSignedMessage {
197203

198204
// trade
199205

200-
message PayDepositRequest {
206+
message InputsForDepositTxRequest {
201207
string trade_id = 1;
202208
NodeAddress sender_node_address = 2;
203209
int64 trade_amount = 3;
@@ -221,9 +227,11 @@ message PayDepositRequest {
221227
string uid = 21;
222228
bytes account_age_witness_signature_of_offer_id = 22;
223229
int64 current_date = 23;
230+
repeated NodeAddress accepted_refund_agent_node_addresses = 24;
231+
NodeAddress refund_agent_node_address = 25;
224232
}
225233

226-
message PublishDepositTxRequest {
234+
message InputsForDepositTxResponse {
227235
string trade_id = 1;
228236
PaymentAccountPayload maker_payment_account_payload = 2;
229237
string maker_account_id = 3;
@@ -237,13 +245,42 @@ message PublishDepositTxRequest {
237245
string uid = 11;
238246
bytes account_age_witness_signature_of_prepared_deposit_tx = 12;
239247
int64 current_date = 13;
248+
int64 lock_time = 14;
240249
}
241250

242-
message DepositTxPublishedMessage {
243-
string trade_id = 1;
244-
bytes deposit_tx = 2;
251+
message DelayedPayoutTxSignatureRequest {
252+
string uid = 1;
253+
string trade_id = 2;
254+
NodeAddress sender_node_address = 3;
255+
bytes delayed_payout_tx = 4;
256+
}
257+
258+
message DelayedPayoutTxSignatureResponse {
259+
string uid = 1;
260+
string trade_id = 2;
261+
NodeAddress sender_node_address = 3;
262+
bytes delayed_payout_tx_signature = 4;
263+
}
264+
265+
message DepositTxAndDelayedPayoutTxMessage {
266+
string uid = 1;
267+
string trade_id = 2;
268+
NodeAddress sender_node_address = 3;
269+
bytes deposit_tx = 4;
270+
bytes delayed_payout_tx = 5;
271+
}
272+
273+
message DepositTxMessage {
274+
string uid = 1;
275+
string trade_id = 2;
276+
NodeAddress sender_node_address = 3;
277+
bytes deposit_tx = 4;
278+
}
279+
280+
message PeerPublishedDelayedPayoutTxMessage {
281+
string uid = 1;
282+
string trade_id = 2;
245283
NodeAddress sender_node_address = 3;
246-
string uid = 4;
247284
}
248285

249286
message CounterCurrencyTransferStartedMessage {
@@ -279,8 +316,8 @@ message MediatedPayoutTxPublishedMessage {
279316

280317
message MediatedPayoutTxSignatureMessage {
281318
string uid = 1;
282-
bytes tx_signature = 2;
283319
string trade_id = 3;
320+
bytes tx_signature = 2;
284321
NodeAddress sender_node_address = 4;
285322
}
286323

@@ -290,6 +327,7 @@ enum SupportType {
290327
ARBITRATION = 0;
291328
MEDIATION = 1;
292329
TRADE = 2;
330+
REFUND = 3;
293331
}
294332

295333
message OpenNewDisputeMessage {
@@ -431,7 +469,7 @@ message Peer {
431469
message PubKeyRing {
432470
bytes signature_pub_key_bytes = 1;
433471
bytes encryption_pub_key_bytes = 2;
434-
reserved 3; // WAS: string pgp_pub_key_as_pem = 3;
472+
reserved 3; // WAS: string pgp_pub_key_as_pem = 3;
435473
}
436474

437475
message SealedAndSigned {
@@ -457,6 +495,7 @@ message StoragePayload {
457495
MailboxStoragePayload mailbox_storage_payload = 6;
458496
OfferPayload offer_payload = 7;
459497
TempProposalPayload temp_proposal_payload = 8;
498+
RefundAgent refund_agent = 9;
460499
}
461500
}
462501

@@ -550,6 +589,18 @@ message Mediator {
550589
map<string, string> extra_data = 9;
551590
}
552591

592+
message RefundAgent {
593+
NodeAddress node_address = 1;
594+
repeated string language_codes = 2;
595+
int64 registration_date = 3;
596+
string registration_signature = 4;
597+
bytes registration_pub_key = 5;
598+
PubKeyRing pub_key_ring = 6;
599+
string email_address = 7;
600+
string info = 8;
601+
map<string, string> extra_data = 9;
602+
}
603+
553604
message Filter {
554605
repeated string banned_node_address = 1;
555606
repeated string banned_offer_ids = 2;
@@ -568,6 +619,7 @@ message Filter {
568619
string disable_dao_below_version = 15;
569620
string disable_trade_below_version = 16;
570621
repeated string mediators = 17;
622+
repeated string refundAgents = 18;
571623
}
572624

573625
// not used anymore from v0.6 on. But leave it for receiving TradeStatistics objects from older
@@ -670,8 +722,14 @@ message AccountAgeWitness {
670722
}
671723

672724
message SignedWitness {
673-
bool signed_by_arbitrator = 1;
674-
bytes witness_hash = 2;
725+
enum VerificationMethod {
726+
PB_ERROR = 0;
727+
ARBITRATOR = 1;
728+
TRADE = 2;
729+
}
730+
731+
VerificationMethod verification_method = 1;
732+
bytes account_age_witness_hash = 2;
675733
bytes signature = 3;
676734
bytes signer_pub_key = 4;
677735
bytes witness_owner_pub_key = 5;
@@ -708,6 +766,9 @@ message Dispute {
708766
bool is_closed = 21;
709767
DisputeResult dispute_result = 22;
710768
string dispute_payout_tx_id = 23;
769+
SupportType support_type = 24;
770+
string mediators_dispute_result = 25;
771+
string delayed_payout_tx_id = 26;
711772
}
712773

713774
message Attachment {
@@ -759,7 +820,7 @@ message Contract {
759820
int64 trade_amount = 2;
760821
int64 trade_price = 3;
761822
string taker_fee_tx_id = 4;
762-
NodeAddress arbitrator_node_address = 5;
823+
reserved 5; // WAS: arbitrator_node_address
763824
bool is_buyer_maker_and_seller_taker = 6;
764825
string maker_account_id = 7;
765826
string taker_account_id = 8;
@@ -774,6 +835,8 @@ message Contract {
774835
bytes maker_multi_sig_pub_key = 17;
775836
bytes taker_multi_sig_pub_key = 18;
776837
NodeAddress mediator_node_address = 19;
838+
int64 lock_time = 20;
839+
NodeAddress refund_agent_node_address = 21;
777840
}
778841

779842
message RawTransactionInput {
@@ -793,6 +856,7 @@ enum AvailabilityResult {
793856
NO_MEDIATORS = 7;
794857
USER_IGNORED = 8;
795858
MISSING_MANDATORY_CAPABILITY = 9;
859+
NO_REFUND_AGENTS = 10;
796860
}
797861

798862
///////////////////////////////////////////////////////////////////////////////////////////
@@ -1074,6 +1138,7 @@ message PersistableEnvelope {
10741138
UnconfirmedBsqChangeOutputList unconfirmed_bsq_change_output_list = 27;
10751139
SignedWitnessStore signed_witness_store = 28;
10761140
MediationDisputeList mediation_dispute_list = 29;
1141+
RefundDisputeList refund_dispute_list = 30;
10771142
}
10781143
}
10791144

@@ -1198,6 +1263,7 @@ message OpenOffer {
11981263
State state = 2;
11991264
NodeAddress arbitrator_node_address = 3;
12001265
NodeAddress mediator_node_address = 4;
1266+
NodeAddress refund_agent_node_address = 5;
12011267
}
12021268

12031269
message Tradable {
@@ -1220,13 +1286,13 @@ message Trade {
12201286
MAKER_STORED_IN_MAILBOX_PUBLISH_DEPOSIT_TX_REQUEST = 5;
12211287
MAKER_SEND_FAILED_PUBLISH_DEPOSIT_TX_REQUEST = 6;
12221288
TAKER_RECEIVED_PUBLISH_DEPOSIT_TX_REQUEST = 7;
1223-
TAKER_PUBLISHED_DEPOSIT_TX = 8;
1224-
TAKER_SENT_DEPOSIT_TX_PUBLISHED_MSG = 9;
1225-
TAKER_SAW_ARRIVED_DEPOSIT_TX_PUBLISHED_MSG = 10;
1226-
TAKER_STORED_IN_MAILBOX_DEPOSIT_TX_PUBLISHED_MSG = 11;
1227-
TAKER_SEND_FAILED_DEPOSIT_TX_PUBLISHED_MSG = 12;
1228-
MAKER_RECEIVED_DEPOSIT_TX_PUBLISHED_MSG = 13;
1229-
MAKER_SAW_DEPOSIT_TX_IN_NETWORK = 14;
1289+
SELLER_PUBLISHED_DEPOSIT_TX = 8;
1290+
SELLER_SENT_DEPOSIT_TX_PUBLISHED_MSG = 9;
1291+
SELLER_SAW_ARRIVED_DEPOSIT_TX_PUBLISHED_MSG = 10;
1292+
SELLER_STORED_IN_MAILBOX_DEPOSIT_TX_PUBLISHED_MSG = 11;
1293+
SELLER_SEND_FAILED_DEPOSIT_TX_PUBLISHED_MSG = 12;
1294+
BUYER_RECEIVED_DEPOSIT_TX_PUBLISHED_MSG = 13;
1295+
BUYER_SAW_DEPOSIT_TX_IN_NETWORK = 14;
12301296
DEPOSIT_CONFIRMED_IN_BLOCK_CHAIN = 15;
12311297
BUYER_CONFIRMED_IN_UI_FIAT_PAYMENT_INITIATED = 16;
12321298
BUYER_SENT_FIAT_PAYMENT_INITIATED_MSG = 17;
@@ -1266,6 +1332,9 @@ message Trade {
12661332
MEDIATION_REQUESTED = 5;
12671333
MEDIATION_STARTED_BY_PEER = 6;
12681334
MEDIATION_CLOSED = 7;
1335+
REFUND_REQUESTED = 8;
1336+
REFUND_REQUEST_STARTED_BY_PEER = 9;
1337+
REFUND_REQUEST_CLOSED = 10;
12691338
}
12701339

12711340
enum TradePeriodState {
@@ -1305,6 +1374,11 @@ message Trade {
13051374
string counter_currency_tx_id = 28;
13061375
repeated ChatMessage chat_message = 29;
13071376
MediationResultState mediation_result_state = 30;
1377+
int64 lock_time = 31;
1378+
bytes delayed_payout_tx_bytes = 32;
1379+
NodeAddress refund_agent_node_address = 33;
1380+
PubKeyRing refund_agent_pub_key_ring = 34;
1381+
RefundResultState refund_result_state = 35;
13081382
}
13091383

13101384
message BuyerAsMakerTrade {
@@ -1330,8 +1404,8 @@ message ProcessModel {
13301404
PubKeyRing pub_key_ring = 4;
13311405
string take_offer_fee_tx_id = 5;
13321406
bytes payout_tx_signature = 6;
1333-
repeated NodeAddress taker_accepted_arbitrator_node_addresses = 7;
1334-
repeated NodeAddress taker_accepted_mediator_node_addresses = 8;
1407+
reserved 7; // Not used anymore
1408+
reserved 8; // Not used anymore
13351409
bytes prepared_deposit_tx = 9;
13361410
repeated RawTransactionInput raw_transaction_inputs = 10;
13371411
int64 change_output_value = 11;
@@ -1376,6 +1450,10 @@ message MediationDisputeList {
13761450
repeated Dispute dispute = 1;
13771451
}
13781452

1453+
message RefundDisputeList {
1454+
repeated Dispute dispute = 1;
1455+
}
1456+
13791457
enum MediationResultState {
13801458
PB_ERROR_MEDIATION_RESULT = 0;
13811459
UNDEFINED_MEDIATION_RESULT = 1;
@@ -1395,6 +1473,12 @@ enum MediationResultState {
13951473
PAYOUT_TX_SEEN_IN_NETWORK = 15;
13961474
}
13971475

1476+
//todo
1477+
enum RefundResultState {
1478+
PB_ERROR_REFUND_RESULT = 0;
1479+
UNDEFINED_REFUND_RESULT = 1;
1480+
}
1481+
13981482
///////////////////////////////////////////////////////////////////////////////////////////
13991483
// Preferences
14001484
///////////////////////////////////////////////////////////////////////////////////////////
@@ -1454,6 +1538,7 @@ message PreferencesPayload {
14541538
double buyer_security_deposit_as_percent_for_crypto = 52;
14551539
int32 block_notify_port = 53;
14561540
int32 css_theme = 54;
1541+
bool tac_accepted_v120 = 55;
14571542
}
14581543

14591544
///////////////////////////////////////////////////////////////////////////////////////////
@@ -1474,6 +1559,8 @@ message UserPayload {
14741559
Mediator registered_mediator = 11;
14751560
PriceAlertFilter price_alert_filter = 12;
14761561
repeated MarketAlertFilter market_alert_filters = 13;
1562+
repeated RefundAgent accepted_refund_agents = 14;
1563+
RefundAgent registered_refund_agent = 15;
14771564
}
14781565

14791566
///////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)