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

161 symmetric key pr2 #171

Merged
merged 8 commits into from
Jul 30, 2024
Merged

Commits on Jul 29, 2024

  1. feat: symmetric key notifications

    Implements public announcements encrypted via symmetric keys
    
    This is most useful for utxos that transfer funds within a single
    wallet such as change addresses.
    
    compared to on-chain pub-key public announcements:
    
    Data encrypted with symmetric keys is smaller than data encrypted with
    asymmetric keys so there is a blockchain space (and thus fee) savings.
    
    compared to off-chain expected utxos:
    
    symmetric-key announcements exist on the blockchain and thus are
    immune to local data-loss situations.  off-chain expected utxos do not
    use any blockchain space but require that the wallet holder make
    ongoing backups of wallet state and never lose them.
    dan-da committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    fa01488 View commit details
    Browse the repository at this point in the history
  2. refactor: simplify keys and utxo notifications

    code:
     * simplified `UtxoNotifyMethod` to `OnChain`, `OffChain`
     * simplified `UtxoNotifcation` to `OnChain(_)`, `OffChain(_)`
     * removed `UtxoNotifyMethodSpecifier`
     * change logic in `TxOutput::auto()`
     * add `KeyType` enum to improve abstraction
     * refactor common key logic into address::common
     * simplify WalletState::scan_for_announced_utxos()
     * simplify WalletState::find_spending_key_for_utxo()
     * add WalletState::get_all_known_spending_keys()
     * new param `owned_utxo_output_method` for `generate_tx_outputs()`
     * new param `change_key` for `create_transaction()
     * new param `key_type` for `next_receiving_address()` rpc
     * neptune-cli generate-wallet: remove display of first wallet addr
       as it should not be considered special/only.
    
    docs:
     * document keys and addresses in mdbook
     * document utxo notifications in mdbook
     * add/update type/method doc-comments
     * add some missing module doc-comments
    
    tests:
     * consolidate all key/addr tests into address_type::test
     * same test logic applies to both symmetric and generation keys
     * make all key tests into proptests (symmetric and generation)
     * make transaction_output tests more comprehensive
    dan-da committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b8a526c View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. chore: rename key types

    SpendingKey          --> GenerationSpendingKey
    ReceivingAddress     --> GenerationReceivingAddress
    SpendingKeyType      --> SpendingKey
    ReceivingAddressType --> ReceivingAddress
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    65b1237 View commit details
    Browse the repository at this point in the history
  2. perf: avoid unneeded write-lock in send_to_many

    we don't need to call add_expected_utxos_to_wallet() if there are not
    any offchain expected_utxos.
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    dde7d6b View commit details
    Browse the repository at this point in the history
  3. chore: make NeptuneCoins more human friendly.

    1. Adds a Debug impl that displays to_string() value.  Useful when
    reading failed assertions about coin amounts.
    
    2. Adds From<u8>, From<u16>, From<u32> infallible conversions.
    Makes it easy to do things like 42u8.into()
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    962ccf5 View commit details
    Browse the repository at this point in the history
  4. test: add mod global_state_tests::restore_wallet

    Adds tests for restoring a wallet from seed and verifying if balance
    is correct after performing both onchain and offchain notifications.
    
    demonstrates that offchain notifications are very risky and can
    lead to loss-of-funds even when wallet-owner has the seed backed up.
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    cf46a4b View commit details
    Browse the repository at this point in the history
  5. build: fix build errors for rustc 1.80

    1. update a couple crates in Cargo.lock where the old version was
       failing with rustc 1.80
    
    2. workaround rust stack overflow when compiling triton-vm
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    b0894b7 View commit details
    Browse the repository at this point in the history
  6. doc: fix clippy 1.80 doc-comment warning

    fixes some indentation warnings that are new in clippy 1.80
    dan-da committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    517db91 View commit details
    Browse the repository at this point in the history