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

WIP: 0.8.8 develop branch #351

Merged
merged 33 commits into from
Jan 13, 2023
Merged

WIP: 0.8.8 develop branch #351

merged 33 commits into from
Jan 13, 2023

Conversation

jgriffiths
Copy link
Contributor

Tracking all post 0.8.7 changes here for a while in case 0.8.7 needs a patch release.

jgriffiths and others added 9 commits November 30, 2022 11:41
Using the bip32 interface allows clients to avoid deriving private
keys outside of the library, and hides the implementation complexity of
dealing with multiple public key types (compressed/xonly/uncompressed).

Implement the existing private-key-only signing using the bip32
interface, and split the signing code into multiple sub-calls to be
exposed in upcoming commits.
…tcode

BIP174 uses scriptcode to refer to the script passed to generate the
signature hash, so follow that convention, with signing_script being
the source scriptPubKey or redeem script.

Update the generated files also.
@jgriffiths jgriffiths force-pushed the psbt_sign_updates branch 3 times, most recently from ea538ef to a60c426 Compare December 2, 2022 09:40
jgriffiths and others added 2 commits December 3, 2022 02:07
Updating emsdk to v3.1.27 was necessary for emscripten-core/emscripten#17915,
which allows using the same WASM build for both browser and nodejs envs.
shesek and others added 2 commits December 4, 2022 18:12
Users should move to the new JS wrappers which are significantly more
functional.
len should be reserved for actual lengths, vs num for a count of
(non-byte) elements.
@jgriffiths jgriffiths force-pushed the psbt_sign_updates branch 2 times, most recently from 7b195c6 to c28fe90 Compare December 6, 2022 12:16
`test` is a user-land port of the built-in `node:test` test runner
introduced in nodejs v18, currently marked as experimental. The port is
used so that the tests can run with older versions (bullseye_deps uses
nodejs v16) and can later be dropped-in replaced with `node:test`.
@jgriffiths jgriffiths force-pushed the psbt_sign_updates branch 2 times, most recently from f067dfb to 30d4fae Compare December 12, 2022 07:38
@JamieDriver
Copy link
Contributor

Not changed in this MR, but a quick fix (taking liberties, I know!) :
wally_map_init() and
wally_map_init_alloc() documentation (wally_map.h) does not include wally_map_verify_fn_t verify_fn.

@jgriffiths
Copy link
Contributor Author

Not changed in this MR,

@JamieDriver fixed, thanks for the report.

whitslack and others added 2 commits December 15, 2022 17:46
src/anti_exfil.c is empty if BUILD_STANDARD_SECP, so
src/test/test_anti_exfil.py fails with:

```
ERROR: test_anti_exfil (__main__.AntiExfilTests.test_anti_exfil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "src/test/test_anti_exfil.py", line 21, in test_anti_exfil
    ret = wally_ae_host_commit_from_bytes(entropy, 32, flags, host_commitment, 32)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
```

Furthermore, src/sign.c omits wally_s2c_sig_from_bytes and
wally_s2c_commitment_verify if BUILD_STANDARD_SECP, so
src/test/test_sign.py fails with:

```
ERROR: test_s2c (__main__.SignTests.test_s2c)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "src/test/test_sign.py", line 263, in test_s2c
    self.assertEqual(WALLY_OK, wally_s2c_sig_from_bytes(priv_key, 32, msg, 32, s2c_data, 32, flags, s2c_opening_out, 33, sig_out, 64))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
```
@JamieDriver
Copy link
Contributor

I've been using this branch for the past few weeks in Jade development, keeping up to date with branch updates.
All working well for me - my main focus has been on using the new PSBT-related functions and these all seem to be good. Not seen any regressions of any sort in general wally use.
So as far as I am concerned, ack c1f1ddb

@jgriffiths
Copy link
Contributor Author

thanks @JamieDriver I'm just waiting for some final JS updates from @shesek in this branch and will merge it after that, cheers.

shesek and others added 7 commits January 13, 2023 14:01
Mostly ported from the old wrap_js package, plus some from the
python/java tests.
The typescript linter was complaining about the use of `bigint[]`,
that syntax is only meant for use with primitives.
Scrypt with the BIP38 parameters can't work due to WASM's memory restrictions.

Also, remove excluded functions from the .wasm build itself by excluding
them from wasm_exports.sh (previously they were only excluded from the
JavaScript code generation).
BIP 141 specifies that the maximum valid witness program size is 40
bytes. BIP 350 includes a test vector with the maximum size that's also
included in test/bech32.js, which was failing prior to this commit.

Make the old value available as SEGWIT_V0_ADDRESS_PUBKEY_MAX_LEN, and add a
SEGWIT_V1_ADDRESS_PUBKEY_LEN constant for Taproot.
…ttings

As documented in `man sort`:

    *** WARNING *** The locale specified by the environment affects sort order.  Set LC_ALL=C to get the  traditional  sort  order
    that uses native byte values.

Before this change, my local dev env sorted the constants differently
compared to the docker env.
@jgriffiths jgriffiths force-pushed the psbt_sign_updates branch 2 times, most recently from 148f88d to 805e56c Compare January 13, 2023 10:36
@jgriffiths jgriffiths merged commit 00e3df9 into master Jan 13, 2023
@jgriffiths jgriffiths deleted the psbt_sign_updates branch January 13, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants