No description
Find a file
sanket1729 53a75ebbae Check the value assetion only on valid amounts
This causes crash on elements wallet when dealing with transactions that
have explicit values and confidential assets. This creates a somewhat
serious DoS attack as the sender can cause the reciever's wallet to
crash by partially blinding the change output. To make matters worse,
the wallet initially accepts the transaction, but fails while spending
the output.

This is likely caused by a combination of two bugs:
1) The wallet's current behaviour stores the complete transaction of interest
in CWalletTx instead of just Outpoints. Only that the spend time do we
iterate over all outputs, try to unblind them and check which are
isMine. When calling wtx.GetOutputValueOut() or similar calls, we hit this assertion.

While the current behaviour is okay, I think the correct way is move
the IsMine == ISMINE_NO at the start of the loop. We should not do be
any checks on outputs that are not ours. This is used in multiple
places at different parts of the codebase for different RPCs.

2) When dealing with partially blinded trasactions, ComputeBlindingData
correctly sets value = -1, and the cache byte to 1. When getting the
data again with GetBlindingData for explicit value and confidential
asset, we load the precomputed data with value = -1 and assert the
loaded value be the explicit value in the transaction. This is only true
for explicit value and explicit asset.

The changed assertion checks that written value should be same as the
explicit value that was written only when the amounts are valid
2022-08-08 03:28:51 -07:00
.github doc: Remove label from good first issue template 2020-08-24 09:31:24 +02:00
.tx qt: Bump transifex slug for 22.x 2021-04-21 13:46:41 +02:00
build-aux/m4 Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
build_msvc Merge a196c89317 into merged_master (Bitcoin PR bitcoin/bitcoin#22270) 2021-07-28 18:18:31 +00:00
ci ci: Disable one of the fuzz tests to work around bitcoin#22233 2022-05-25 19:47:48 -07:00
contrib Fix elements naming in gitian builds 2022-08-01 19:28:21 +00:00
depends Merge bitcoin/bitcoin#22436: build: use aarch64 Clang if cross-compiling for darwin on aarch64 2021-07-20 18:23:35 +08:00
doc PSET: docs: Fix constant names to match those actually used 2022-07-05 13:07:43 +12:00
share Merge 023e343b50 into merged_master (Elements PR ElementsProject/elements#1093) 2022-04-20 23:38:17 -07:00
src Check the value assetion only on valid amounts 2022-08-08 03:28:51 -07:00
test Merge pull request #1107 from gwillen/test-fix-1058 2022-06-28 16:27:30 -07:00
.appveyor.yml Switch Appveyor CI to VS2019 stable image 2021-06-14 20:35:00 +01:00
.cirrus.yml ci: Disable unsupported multiprocess build to get ci passing 2022-05-31 12:47:11 -07:00
.editorconfig Add EditorConfig file. 2021-02-10 08:00:06 +01:00
.gitattributes Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
.gitignore Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
.python-version Bump minimum python version to 3.6 2020-11-09 17:53:47 +10:00
.style.yapf test: .style.yapf: Set column_limit=160 2019-03-04 18:28:13 -05:00
autogen.sh scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
configure.ac Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
CONTRIBUTING.md Merge 933c6466c2 into merged_master (Bitcoin PR bitcoin/bitcoin#22109) 2021-07-19 19:25:00 +00:00
COPYING doc: Update license year range to 2021 2020-12-30 16:24:47 +01:00
INSTALL.md Update INSTALL landing redirection notice for build instructions. 2016-10-06 12:27:23 +13:00
libbitcoinconsensus.pc.in build: remove libcrypto as internal dependency in libbitcoinconsensus.pc 2019-11-19 15:03:44 +01:00
Makefile.am Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
README.md Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00
REVIEWERS Update REVIEWERS: I've found that I keep track of PRs in need of review without the need for DrahtBot's automated notification :) 2021-06-10 09:00:05 +00:00
SECURITY.md Squashed 'src/secp256k1/' changes from 90580edcc9..7a30cb0c9d 2022-05-25 15:18:23 -07:00

Elements Project blockchain platform

Build Status

https://elementsproject.org

This is the integration and staging tree for the Elements blockchain platform, a collection of feature experiments and extensions to the Bitcoin protocol. This platform enables anyone to build their own businesses or networks pegged to Bitcoin as a sidechain or run as a standalone blockchain with arbitrary asset tokens.

Modes

Elements supports a few different pre-set chains for syncing. Note though some are intended for QA and debugging only:

  • Liquid mode: elementsd -chain=liquidv1 (syncs with Liquid network)
  • Bitcoin mainnet mode: elementsd -chain=main (not intended to be run for commerce)
  • Bitcoin testnet mode: elementsd -chain=testnet3
  • Bitcoin regtest mode: elementsd -chain=regtest
  • Elements custom chains: Any other -chain= argument. It has regtest-like default parameters that can be over-ridden by the user by a rich set of start-up options.

Confidential Assets

The latest feature in the Elements blockchain platform is Confidential Assets, the ability to issue multiple assets on a blockchain where asset identifiers and amounts are blinded yet auditable through the use of applied cryptography.

Features of the Elements blockchain platform

Compared to Bitcoin itself, it adds the following features:

Previous elements that have been integrated into Bitcoin:

  • Segregated Witness
  • Relative Lock Time

Elements deferred for additional research and standardization:

Additional RPC commands and parameters:

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

License

Elements is released under the terms of the MIT license. See COPYING for more information or see http://opensource.org/licenses/MIT.

What is the Elements Project?

Elements is an open source, sidechain-capable blockchain platform. It also allows experiments to more rapidly bring technical innovation to the Bitcoin ecosystem.

Learn more on the Elements Project website

https://github.com/ElementsProject/elementsproject.github.io

Secure Reporting

See our vulnerability reporting guide