Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIP79 Support #3256

Closed
wants to merge 10 commits into from
Closed

BIP79 Support #3256

wants to merge 10 commits into from

Conversation

Kukks
Copy link
Contributor

@Kukks Kukks commented Mar 14, 2020

This PR adds support for BIP79 Payjoin sender support.
When a BIP21 is pasted into the address field and the bpu parameter is specified, it will attempt to send the signed transaction to the specified endpoint. If the response is successful, you should have updated, partially signed transaction with more inputs which is then verified, signed and broadcasted.

This is a very rough implementation as my knowledge of the wasabi codebase is limited.

ToDo (Incomplete)

@Kukks Kukks force-pushed the payjoin branch 2 times, most recently from c083f20 to 5f3c816 Compare March 14, 2020 07:56
Copy link
Collaborator

@MaxHillebrand MaxHillebrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very exciting @Kukks, thanks for this!
Do you by now have the testnet payjoin btcpay server up and running? Can you please link to it here.

@Kukks
Copy link
Contributor Author

Kukks commented Mar 15, 2020 via email

@nopara73
Copy link
Contributor

Something is off with CI here. For some strange reason only Linux runs. Other PRs are working properly.

@MaxHillebrand MaxHillebrand added this to MaxHillebrand in Dev meeting Mar 18, 2020
@MaxHillebrand MaxHillebrand removed this from MaxHillebrand in Dev meeting Mar 25, 2020
Copy link
Collaborator

@MaxHillebrand MaxHillebrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Qubes 4, Debian 10

At first, I pasted the url, and it showed the address, not the endpoint. When I pressed send, I got these errors.

2020-03-26 17:28:11 INFO	TransactionFactory (104)	Calculating dynamic transaction fee...
2020-03-26 17:28:11 INFO	TransactionFactory (171)	Fee: 141 Satoshi.
2020-03-26 17:28:11 INFO	TransactionFactory (174)	Estimated tx size: 141 vBytes.
2020-03-26 17:28:11 INFO	TransactionFactory (215)	Signing transaction...
2020-03-26 17:28:13 ERROR	SendControlViewModel (415)	System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at WalletWasabi.TorSocks5.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken cancel) in /home/user/WalletWasabi/WalletWasabi/TorSocks5/TorHttpClient.cs:line 174
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at WalletWasabi.Blockchain.Transactions.TransactionFactory.BuildTransaction(PaymentIntent payments, Func`1 feeRateFetcher, IEnumerable`1 allowedInputs, Func`1 lockTimeSelector, ITorHttpClient httpClient, String uri) in /home/user/WalletWasabi/WalletWasabi/Blockchain/Transactions/TransactionFactory.cs:line 236
   at WalletWasabi.Wallets.Wallet.BuildTransaction(String password, PaymentIntent payments, FeeStrategy feeStrategy, Boolean allowUnconfirmed, IEnumerable`1 allowedInputs, String bip79) in /home/user/WalletWasabi/WalletWasabi/Wallets/Wallet.cs:line 296
   at WalletWasabi.Gui.Controls.WalletExplorer.SendControlViewModel.<>c__DisplayClass45_0.<.ctor>b__42() in /home/user/WalletWasabi/WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs:line 398
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at WalletWasabi.Gui.Controls.WalletExplorer.SendControlViewModel.<.ctor>b__45_26() in /home/user/WalletWasabi/WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs:line 398

Then, I pasted the same url again, and it showed the endpoint, and the transaction was successfully broadcasted, however, it was not a payjoin also not on the second attempt

2020-03-26 17:28:52 INFO	TransactionFactory (104)	Calculating dynamic transaction fee...
2020-03-26 17:28:52 INFO	TransactionFactory (171)	Fee: 141 Satoshi.
2020-03-26 17:28:52 INFO	TransactionFactory (174)	Estimated tx size: 141 vBytes.
2020-03-26 17:28:52 INFO	TransactionFactory (215)	Signing transaction...
2020-03-26 17:28:53 INFO	TransactionFactory (337)	Transaction is successfully built: e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c.
2020-03-26 17:28:53 INFO	TransactionBroadcaster (46)	Trying to broadcast transaction with random node (::ffff:198.251.83.19):e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c.
2020-03-26 17:28:56 INFO	P2pBehavior (113)	Successfully served transaction to node ([::ffff:198.251.83.19]:18333): e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c.
2020-03-26 17:28:56 INFO	TransactionBroadcaster (69)	Disconnected node: ::ffff:198.251.83.19. Successfully broadcasted transaction: e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c.
2020-03-26 17:28:58 INFO	Global (587)	Transaction Notification (Information): Sent - 0.00030377 BTC - e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c
2020-03-26 17:29:00 INFO	TransactionBroadcaster (82)	Transaction is successfully propagated: e8d31e78f95d78cd190fdef84b08ab8380ff5f0e97f0047d259487b07f6e4b4c.

@Kukks
Copy link
Contributor Author

Kukks commented Apr 13, 2020

Superseded by #3528

@Kukks Kukks closed this Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants