Skip to content

Conversation

@furszy
Copy link

@furszy furszy commented Apr 23, 2020

Foundational PR towards full Sapling integration. Covering, in a nutshell, the first two milestones:

1) "Build & depend/deterministic system configuration support".

Build system configuration basis for Sapling.
Rust, libsodium, librustzcash (Sapling rust library - up until version 0.2.0) + all of the needed crates dependencies (~34 libraries).

2) "Wallet: Sapling keys & addresses management. Generation/storage/encryption following ZIP32 derivation linked to wallet's BIP44 master seed".

New address format support, bech32 for Sapling payment addresses.
Sapling keys deterministic derivation from the wallet's master seed (same as regular/staking addresses. wallet's seed will restore PIVs and Shielded PIVs equally).
Sapling Keys/Addresses persistence on disk and encryption/decryption process connected to the wallet.
Support for extended full viewing key, incoming viewing key, outgoing viewing key and spending key (Further explanation here).

New/Updated RPC method calls added:

getnewshieldedaddress —> generating new bech32 Sapling address and adding it to the keystore encrypted/unencrypted.
listsaplingaddresses —> listing wallet Sapling addresses.
validateaddress → covering Sapling addresses support.

Test Coverage.

  • Unit tests

Sapling unit tests are under /src/test/librust/ directory.

  • Functional tests

Sapling functional tests are under /test/functional/ directory following the new prefix sapling_**.py .

NOTE:

Remember to fetch the params using the script in util/fetch-params.sh


— Next PR will cover the Sapling wallet transactions' management (commits history will not be as incremental as this foundational PR, needed to do it in this way because of the substantial amount of work in the build system area. Aiming to get us directly up-to-date with the latest work in the area).

@furszy furszy self-assigned this Apr 23, 2020
@furszy furszy added this to the 5.0.0 milestone Apr 23, 2020
@Fuzzbawls Fuzzbawls modified the milestones: 4.2.0, 5.0.0 Jun 3, 2020
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch 2 times, most recently from 11f1ed0 to 26d2071 Compare June 4, 2020 21:08
@furszy furszy changed the base branch from privacy_v5 to master June 4, 2020 22:19
@furszy
Copy link
Author

furszy commented Jun 4, 2020

Following the team call convo, moved PR target to master.

@furszy furszy changed the title [WIP] Sapling Foundations (Build System + ZIP32) Sapling Foundations (Build System + ZIP32) Jun 8, 2020
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch from 18d8b75 to cfed672 Compare June 10, 2020 23:18
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch from 2b2c119 to 2480876 Compare June 15, 2020 04:40
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch from 2480876 to 3bcd080 Compare July 9, 2020 21:51
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch from 3bcd080 to 823f142 Compare July 15, 2020 20:47
@furszy furszy added the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Jul 17, 2020
@Fuzzbawls
Copy link
Collaborator

added a few new commits to flesh out issues with gitian builds and libc version requirements.

#1770 was submitted as it's own PR as I felt is was a significant enough change to warrant a dedicated PR.

@furszy
Copy link
Author

furszy commented Jul 29, 2020

Awesome! 🍺

@random-zebra
Copy link

Needs one last rebase, due to the changes in the CMakeLists from #1738 recently merged.
Otherwise tested (both with depends and system libs) ACK.
Really awesome job 🍻
Testing of Gitian builds will be done after #1770 is merged.

The changes to the build system and the additions to the RPC interface should be documented. Though we'll certainly add a big section for the Sapling upgrade later, so just tagging "NeedsReleaseNotes" for now.

Fuzzbawls and others added 12 commits August 2, 2020 23:08
This also adds `configure` time checking for the presence of libsodium
and adds a config option `--disable-online-rust` that will prevent
fetching dependent crates from crates.io (this is required for `depends`
based builds such as gitian and TravisCI).
libsodium, rust (and cargo).
Also fetch and cache zk params.
Doing this avoids code duplication
This adds two methods of defining a custom zk params directory:

1. Runtime option `-paramsdir`, which functions exactly like `-datadir`.
2. Configure/Compile option `--with-params-dir` as a way to hard-code
the zk params directory at compile time.

The second method was added because our CI windows tests made the
assumption that the test environment was windows, which it isn't, so it
was trying to reference a path that doesn't exist.
Connected and corrected the flow to be able to upgrade any previous wallet version to the Sapling version (passing through the HD wallet upgrade first)
This is needed to address an issue with libsodium, no effect on other
dependencies.

Also pass `--disable-online-rust` to use the rust libs from depends, and
remove the riscv64 target as rust builds currently fail for that arch.
We need to use our own rust packages that have been patched to remove a
dependency on a glibc symbol that isn't available in our minimum
supported glibc version.
This makes `explicit_bzero` compatible with our minimum required glibc
version.
…dresses.

Nee to be using the same 'shielded' convention everywhere.
@furszy furszy force-pushed the 2020_v5_privacy_milestone_1_and_2 branch from 1693841 to c3e99fe Compare August 3, 2020 02:46
CMake will now fail if cargo or rustc cannot be found, as it should.
Added missing sodium library
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK 0e1ac93

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

ACK 0e1ac93 and merging... 🎉

@random-zebra random-zebra merged commit fddf765 into PIVX-Project:master Aug 5, 2020
@random-zebra random-zebra modified the milestones: 5.0.0, 4.3.0 Sep 10, 2020
@furszy furszy modified the milestones: 4.3.0, 5.0.0 Sep 23, 2020
random-zebra added a commit that referenced this pull request Dec 5, 2020
22a5f4f GUI + wallet: upgrade to sapling wallet workflow. (furszy)
72834a1 Wallet: HD wallets (FEATURE_PRE_SPLIT_KEYPOOL) automatic upgraded to FEATURE_SAPLING. (furszy)

Pull request description:

  HD wallets (`FEATURE_PRE_SPLIT_KEYPOOL`) automatic upgrade to `FEATURE_SAPLING` to support shielded functionality by default.

  This is an straightforward version bump because only the seed is needed to generate the sapling keys tree. More info in #1553.

  Plus added a version guard in the shielded addresses generation method, so pre-HD wallets show the proper error when they cannot generate shielded addresses (essentially, will notify the user that he/she needs to upgrade their wallet to support shielded operations).

  As an extra information, pre-HD wallets who upgrade to HD running v5, will automatically be upgraded to support sapling features. This was done in #1553 as well.

ACKs for top commit:
  random-zebra:
    ACK 22a5f4f
  Fuzzbawls:
    ACK 22a5f4f

Tree-SHA512: 7224457799fc9a7004048fdd0b2bdd13e74a39353fbc9e9e1316f74b9ab2f96d7b617866cdd06774351d20768255cb765640f09abdc4b6062e472a6e3ad684af
@random-zebra random-zebra removed the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Jan 3, 2021
@furszy furszy deleted the 2020_v5_privacy_milestone_1_and_2 branch November 29, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants