Commit graph

18 commits

Author SHA1 Message Date
Kristaps Kaupe
8d7d82f15c
Add local Tor autostart to missing scripts 2022-04-08 14:35:36 +03:00
Kristaps Kaupe
967a5bd0ae
Merge #852: Remove unused imports
fde23c3cc5 Remove unused imports (Kristaps Kaupe)

Pull request description:

  [Module imported but unused (F401)](https://www.flake8rules.com/rules/F401.html)
  ```
  $ flake8 --select=F401 $(git ls-files "*.py")
  ```

Top commit has no ACKs.

Tree-SHA512: 14cc06e521f533e194143ad0e553adb3646651b35633af90eb10fcb9f168bd1ca0bf890fa21ab1d89f01b12fc02aa77b4b2c1341186c127ad4a2df46f041cccd
2021-04-15 18:08:37 +03:00
Kristaps Kaupe
fde23c3cc5
Remove unused imports 2021-04-14 15:54:18 +03:00
Kristaps Kaupe
0d21b927c5
Require confirmed coins to receive payjoin 2021-04-02 21:16:27 +03:00
Adam Gibson
15468cbd15
Payjoin receiver via daemon.
This completes the task of enabling
network isolation by running the receiver
side using a hidden service in the daemon,
and communicating over AMP, as is already
the case for the sender.
Updates test_payjoin for daemon receiver.
Qt BIP78 receiver update for daemon.
2021-03-24 13:48:41 +00:00
Adam Gibson
23d0b8f39c
BIP78 receiver over a Tor hidden service.
This commit implements a command line script and a GUI
dialog to receive a payment using the BIP78 protocol,
by setting up an ephemeral hidden service.

It also deprecates the pre-existing inter-Joinmarket
protocol for payjoin payments, since we now have
both sending and receiving support for BIP78. Thus,
much code in Maker, Taker and client-daemon protocol
is removed, as is some documentation in docs/PAYJOIN.md.
Also the script `sendpayment.py` is altered to support
only the BIP78 variant.

The test in jmclient/test/test_payjoin now implements
BIP78 over a TCP connection, while the custom tests in
test/payjoinserver.py can support hidden service based
tests, but the latter is not included in the test suite
and may not always work (it is only for manual
investigations).

The following features of BIP78 are supported:
minfeerate
additionalfeeoutputindex - but *only* for single
change output transactions
maxadditionalfeecontribution

The receiver does not have nor request payment
output substitution.

Utxo selection is no longer sophisticated, instead
we only choose a single utxo to keep the size
increase of the transaction minimal. Thus UIH is
not addressed at the moment.

Errors returned are in line with BIP78.

Sequence numbers are checked by receiver, and
kept identical if uniform, otherwise respected.
Receiver uses transaction monitor to shut down
when the payment is seen.

The workflow is almost entirely implemented in
jmclient/payjoin.py and the command line script
is in scripts/receive-payjoin.py. The setup, including
configuration changes for Tor, are documented in
docs/PAYJOIN.md, including a user guide video linked.
2020-09-23 15:04:59 +01:00
Kristaps Kaupe
3876c1cf97 Change shebang to python3 and +x for scripts 2020-05-04 23:48:19 +03:00
Adam Gibson
fdb6b261d4
Merge #537: Fixed path for accessing wallets when receiving payjoin transactions
a0c8446 fixed location path for accessing wallets (Tim Akinbo)
2020-03-10 12:47:32 +00:00
Tim Akinbo
a0c8446552 fixed location path for accessing wallets 2020-03-10 03:56:57 +00:00
James Hilliard
4bf1f50d4e Remove Python 2 compatibility imports and disable Python 2 installation in setuptools. 2020-01-19 11:31:57 -07:00
Adam Gibson
8c8e6e2fa8
Move all user data to home directory
To facilitate easier management by users and to
follow generally accepted standards, this PR moves
the following all to user home directory, subdir
.joinmarket :
joinmarket.cfg file
wallets/ directory
logs/ directory
cmtdata/ directory
commitmentlist file

User can override location with --datadir option.
An info message is added on startup showing location.
2020-01-06 13:49:47 +00:00
Adam Gibson
1e1b03d097
Don't allow receive-payjoin start up without coins
Fixes #459. If the mixdepth chosen is empty, shutdown
immediately with ARGERROR. User can either choose a
different mixdepth and try again, or receive payment
another way.
2019-12-06 16:09:00 +00:00
Kristaps Kaupe
6926a31671
Allow both BTC and sat amounts for payjoin receive 2019-11-26 22:20:06 +02:00
Adam Gibson
eadbed2e02
Update receive-payjoin for walletservice arch 2019-11-26 14:31:04 +00:00
cindiv
52108b62d8 Update exit codes
Many exit codes were 0 (success) when they should have been 1
(general failure) or 2 (argument error). This corrects that.

Related: #409
2019-11-17 03:51:04 +00:00
cindiv
b83e27c391 Add --wallet-password-stdin
Related: Issue #409
2019-11-02 19:01:08 +00:00
AdamISZ
c654de05ff
Wallet and blockchain refactoring
Introduces WalletService object which is in control of
blockchain and wallet access.
The service manages a single transaction monitoring loop,
instead of multiple, and allows updates to the wallet from
external sources to be handled in real time, so that both Qt
and other apps (yg) can respond to deposits or withdrawals
automatically.
The refactoring also controls access to both wallet and
blockchain so that client apps (Taker, Maker) will not need
to be changed for future new versions e.g. client-side filtering.
Also updates and improves Wallet Tab behaviour in Qt (memory
of expansion state).
Additionally, blockchain sync is now --fast by default, with
the former default of detailed sync being renamed --recoversync.
2019-10-25 11:33:39 +01:00
AdamISZ
28abddf062
Implement payjoin (p2ep) direct payment joins
- update mktx() to allow optional locktime setting (and sequence)
- add a mk_shuffled_tx method to the wallet module
- add a P2EPTaker and P2EPMaker class (inherit from Taker, Maker)
- add a -T option to sendpayment script for doing payjoins
- add a receive_payjoin script for receivers.
- add payjoin tests in jmclient/test/test_payjoin.py
- add a custom utxo selection method select_one_utxo to support.py
- support bech32 wallets (SegwitWallet, p2wpkh) with native=true
  in config POLICY for PayJoin and direct send (not Joinmarket CJ)
- add a PayJoin.md usage guide in docs/
- include version bytes in pubkey message for forward compat
- taker pays fees but controls size (utxo number and fee/kB)
- add P2WPKH fee estimator
- Enforce INFO level logging in payjoin
- refactors regtest config settings into one place
- bugfix: script_to_address vbyte argument is bytes not integer
2019-01-19 16:46:40 +01:00