Code Monkey home page Code Monkey logo

gdk's People

Contributors

afilini avatar borgbyte avatar domegabri avatar glslang avatar greenaddress avatar inaltoasinistra avatar jamiedriver avatar jb55 avatar jgriffiths avatar jkauffman1 avatar leocomandini avatar lightyear15 avatar louisinger avatar lvaccaro avatar nitramiz avatar noib3 avatar omahs avatar promag avatar rcasatta avatar shesek avatar wtogami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdk's Issues

Determine null GA_json

Documentation states:

gdk/include/gdk.h

Lines 493 to 499 in adb65ad

* This must be called before GA_connect/GA_connect_with_proxy.
* Notifications may arrive on different threads so the caller must ensure
* that shared data is correctly locked within the handler.
* The GA_json object passed to the caller must be destroyed by the caller
* using GA_destroy_json. Failing to do so will result in memory leaks.
* When the session is disconnected/destroyed, a final call will be made to
* the handler with a NULL notification.

Currently to know if a GA_json is null I call GA_convert_json_value_to_string which gives the string "null".

Maybe GA_json_is_null or something could be added?

`GA_get_receive_address` address reuse with single-sig accounts

When I call GA_get_receive_address with single-sig liquid account it returns old addresses after some period.
I think that's a bug.

get_next_address function looks correct:

    pub fn get_next_address(&self) -> Result<AddressPointer, Error> {
        let pointer = {
            let store = &mut self.store.write()?;
            let acc_store = store.account_cache_mut(self.account_num)?;
            acc_store.indexes.external += 1;
            acc_store.indexes.external
        };
        ...

but the counter is probably rewritten from the Syncer thread:

impl Syncer {
    pub fn sync(&self, client: &Client) -> Result<HashSet<u32>, Error> {
        ...
                    if let Some(max) = max {
                        if i == 0 {
                            last_used.external = max + batch_count * BATCH_SIZE;
        ...

I'm attaching example program to reproduce the issue.
new_address.py.txt

DSO Linking does not allow undefined symbols

This needs to be changed to allow undefined symbols, at least when building a python module, since the preferred build option (and only option for manylinux/pypi) lets the interpreter provide the python symbols.

Given that the default is to build a library that can be a module or a shared library, I suggest we add a manylinux build option for this to build a "python module only" DSO, as per the wally manylinux changes.

Publish Rust crate & WASM support

Due to the Electrum dependency, it's likely the Rust crate can't be cross-compiled to WASM for web environments. The BDK approach to solving this is to use the bdk_esplora crate.

Also, I noticed that the Rust crates are unpublished, which means that any libraries depending on Rust GDK wouldn't also be able to be published.

Wallet synchronization status

We are developing a Dart mobile wallet using Gdk as wallet engine. We are interested about the singlesig features.
We understood Gdk uses a local cache and there is a thread that synchronize it.
We did not find any way to control the synchronization, or even to know its status. Is there some tool to manage it?
We think knowing the status would be useful, for example to import a wallet.
What do you think about this feature?

SPV with multi server validation

The SPV with multi-server mechanism at a library level should allow:

  • to enable/disable spv verification. By default is disabled. Flag spv_enabled in network_parameters.cpp, configurable via the connect method
  • to configure the primary electrum server. (which will be the only one which downloads the tx proof leaking most the privacy). It points by default to esplora blockstream.info:995. It will never switch automatically. Field electrum_url and flag tls in network_parameters.cpp, configurable via the connect method
  • to enable/disable the multi server cross validation. If a user points to his own electrum server he may want to not connect to others servers (even if he is leaking only his ip (if not tor) and his chain height and he is not asking tx proof to secondary servers). By default is enabled. Flag spv_cross_validation in network_parameters.cpp (not exist at the moment, to be added), configurable via the connect method.
  • to provide electrum cross validation URLs or use hardcoded ones. The server urls for multivalidation are hardcoded and must be taken from network_parameters field spv_cross_validation_electrum_urls, could be overwritable from connect. URLs could be initialized from electrum github and eventually updated on releases.

Apps are getting the result of SPV validation directly from the list_transactions in the spv_verified field which can assume the following values:

  • in_progress
  • verified
  • not_verified
  • disabled

Native rust could handle the population of the field with the internal store populated with the Headers thread, while the external API at the moment is triggered directly from the list_transactions call, to avoid to be too slow the result is cached and only one in_progress is allowed (see impl details)

The external API cache could potentially leak information of wallet txs, because of this an encryption_key must be passed to the spv_verify_tx, this field should be added to the get_transactions call.

Run on Elements Regtest?

I have an electrs server running on an elements regtest chain. How does one run gdk on the same chain?

Missing addressees in transaction details

Hi, the sender's address is missing in the transaction details of AMP asset transactions.

What I do is getting transactions with GA_get_transactions by passing

{
  "subaccount": "<subaccountPointer>",
  "first": "<lastTransactionNumber>",
  "count": 30
}

Here is a transaction of the AMP asset (faucet from testnet) that we get:

{
  "addressees": [
    ""
  ],
  "block_height": 277783,
  "can_cpfp": false,
  "can_rbf": false,
  "created_at_ts": "1648550172020897",
  "fee": 272,
  "fee_rate": 100,
  "inputs": [
    {
      "address": "",
      "address_type": "p2wsh",
      "addressee": "",
      "is_internal": false,
      "is_output": false,
      "is_relevant": false,
      "is_spent": true,
      "pointer": 0,
      "previdx": 0,
      "prevpointer": 5688,
      "prevsubaccount": 1,
      "prevtxhash": "680e6d1fdbf7ad6561ec51434561460184bc6c84fd8125c5006696574b58e68c",
      "pt_idx": 0,
      "script_type": 14,
      "subaccount": 1,
      "subtype": 0
    },
    {
      "address": "",
      "address_type": "p2wsh",
      "addressee": "",
      "is_internal": false,
      "is_output": false,
      "is_relevant": false,
      "is_spent": true,
      "pointer": 0,
      "previdx": 1,
      "prevpointer": 6639,
      "prevsubaccount": 1,
      "prevtxhash": "5f4fa9c38ceb0989f169d588b314df4910e11b23f5c3802f3686d96f62626e03",
      "pt_idx": 1,
      "script_type": 14,
      "subaccount": 1,
      "subtype": 0
    }
  ],
  "memo": "",
  "outputs": [
    {
      "address": "vjU1jK5Yvwy5pEmdbFsrsWzA6uEFSpY1zhiiRhTC5s3j84ABJgUoiRcpHCn44mFoVrm2xw2kRRrHRZFw",
      "address_type": "p2wsh",
      "addressee": "",
      "amountblinder": "29bd2dfdf514c6ba8012c5dfb28eae5b150ac8c7a8b129088195333406337219",
      "asset_id": "bea126b86ac7f7b6fc4709d1bb1a8482514a68d35633a5580d50b18504d5c322",
      "asset_tag": "0a8a03d058e90cd4133cc351faf746caa2b210b1d8d64517f194b057307751f5f2",
      "assetblinder": "2f9b72c910104ad89b575de477e8dac6aedd988219c1c0fc42c067f505de8d70",
      "blinding_key": "02fef45b84a7667b920d6955de7b22c3c7107b0e57273b99c8630177180b829ab6",
      "commitment": "0813c041b3a92fb38766e5c973a64fbea796dc886de8de123b1b3d8cd5d8464e14",
      "confidential": true,
      "is_blinded": true,
      "is_internal": false,
      "is_output": true,
      "is_relevant": true,
      "is_spent": false,
      "nonce_commitment": "030943a4d89b39192d7a85c1d92dfaa5f896324a447664c839e8f59d0ca1492fac",
      "pointer": 1,
      "pt_idx": 0,
      "satoshi": 1,
      "script": "a914f676caea01b88ef78c1e8fadcacaee61ba914ad887",
      "script_type": 14,
      "subaccount": 1,
      "subtype": 0,
      "unblinded_address": "92teF7Q3642c7ThZ8x4MJwhgmtFWJsV5xG"
    },
    {
      "address": "8iw6cuTLtzSJDoridsbQEsaiWoxUKB5qvu",
      "address_type": "p2wsh",
      "addressee": "",
      "asset_tag": "0a2203c30f535ce83f1d32878a648f14675730e89d95492bff0bdd65d83686097a",
      "commitment": "08e8d69279de2d6502809ace9661139ea7ec2a3a385a57d658bbd2d5cf647adeda",
      "is_internal": false,
      "is_output": true,
      "is_relevant": false,
      "is_spent": false,
      "nonce_commitment": "02a562bdbdb3cdf97ad429dbc6535344a973e8334bcafd4c788e3a531f7a535ec1",
      "pointer": 0,
      "pt_idx": 1,
      "script": "a914317b60b91b2a89d99b603621b0103ebbd1cab28087",
      "script_type": 14,
      "subaccount": 1,
      "subtype": 0
    },
    {
      "address": "",
      "address_type": "",
      "addressee": "",
      "asset_tag": "01499a818545f6bae39fc03b637f2a4e1e64e590cac1bc3a6f6d71aa4443654c14",
      "commitment": "010000000000000110",
      "is_internal": false,
      "is_output": true,
      "is_relevant": false,
      "is_spent": false,
      "nonce_commitment": "000000000000000000000000000000000000000000000000000000000000000000",
      "pointer": 0,
      "pt_idx": 2,
      "script": "",
      "script_type": 0,
      "subaccount": 0,
      "subtype": 0
    }
  ],
  "rbf_optin": false,
  "satoshi": {
    "bea126b86ac7f7b6fc4709d1bb1a8482514a68d35633a5580d50b18504d5c322": 1
  },
  "server_signed": true,
  "spv_verified": "disabled",
  "transaction_size": 9451,
  "transaction_vsize": 2703,
  "transaction_weight": 10812,
  "txhash": "d7251fcec8628edff999bfbbf97c6cc47adf3d13a9a5febca31e7925ceeb7127",
  "type": "incoming",
  "user_signed": true
}

tested on v0.0.50 and v0.0.51

num_conf on get_balance

Using last lib (0.0.55) on python3.0 installed on Ubuntu Jammy Jellyfish (or 22.04)

session.get_balance({'subaccount': 0, 'num_confs': 2})

Generate error num_confs must be set to 0 or 1
Can you implement this function for num_confs >1?

Failed build

Debian Sid. If you need any info - just ask.


FAILED: src/25a6634@@greenaddress@sha/sqlite3_sqlite3.c.o 
gcc -Isrc/25a6634@@greenaddress@sha -Isrc -I../src -I. -I../ -I../subprojects/libwally-core-5776668e5dfa70f6c2d2ec8beaef319ba37beade/../../build-gcc/libwally-core/build/include -Isubprojects/autobahn-cpp-bf40951174ab34b0202a0bab4c200237ee4d6e71 -I../subprojects/autobahn-cpp-bf40951174ab34b0202a0bab4c200237ee4d6e71 -I../subprojects/boost_1_72_0/../../build-gcc/boost/build/include -I../subprojects/GSL-7e99e76c9761d0d0b0848b91f8648830670ee872/include -I../subprojects/json-3.8.0/single_include -I../subprojects/msgpack-3.2.1/include -I../subprojects/openssl-OpenSSL_1_1_1g/../../build-gcc/openssl/build/include -Isubprojects/websocketpp-1026e877449aeee27e0bb51746a96ab42d133652 -I../subprojects/websocketpp-1026e877449aeee27e0bb51746a96ab42d133652 -I../subprojects/tor-tor-0.4.2.7/../../build-gcc/tor/src/feature/api -I../subprojects/zlib-1.2.11/../../build-gcc/zlib -I../subprojects/libevent-release-2.1.11-stable/../../build-gcc/libevent/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O3 -Wextra -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fexceptions -fstack-protector-strong -fvisibility=hidden -DGDK_BUILD -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -fPIC -pthread -MD -MQ 'src/25a6634@@greenaddress@sha/sqlite3_sqlite3.c.o' -MF 'src/25a6634@@greenaddress@sha/sqlite3_sqlite3.c.o.d' -o 'src/25a6634@@greenaddress@sha/sqlite3_sqlite3.c.o' -c ../src/sqlite3/sqlite3.c
../src/sqlite3/sqlite3.c: In function ‘sqlite3SelectNew’:
../src/sqlite3/sqlite3.c:129137:10: error: function may return address of local variable [-Werror=return-local-addr]
129137 |   return pNew;
       |          ^~~~
../src/sqlite3/sqlite3.c:129097:10: note: declared here
129097 |   Select standin;
       |          ^~~~~~~
../src/sqlite3/sqlite3.c:129097:10: note: declared here
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.

[feature] Connect to your Core Lightning node

It looks like Green uses Greenlight for the lightning wallet. it would be nice to be able to connect to your Core Lightning node and use it instead.

A dependency for this is allowing non tls connections to electrum servers which is not currently working.

add proxy ping

Description

Setting an invalid proxy (or enabling tor without orbot running in parallel) results in a bad user experience when onboarding, restoring or logging in.

Following Blockstream/green_ios#3 : having a proxy ping when user sets a proxy would solve this (providing users with a proper error message).

Version

0.0.7

Can't load single-sig cache

When I restart my single-sig testnet liquid wallet, loading the cache fails with an error here:

impl RawCache {
    fn try_new<P: AsRef<Path>>(path: P, cipher: &Aes256GcmSiv) -> Result<Self, Error> {
        let decrypted = load_decrypt(Kind::Cache, path, cipher)?;
        let store = ciborium::from_reader(&decrypted[..])?; // Fails with the "invalid type: bytes, expected bytes" error
        Ok(store)
    }

As a result, loading the single-sig wallet after a restart is slow because it downloads everything from scratch.

Looks like the problem is caused by the derived BETransaction serde implementation:

#[derive(Debug, Clone, Serialize, Deserialize, Hash)]
pub enum BETransaction {
    Bitcoin(bitcoin::Transaction),
    Elements(elements::Transaction),
}

I tried this as a test and it worked fine (balance is available almost instantly after restart):

impl serde::Serialize for BETransaction {
    fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
        match self {
            BETransaction::Bitcoin(_) => todo!(),
            BETransaction::Elements(tx) => {
                serializer.serialize_str(&elements::encode::serialize_hex(tx))
            }
        }
    }
}

impl<'de> serde::Deserialize<'de> for BETransaction {
    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        let hex = String::deserialize(deserializer)?;
        let vec = Vec::<u8>::from_hex(&hex).map_err(|e| serde::de::Error::custom(e))?;
        let value = elements::encode::deserialize(&vec).map_err(|e| serde::de::Error::custom(e))?;
        Ok(BETransaction::Elements(value))
    }
}

`./tools/build.sh --clang --iphone static` fails with Undefined Symbols

Tried running ./tools/build.sh --clang --iphone static on a Mac (presumably needed for iOS) and ultimately got this result. How does one get this build to complete?

Undefined symbols for architecture arm64:
  "_ENGINE_by_id", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_ctrl_cmd_string", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_free", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_cipher_engine", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_default_DH", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_default_EC", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_default_RAND", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_default_RSA", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_digest_engine", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_id", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_get_name", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_load_builtin_engines", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_register_all_complete", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
  "_ENGINE_set_default", referenced from:
      _crypto_openssl_late_init in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_openssl_mgt.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

ga_rust: implement get_previous_addresses

Interface details here

Green QT uses "address", "tx_count", "address_type", so those field must be populated.
tx_count is equal to the number of inputs and outputs associated to an address.

ga_session.cpp currently returns at most 10 addresses per call, so it makes sense to do the same on the rust side.

[OSX] build fails

I'm trying to build the python wrapper for gdk on my mac (BigSur) with these steps:

$ mkdir gdk-python
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r ./tools/requirements.txt
$ ./tools/build.sh --install $PWD/gdk-python --clang --python-version 3.9

but i get following error on the very last command (./tools/build.sh ...):

The Meson build system
Version: 0.58.0
Source dir: <datadir>/gdk
Build dir: <datadir>/gdk/build-clang
Build type: native build
Project name: gdk
Project version: 0.0.54

meson.build:1:0: ERROR: Compiler clang can not compile programs.

A full log can be found at <datadir>/gdk/build-clang/meson-logs/meson-log.txt

And this is the content of the meson-log.txt log file:

Build started at 2022-06-27T16:48:48.830448
Main binary: /usr/local/opt/[email protected]/bin/python3.9
Build Options: -Dpython-version=3.8 -Dbuildtype=release -Ddefault_library=shared -Dwerror=True
Python system: Darwin
The Meson build system
Version: 0.62.2
Source dir: <datadir>/gdk
Build dir: <datadir>/gdk/build-clang
Build type: native build
Project name: gdk
Project version: 0.0.54
Sanity testing C compiler: clang
Is cross compiler: False.
Sanity check compiler command line: clang sanitycheckc.c -o sanitycheckc.exe -isysroot /Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -O3
Sanity check compile stdout:

-----
Sanity check compile stderr:
clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-----

meson.build:1:0: ERROR: Compiler clang can not compile programs.

How can I fix this?

Link to gdk_rpc

This is the first step towards integrating gdk_rpc into gdk

"the handshake failed" error with v0.0.57

Hello,
I'm updating Gdk from versione 0.0.55 to 0.0.57 in our unreleased wallet.

I receive the error

{ message: "the handshake failed: Interrupted system call (os error 4)", error: "id_unknown" }

on Gdk calls GA_get_fee_estimates and GA_send_transaction. The methods interface was not changed from v0.0.55.

Have you already had this problem? Thanks

GDK Documentation Improvement Proposal

I have spent the past 3 hours writing up a bloated, detailed, and useless GitHub issue draft that I ended up trashing about my troubles with GDK mobile integrations with flutter. But I thought it would be more helpful to suggest a contribution effort that I would like to spearhead with the help of the GDK developer team at Blockstream. Which is a complete revamp of the GDK platform integration documentation.

My Motivation:

I believe in Liquid as a future settlement layer for the future of Bitcoin Finance and the next generation of Bitcoin-based payment processors [the latter is the use-case I'm interested in pursuing] that can settle other assets besides Bitcoin alone. The groundwork for this is approachable, concise, & comprehensive documentation that covers most common base use cases. As it stands now with the current GDK documentation, it might as well be closed-source because it's inapproachable for outsiders like myself who aren't familiar with the codebase or its languages, or tools, to quickly integrate with Liquid and move on to the feature set that makes their wallet special. I don't think the GDK Documentation puts the Liquid network in a position to capitalize off of a community that will take the Liquid Ecosystem to the next level, even on the dimension of community maintained wallets alone.

My Experience with GDK & Blockstream support:

I have spent the past week trying to understand where to start to integrate GDK with a Liquid Bitcoin Wallet Product Idea I have, and I can't even get to the point where I have the library added, let alone use it. It has been a wild goose chase of teaching myself basic C, C++, the C++ build tools ecosystem and may more things just to get my head around where to start. I don't think it's a coincidence that the only wallet [to my knowledge] in the Liquid ecosystem is maintained by the Blockstream team. Even when I got into contact with Blockstream support through email TWICE to get in contact with the GDK team, my complaints got shelved, because I was told that the team had important deadlines to hit, and they'll get to it when they can. Truthfully this felt like an emotional gut punch. The feeling of being on an island with a foreign codebase and no developer support is one of the worst feelings a developer can have. This only worsens the mortality rate of new projects in the ecosystem. Vibrant developer ecosystems require a sizable upfront investment, and if we want to build something that's larger than Blockstream it's time to invest in our developer ecosystem with quality resources. This feels almost too obvious to mention, but documentation has asymmetrically large compounding effects for any developer ecosystem.

Next Steps:

I would like to connect with at least 1 person on the Blockstream GDK team who would have enough expertise on the GDK Codebase to help draw up some initial skeleton documentations, and the programming of pre-made templates that could be leveraged further to show the power of the GDK. We could start with the full documentation and comprehensive demos of the following platforms:

  1. iOS [Swift]
  2. Android [Kotlin]
  3. Flutter [Dart]

I would need at least 1 person from the GDK team to help me with this starting out because I have no idea what the protocol for C/C++ integration is for these platforms is, and I couldn't do it on my own, even if I wanted to. I estimate the time commitment won't be too large but I believe the benefits of easily approachable documentation far exceed the upfront time investment, and I would be more than willing to do the supermajority of the work, I just need the knowledge.

Apologies for the diatribe, but I'm hoping this can be an inflection point for the Liquid and more generally the Blockstream developer ecosystem, Thanks.

Validation error when creating subaccount in Java

I'm trying to use the create_subaccount method from Java wrapper. This is the JSON I'm trying to use:

{ name: "test", type: “2of2” }

Unfortunately I get [Error: [json.exception.type_error.302] type must be number, but is object] during the execution. I tried to use a number like 0 or 1 for type and I get this error: [Error: [json.exception.type_error.302] type must be string, but is number].
What is a valid value for type?

GDK 0.68.0 Windows build crashes in `GA_connect`

GDK 0.68.0 Windows build crashes in GA_connect when used with multi-sig accounts (single-sig accounts work fine).

I have reproduced the crash in a minimal program (main.cpp).
To build:

x86_64-w64-mingw32-c++ main.cpp -o gdk_crash -I/root/gdk/include -I/root/gdk/build-windows-mingw-w64/src -I/prebuild/mingw-w64/nlohmann_json/include /root/gdk/build-windows-mingw-w64/libgreenaddress.dll.a

Copy libgreenaddress.dll and required mingw libs:

/root/gdk/build-windows-mingw-w64/libgreenaddress.dll
/usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp-0.dll
/usr/lib/gcc/x86_64-w64-mingw32/10-posix/libstdc++-6.dll
/usr/lib/gcc/x86_64-w64-mingw32/10-posix/libgcc_s_seh-1.dll
/usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll

Then run the binary (gdk_crash.exe):

GA_init...
send: {"datadir":"./","log_level":"debug"}
34.413 DEBUG - populated the cache with 0 files
34.413 DEBUG - loading 0 cache files
34.414 INFO - `init` took 4.43793ms
GA_create_session...
GA_connect...
send: {"name":"liquid"}
[2023-10-05 09:27:34.409299] [0x00001688] [info]    change_state_to: requesting state connected
[2023-10-05 09:27:34.409299] [0x00002204] [info]    net: thread started for gdk version 
[2023-10-05 09:27:34.426265] [0x00002204] [info]    net: desired connected actual disconnected
[2023-10-05 09:27:34.426265] [0x00002204] [info]    net: connect to wss://green-liquid-mainnet.blockstream.com/v2/ws
[2023-10-05 09:27:39.444271] [0x000028c4] [info]    Error getting remote endpoint: system:10009 (The file handle supplied is not valid)
[2023-10-05 09:27:39.459714] [0x000028c4] [info]    asio async_shutdown error: asio.ssl:336462100 (asio.ssl error)
[2023-10-05 09:27:39.459714] [0x00002204] [info]    transport connect ignoring exception:Dynamic exception type: boost::wrapexcept<autobahn::network_error>
std::exception::what: failed to connect
[2023-10-05 09:27:39.475348] [0x00002204] [info]    ignoring exception:Dynamic exception type: boost::wrapexcept<std::exception>
std::exception::what: std::exception
[2023-10-05 09:27:39.475348] [0x00002204] [info]    ignoring exception:Dynamic exception type: boost::wrapexcept<autobahn::protocol_error>
std::exception::what: session already stopped
[2023-10-05 09:27:39.490892] [0x00002204] [info]    ignoring exception:network transport already disconnected
[2023-10-05 09:27:39.490892] [0x00002204] [debug]   waiting for connection to die
[2023-10-05 09:27:39.506534] [0x00002204] [debug]   connection is dead
[2023-10-05 09:27:39.506534] [0x00002204] [info]    net: backing off for 2s
Segmentation fault

I tried building on Debian 12 and Debian 11, same crash happens.
It works fine on Linux:

GA_init...
send: {"datadir":"./","log_level":"debug"}
11.086 DEBUG - populated the cache with 0 files
11.086 DEBUG - loading 0 cache files
11.086 INFO - `init` took 279.464µs
GA_create_session...
GA_connect...
send: {"name":"liquid"}
[2023-10-05 10:40:11.088242] [0x00007fb3000bc640] [debug]   endpoint constructor
[2023-10-05 10:40:11.088272] [0x00007fb3000bc640] [debug]   client constructor
[2023-10-05 10:40:11.088307] [0x00007fb3000bc640] [debug]   set_pong_timeout_handler
[2023-10-05 10:40:11.088319] [0x00007fb2f87216c0] [info]    net: thread started for gdk version 
[2023-10-05 10:40:11.088335] [0x00007fb3000bc640] [debug]   asio::init_asio
[2023-10-05 10:40:11.088582] [0x00007fb3000bc640] [info]    change_state_to: requesting state connected
[2023-10-05 10:40:11.088610] [0x00007fb2f87216c0] [info]    net: desired connected actual disconnected
[2023-10-05 10:40:11.088617] [0x00007fb2f87216c0] [info]    net: connect to wss://green-liquid-mainnet.blockstream.com/v2/ws
[2023-10-05 10:40:11.088711] [0x00007fb2f87216c0] [debug]   set_open_handler
[2023-10-05 10:40:11.088721] [0x00007fb2f87216c0] [debug]   set_close_handler
[2023-10-05 10:40:11.088725] [0x00007fb2f87216c0] [debug]   set_fail_handler
[2023-10-05 10:40:11.088735] [0x00007fb2f87216c0] [debug]   set_message_handler
[2023-10-05 10:40:11.088846] [0x00007fb2f87216c0] [debug]   create_connection
[2023-10-05 10:40:11.088922] [0x00007fb2f87216c0] [debug]   asio con transport constructor
[2023-10-05 10:40:11.089015] [0x00007fb2f87216c0] [debug]   connection constructor
[2023-10-05 10:40:11.089078] [0x00007fb2f87216c0] [debug]   transport::asio::init
[2023-10-05 10:40:11.090339] [0x00007fb2f87216c0] [debug]   starting async DNS resolve for green-liquid-mainnet.blockstream.com:443
[2023-10-05 10:40:11.262926] [0x00007fb2f8f226c0] [debug]   Async DNS resolve successful. Results: 34.110.237.101:443 
[2023-10-05 10:40:11.263000] [0x00007fb2f8f226c0] [debug]   Starting async connect
[2023-10-05 10:40:11.263777] [0x00007fb2f8f226c0] [debug]   asio handle_resolve_timeout timer cancelled
[2023-10-05 10:40:11.393245] [0x00007fb2f8f226c0] [debug]   Async connect to 34.110.237.101:443 successful.
[2023-10-05 10:40:11.393367] [0x00007fb2f8f226c0] [debug]   connection start
[2023-10-05 10:40:11.393451] [0x00007fb2f8f226c0] [debug]   asio connection init
[2023-10-05 10:40:11.393601] [0x00007fb2f8f226c0] [debug]   asio connection handle pre_init
[2023-10-05 10:40:11.393617] [0x00007fb2f8f226c0] [debug]   asio connection post_init
[2023-10-05 10:40:11.395008] [0x00007fb2f8f226c0] [debug]   asio handle_connect_timeout timer cancelled
[2023-10-05 10:40:11.526730] [0x00007fb2f8f226c0] [debug]   Checking for pinned certificate
[2023-10-05 10:40:11.526924] [0x00007fb2f8f226c0] [debug]   Found pinned certificate 64e286b76063602a372efd60cde8db2656a49ee15e84254b3d6eb5fe38f4288b
[2023-10-05 10:40:11.527622] [0x00007fb2f8f226c0] [debug]   asio connection handle_post_init
[2023-10-05 10:40:11.527676] [0x00007fb2f8f226c0] [debug]   connection handle_transport_init
[2023-10-05 10:40:11.527824] [0x00007fb2f8f226c0] [debug]   connection send_http_request
[2023-10-05 10:40:11.528297] [0x00007fb2f8f226c0] [debug]   Raw Handshake request:
GET /v2/ws HTTP/1.1
Connection: Upgrade
Host: green-liquid-mainnet.blockstream.com
Sec-WebSocket-Key: KLziMDuB262iqt5fuv6PPQ==
Sec-WebSocket-Protocol: wamp.2.msgpack
Sec-WebSocket-Version: 13
Upgrade: websocket
User-Agent: WebSocket++/0.8.1


[2023-10-05 10:40:11.529058] [0x00007fb2f8f226c0] [debug]   asio post init timer cancelled
[2023-10-05 10:40:11.529366] [0x00007fb2f8f226c0] [debug]   handle_send_http_request
[2023-10-05 10:40:11.529410] [0x00007fb2f8f226c0] [debug]   asio async_read_at_least: 1
[2023-10-05 10:40:11.829420] [0x00007fb2f8f226c0] [debug]   asio con handle_async_read
[2023-10-05 10:40:11.829552] [0x00007fb2f8f226c0] [debug]   handle_read_http_response
[2023-10-05 10:40:11.829968] [0x00007fb2f8f226c0] [debug]   Raw response: HTTP/1.1 101 Switching Protocols
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Connection: Upgrade
Date: Thu, 05 Oct 2023 06:40:11 GMT
Sec-WebSocket-Accept: obqBne+fO1l0JKwY1nVxYdO6oQo=
Sec-WebSocket-Protocol: wamp.2.msgpack
Server: openresty/1.21.4.1
Upgrade: websocket
Via: 1.1 google


[2023-10-05 10:40:11.830353] [0x00007fb2f8f226c0] [debug]   p = 0 bytes transferred = 0
[2023-10-05 10:40:11.830379] [0x00007fb2f8f226c0] [debug]   asio async_read_at_least: 1
[2023-10-05 10:40:11.830524] [0x00007fb2f8f226c0] [debug]   open handshake timer cancelled
[2023-10-05 10:40:11.831771] [0x00007fb2f8f226c0] [debug]   connection send
[2023-10-05 10:40:11.831972] [0x00007fb2f8f226c0] [debug]   write_push: message count: 1 buffer size: 125
[2023-10-05 10:40:11.832703] [0x00007fb2f8f226c0] [debug]   write_pop: message count: 0 buffer size: 0
[2023-10-05 10:40:11.833118] [0x00007fb2f8f226c0] [debug]   connection handle_write_frame
[2023-10-05 10:40:12.000661] [0x00007fb2f8f226c0] [debug]   asio con handle_async_read
[2023-10-05 10:40:12.000807] [0x00007fb2f8f226c0] [debug]   p = 0 bytes transferred = 918
[2023-10-05 10:40:12.000827] [0x00007fb2f8f226c0] [debug]   calling consume with 918 bytes
[2023-10-05 10:40:12.001189] [0x00007fb2f8f226c0] [debug]   Processing Bytes: 82 7E 03 92 93 02 CF 00 01 0D 68 83 2D 39 C3 8B A9 78 5F 63 62 5F 6E 6F 64 65 D9 2D 6C 69 71 75 69 64 2D 6D 61 69 6E 6E 65 74 2D 62 61 63 6B 65 6E 64 2D 65 75 72 6F 70 65 2D 77 65 73 74 32 2D 76 37 37 63 2D 32 34 38 32 AB 78 5F 63 62 5F 77 6F 72 6B 65 72 A9 77 6F 72 6B 65 72 30 30 31 A9 78 5F 63 62 5F 70 65 65 72 B4 74 63 70 34 3A 31 32 37 2E 30 2E 30 2E 31 3A 33 32 38 31 30 A8 78 5F 63 62 5F 70 69 64 CD 09 E1 A5 72 65 61 6C 6D A6 72 65 61 6C 6D 31 A6 61 75 74 68 69 64 BD 34 4D 53 50 2D 33 50 54 57 2D 59 54 46 4D 2D 47 48 46 48 2D 4C 57 35 37 2D 45 4E 43 59 A8 61 75 74 68 72 6F 6C 65 A9 61 6E 6F 6E 79 6D 6F 75 73 AA 61 75 74 68 6D 65 74 68 6F 64 A9 61 6E 6F 6E 79 6D 6F 75 73 AC 61 75 74 68 70 72 6F 76 69 64 65 72 A7 64 79 6E 61 6D 69 63 A9 61 75 74 68 65 78 74 72 61 84 A9 78 5F 63 62 5F 6E 6F 64 65 D9 2D 6C 69 71 75 69 64 2D 6D 61 69 6E 6E 65 74 2D 62 61 63 6B 65 6E 64 2D 65 75 72 6F 70 65 2D 77 65 73 74 32 2D 76 37 37 63 2D 32 34 38 32 AB 78 5F 63 62 5F 77 6F 72 6B 65 72 A9 77 6F 72 6B 65 72 30 30 31 A9 78 5F 63 62 5F 70 65 65 72 B4 74 63 70 34 3A 31 32 37 2E 30 2E 30 2E 31 3A 33 32 38 31 30 A8 78 5F 63 62 5F 70 69 64 CD 09 E1 A5 72 6F 6C 65 73 82 A6 62 72 6F 6B 65 72 81 A8 66 65 61 74 75 72 65 73 8A B8 70 75 62 6C 69 73 68 65 72 5F 69 64 65 6E 74 69 66 69 63 61 74 69 6F 6E C3 BA 70 61 74 74 65 72 6E 5F 62 61 73 65 64 5F 73 75 62 73 63 72 69 70 74 69 6F 6E C3 B0 73 65 73 73 69 6F 6E 5F 6D 65 74 61 5F 61 70 69 C3 B5 73 75 62 73 63 72 69 70 74 69 6F 6E 5F 6D 65 74 61 5F 61 70 69 C3 BD 73 75 62 73 63 72 69 62 65 72 5F 62 6C 61 63 6B 77 68 69 74 65 5F 6C 69 73 74 69 6E 67 C3 B3 70 75 62 6C 69 73 68 65 72 5F 65 78 63 6C 75 73 69 6F 6E C3 B7 73 75 62 73 63 72 69 70 74 69 6F 6E 5F 72 65 76 6F 63 61 74 69 6F 6E C3 B4 70 61 79 6C 6F 61 64 5F 74 72 61 6E 73 70 61 72 65 6E 63 79 C3 BC 70 61 79 6C 6F 61 64 5F 65 6E 63 72 79 70 74 69 6F 6E 5F 63 72 79 70 74 6F 62 6F 78 C3 AF 65 76 65 6E 74 5F 72 65 74 65 6E 74 69 6F 6E C3 A6 64 65 61 6C 65 72 81 A8 66 65 61 74 75 72 65 73 8B B5 63 61 6C 6C 65 72 5F 69 64 65 6E 74 69 66 69 63 61 74 69 6F 6E C3 BA 70 61 74 74 65 72 6E 5F 62 61 73 65 64 5F 72 65 67 69 73 74 72 61 74 69 6F 6E C3 B0 73 65 73 73 69 6F 6E 5F 6D 65 74 61 5F 61 70 69 C3 B5 72 65 67 69 73 74 72 61 74 69 6F 6E 5F 6D 65 74 61 5F 61 70 69 C3 B3 73 68 61 72 65 64 5F 72 65 67 69 73 74 72 61 74 69 6F 6E C3 AE 63 61 6C 6C 5F 63 61 6E 63 65 6C 69 6E 67 C3 B8 70 72 6F 67 72 65 73 73 69 76 65 5F 63 61 6C 6C 5F 72 65 73 75 6C 74 73 C3 B7 72 65 67 69 73 74 72 61 74 69 6F 6E 5F 72 65 76 6F 63 61 74 69 6F 6E C3 B4 70 61 79 6C 6F 61 64 5F 74 72 61 6E 73 70 61 72 65 6E 63 79 C3 B2 74 65 73 74 61 6D 65 6E 74 5F 6D 65 74 61 5F 61 70 69 C3 BC 70 61 79 6C 6F 61 64 5F 65 6E 63 72 79 70 74 69 6F 6E 5F 63 72 79 70 74 6F 62 6F 78 C3 
[2023-10-05 10:40:12.001295] [0x00007fb2f8f226c0] [debug]   bytes left after consume: 0
[2023-10-05 10:40:12.001308] [0x00007fb2f8f226c0] [debug]   Complete message received. Dispatching
[2023-10-05 10:40:12.004569] [0x00007fb2f8f226c0] [debug]   asio async_read_at_least: 1
[2023-10-05 10:40:12.004737] [0x00007fb2f87216c0] [info]    net: connection successful
[2023-10-05 10:40:12.041028] [0x00007fb3000bc640] [info]    change_state_to: changed to connected
Success

main.cpp.txt

Deadlock in `GA_login_user` if network disconnected (multi-sig wallet)

I got a deadlock in GA_login_user if network is disconnected in the middle of the login process (multi-sig wallet).
I called GA_login_user and some short time later I received a notification (in different thread) that the network connection is down:

{"event":"network","network":{"current_state":"disconnected","next_state":"connected","wait_ms":0}}

but GA_login_user never returned.

Here is the relevant stack trace:

GA_login_user  (in libsideswap_client.dylib) + 204  [0x11b540b08]
ga::sdk::auto_auth_handler::advance()  (in libsideswap_client.dylib) + 24  [0x11b51cadc]
ga::sdk::auto_auth_handler::step()  (in libsideswap_client.dylib) + 2608  [0x11b51d730]
ga::sdk::auth_handler_impl::operator()()  (in libsideswap_client.dylib) + 636  [0x11b51a2e8]
ga::sdk::login_user_call::call_impl()  (in libsideswap_client.dylib) + 3636  [0x11b54b264]
ga::sdk::ga_session::authenticate(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<ga::sdk::signer>)  (in libsideswap_client.dylib) + 3348  [0x11b58d4bc]
ga::sdk::ga_session::on_post_login(std::__1::unique_lock<std::__1::mutex>&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool)  (in libsideswap_client.dylib) + 8364  [0x11b583b64]
ga::sdk::ga_session::subscribe_all(std::__1::unique_lock<std::__1::mutex>&)  (in libsideswap_client.dylib) + 372  [0x11b58820c]
ga::sdk::wamp_transport::subscribe(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::function<void (nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >)>, bool)  (in libsideswap_client.dylib) + 500  [0x11b817860]
boost::future<autobahn::wamp_subscription>::get()  (in libsideswap_client.dylib) + 92  [0x11b81839c]
boost::detail::shared_state<autobahn::wamp_subscription>::get(boost::unique_lock<boost::mutex>&)  (in libsideswap_client.dylib) + 84  [0x11b822bd4]
boost::condition_variable::wait(boost::unique_lock<boost::mutex>&)  (in libsideswap_client.dylib) + 76  [0x11ac76174]
_pthread_cond_wait  (in libsystem_pthread.dylib) + 1236  [0x1aee2c83c]
__psynch_cvwait  (in libsystem_kernel.dylib) + 8  [0x1aedf2270]

This happend on macOS arm64 GDK build (commit edacc118176d157597062272dc7bb6ea4ba01afc).

Docker build fails

System: MacOS 12.3 - M1

▶ docker build -t greenaddress_sdk - < tools/Dockerfile

[+] Building 2.7s (8/9)
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 376B                                       0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye@sha256  2.5s
 => [auth] library/debian:pull token for registry-1.docker.io              0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 2B                                            0.0s
 => CANCELED [1/4] FROM docker.io/library/debian:bullseye@sha256:45ee40a8  0.0s
 => => resolve docker.io/library/debian:bullseye@sha256:45ee40a844048c2f6  0.0s
 => => sha256:261c0783b9da74027da2b6f62206d4cca9b1e8706c1efb1 529B / 529B  0.0s
 => => sha256:723b4a01cd2a11283cbeb1aa41ff94c3e8f53dedaf2 1.48kB / 1.48kB  0.0s
 => => sha256:45ee40a844048c2f6d0105899c1a17733530b56d481 1.85kB / 1.85kB  0.0s
 => ERROR [2/4] COPY bullseye_deps.sh /deps.sh                             0.0s
 => ERROR [3/4] COPY requirements.txt /requirements.txt                    0.0s
------
 > [2/4] COPY bullseye_deps.sh /deps.sh:
------
------
 > [3/4] COPY requirements.txt /requirements.txt:
------
failed to compute cache key: "/requirements.txt" not found: not found

`encrypt_with_pin` raises a RuntimeError

Using python-swig gdk 0.55 (.whl file), the following code:

pin_data = session.encrypt_with_pin({ 'pin': '1234', 'plaintext': { 'mnemonic': 'word word word word'} }).resolve()

raises a RuntimeError: RuntimeError: assertion failure: ../src/session_impl.cpp:get_nonnull_signer:392:

build fails

Using tools/build.sh --clang and --gcc on Debian Bullseye.
Error is from using --clang.
GDK 0.0.47

[3/4] Linking target src/libgreenaddress.so
FAILED: src/libgreenaddress.so 
clang++  -o src/libgreenaddress.so src/libgreenaddress.so.p/amount.cpp.o src/libgreenaddress.so.p/assertion.cpp.o src/libgreenaddress.so.p/auth_handler.cpp.o src/libgreenaddress.so.p/client_blob.cpp.o src/libgreenaddress.so.p/containers.cpp.o src/libgreenaddress.so.p/exception.cpp.o src/libgreenaddress.so.p/ffi_c.cpp.o src/libgreenaddress.so.p/ga_auth_handlers.cpp.o src/libgreenaddress.so.p/ga_cache.cpp.o src/libgreenaddress.so.p/ga_session.cpp.o src/libgreenaddress.so.p/ga_strings.cpp.o src/libgreenaddress.so.p/ga_tor.cpp.o src/libgreenaddress.so.p/ga_tx.cpp.o src/libgreenaddress.so.p/ga_wally.cpp.o src/libgreenaddress.so.p/http_client.cpp.o src/libgreenaddress.so.p/inbuilt.cpp.o src/libgreenaddress.so.p/network_parameters.cpp.o src/libgreenaddress.so.p/session.cpp.o src/libgreenaddress.so.p/session_impl.cpp.o src/libgreenaddress.so.p/signer.cpp.o src/libgreenaddress.so.p/socks_client.cpp.o src/libgreenaddress.so.p/sqlite3_sqlite3.c.o src/libgreenaddress.so.p/transaction_utils.cpp.o src/libgreenaddress.so.p/utils.cpp.o src/libgreenaddress.so.p/xpub_hdkey.cpp.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,libgreenaddress.so -fuse-ld=gold -ldl -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -Wl,--whole-archive /home/user/builds/gdk/build-clang/libwally-core/build/lib/libwallycore.a -Wl,--no-whole-archive /home/user/builds/gdk/build-clang/libwally-core/build/lib/libsecp256k1.a /home/user/builds/gdk/build-clang/boost/build/lib/libboost_chrono.a /home/user/builds/gdk/build-clang/boost/build/lib/libboost_date_time.a /home/user/builds/gdk/build-clang/boost/build/lib/libboost_log.a /home/user/builds/gdk/build-clang/boost/build/lib/libboost_system.a /home/user/builds/gdk/build-clang/boost/build/lib/libboost_thread.a /home/user/builds/gdk/build-clang/openssl/build/lib/libssl.a /home/user/builds/gdk/build-clang/openssl/build/lib/libcrypto.a /home/user/builds/gdk/build-clang/zlib/libz.a /home/user/builds/gdk/build-clang/libevent/build/lib/libevent_core.a /home/user/builds/gdk/build-clang/libevent/build/lib/libevent_pthreads.a /home/user/builds/gdk/build-clang/libevent/build/lib/libevent_extra.a /home/user/builds/gdk/build-clang/tor/src/core/libtor-app.a /home/user/builds/gdk/build-clang/tor/src/ext/ed25519/donna/libed25519_donna.a /home/user/builds/gdk/build-clang/tor/src/ext/ed25519/ref10/libed25519_ref10.a /home/user/builds/gdk/build-clang/tor/src/ext/keccak-tiny/libkeccak-tiny.a /home/user/builds/gdk/build-clang/tor/src/lib/libcurve25519_donna.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-buf.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-compress.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-confmgt.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-container.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-crypt-ops.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-ctime.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-dispatch.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-encoding.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-err.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-evloop.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-fdio.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-fs.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-geoip.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-intmath.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-lock.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-log.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-malloc.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-math.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-memarea.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-meminfo.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-net.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-osinfo.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-pubsub.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-sandbox.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-smartlist-core.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-string.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-term.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-thread.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-time.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-tls.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-trace.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-version.a /home/user/builds/gdk/build-clang/tor/src/lib/libtor-wallclock.a /home/user/builds/gdk/build-clang/tor/src/trunnel/libor-trunnel.a -pthread -lm -latomic -Wl,--end-group
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function have_capability_support: error: undefined reference to 'cap_get_proc'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function have_capability_support: error: undefined reference to 'cap_free'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_get_proc'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_clear'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_set_flag'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_set_flag'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_set_flag'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_set_proc'
/home/user/builds/gdk/build-clang/tor/src/lib/libtor-process.a(setuid.o):setuid.c:function drop_capabilities: error: undefined reference to 'cap_free'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Build fails with c library 'secp256k1' not found

I have tried to build on OSx and Linux but the build always fails whith

||Message: --- Failed to run command (stderr) ---
||Message: configure.ac:10: installing 'build-aux/compile'
||configure.ac:5: installing 'build-aux/config.guess'
||configure.ac:5: installing 'build-aux/config.sub'
||configure.ac:9: installing 'build-aux/install-sh'
||configure.ac:9: installing 'build-aux/missing'
||Makefile.am: installing 'build-aux/depcomp'
||parallel-tests: installing 'build-aux/test-driver'
||configure.ac:24: installing 'tools/build-aux/compile'
||configure.ac:7: installing 'tools/build-aux/config.guess'
||configure.ac:7: installing 'tools/build-aux/config.sub'
||configure.ac:23: installing 'tools/build-aux/install-sh'
||configure.ac:23: installing 'tools/build-aux/missing'
||src/Makefile.am: installing 'tools/build-aux/depcomp'
||parallel-tests: installing 'tools/build-aux/test-driver'
||configure: WARNING: using cross tools not prefixed with host triplet
||configure: WARNING: using cross tools not prefixed with host triplet
||/bin/bash: /home/bsh/jre1.8.0_251/bin/javac: No such file or directory
||make[1]: *** [swig_java/src/com/blockstream/libwally/Wally.class] Error 127
||make: *** [all-recursive] Error 1
||

subprojects/libwally-core-461478ed2db9756ac99e0dc7ee4847306895771d/meson.build:33:0: ERROR: C library 'secp256k1' not found

GDK 0.0.62 (and earlier) rejected by Google PlayStore due to 'defective' openssl version

Hi GDK team, we are using GDK as part of an Android app for its wallet functions in a custom Elements chain.

After a few years of smooth submissions and publications, Google are rejected our latest submissions with the attached complaint that the .apk includes an unstable version of openssl.

The original complaint was based on a very old GDK library (not sure which version but from 2 or 3 years ago)
We updated to 0.0.53 which states "Update openssl to 1.1.1n", but received the same rejection response
We updated to 0.0.62 but again received the same rejection response.

I am assured by the main developer that we are not linked to openssl in any other parts of the application (I cannot be 100% confident of this though)

Has anyone else experienced this issue?
Do the PlayStore team automate all of these checks or is it possible there is wide scope for human error and they are testing an old submission?
Any help would be appreciated.
2023-05-17 17 11 28

GA_disconnect does not stop session

GA_disconnect does not stop non-electrum network sessions.
To reproduce call:

    GA_create_session
    GA_set_notification_handler
    GA_connect
    GA_login_user
    GA_disconnect
    GA_destroy_session

Result:
Network notifications are still received after GA_disconnect and GA_destroy_session calls (for example when you stop and restart internet connection).

The session is stopped with this change in session::disconnect:

-            if (p && p->get_network_parameters().is_electrum()) {
+            if (p) {
                 GDK_LOG_SEV(log_level::debug) << "session is something and we are in electrum. Disconnect";
                 p->disconnect();
             }

But helper boost threads are not stopped after that and so it's not a proper fix.
I'm attaching small program that could reproduce the bug.
gdk_test.zip

Need `electrum_tls` set to False

I am posting here as issue seems to affect all platforms tested (iOS; Mac OS), and configuration option causing problem on all platforms AFAICT is in this repository at:

{ "electrum_tls", true },

Description of Problem

I can't connect to a personal electrum server, which causes all sorts of unexpected failure behaviours across all platforms when creating or restoring wallets

Cause of problem

I believe this is because Green/GDK always forces Electrum TLS to be true, and I am running non-TLS only on port 50001.

Logs

GDK

Note electrum_url is electrs.local:50001, and electrum_tls is Bool(true).

[2022-04-16 13:07:46.813813] [gdk:debug] 46.813 INFO - create_session Object({"address_explorer_url": String("https://blockstream.info/address/"), "bech32_prefix": String("bc"), "bip21_prefix": String("bitcoin"), "cert_expiry_threshold": Number(1), "csv_buckets": Array([]), "development": Bool(false), "electrum_onion_url": String("omitted.onion:110"), "electrum_tls": Bool(true), "electrum_url": String("electrs.local:50001"), "liquid": Bool(false), "mainnet": Bool(true), "max_reorg_blocks": Number(144), "name": String("Bitcoin (Electrum)"), "network": String("electrum-mainnet"), "p2pkh_version": Number(0), "p2sh_version": Number(5), "pin_server_onion_url": ...

Electrs

[2022-04-16T17:17:08.200Z WARN  electrs::server] InvalidData on first line may indicate client attempted to connect using SSL when server expects unencrypted communication.
[2022-04-16T17:17:08.200Z WARN  electrs::thread] recv_loop thread failed: 0: recv failed
[2022-04-16T17:17:08.200Z WARN  electrs::thread] because: stream did not contain valid UTF-8

Setup details

Green Wallet, latest version from official channels on iOS and Mac OS

Electrs, git commit 1b4cc1ec0fd51caeea92da9d959a00805a4810a4 (latest)

Green and Electrs running on private network, not publicly exposed (hence no TLS)

Bitcoin mainnet

android restore mnemonic error

On android the validate mnemonic function gives always GDK_ERROR_CODE -1 with the method GA_validate_mnmemonic. This error occurs while passing a valid mnemonic or a wrong one

GDK version 0.0.54

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.