Commit Graph
983 Commits
Author SHA1 Message Date
Alain Brenzikofer 7b4ac1bb8b review iterations 2026-09-26 14:29:40 +02:00
Alain Brenzikofer 143d073980 infallibel wallet and account derivation 2026-09-26 12:34:06 +02:00
Alain Brenzikofer 5db99e96b9 refactor WalletSeed type, see mq wip 2026-09-25 12:12:37 +02:00
Alain Brenzikofer acf06724ec rng preserve 2026-09-25 11:08:20 +02:00
Alain Brenzikofer c3c3d8e3c9 self-review iteration 9 2026-09-25 08:12:51 +02:00
Alain Brenzikofer 22c3e5d067 iteration 6 2026-09-24 17:05:14 +02:00
Alain Brenzikofer 0c0a9ec57b self-review iteration 5 2026-09-24 16:39:17 +02:00
Alain Brenzikofer 24ef8bf1f5 self-review iteration 3 2026-09-24 15:47:36 +02:00
Alain Brenzikofer 68c84a9e75 self-review iteration 2 2026-09-24 11:37:21 +02:00
Alain Brenzikofer 74e724fe41 Merge remote-tracking branch 'origin/master' into ab/wallet 2026-09-24 10:26:59 +02:00
Alain Brenzikofer 04b1992f94 fix review comments 2026-09-24 10:14:37 +02:00
EvgenyandEvgeny @ SimpleX Chat 9a9ce70b2f core: fix connecting via prepared connection with contact card (#7575)
* core: fix connecting via prepared connection with contact card

* simplify

* merge transactions

* update query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-24 08:11:29 +01:00
EvgenyandEvgeny @ SimpleX Chat 3af6e2abfe core: store extended contact and group preferences, for forward compatibility (#7506)
* core: store extended contact and group preferences, for forward compatibility

* simiplify

* fix

* fix bot api types

* query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-23 23:25:20 +01:00
spaced4ndy 150897d637 core, ui: alert the user when badge renewal is failing (#7532) 2026-09-22 12:55:08 +00:00
Alain Brenzikofer 7445e685b7 minimize diff and align style even more 2026-09-22 09:29:47 +02:00
Alain Brenzikofer 6b908c87e0 next review round 2026-09-22 08:01:01 +02:00
Alain Brenzikofer faa96e3da7 cut comments 2026-09-21 17:39:38 +02:00
Alain Brenzikofer 1c5ed7275d rename to adapt 2026-09-21 17:25:35 +02:00
Alain Brenzikofer 522f5dbd90 Merge remote-tracking branch 'origin/master' into ab/wallet 2026-09-21 17:11:02 +02:00
Alain Brenzikofer 768a230f21 /goal iteration 5 - unconfirmed 2026-09-21 17:03:54 +02:00
Alain Brenzikofer bfc4e1fbaa /goal iteration 4 - unconfirmed 2026-09-21 14:42:34 +02:00
sh c8f20bcc91 core, libs: configurable queue size, library fixes (#7542)
* core: add chat_migrate_init_queue FFI export

* bots: fix BadgeServiceErrorCode API type

* nodejs: pass required command fields

* nodejs: fix migration error types

* nodejs: install libsimplex from SIMPLEX_LIBS_DIR

* nodejs: add queue size option

* nodejs: regenerate docs

* python: add queue size option

* bots: pass incognito in APIConnect

* nodejs: accept documented success responses

* python: accept documented success responses

* nodejs: dispatch each bot message once

* nodejs: fix startChat events loop lifecycle

* nodejs, python: parse multi-line bot commands

* nodejs: fix file buffer handling in addon

* nodejs: keep events loop when chat stop fails

* python: fix send_and_wait race, load lib off loop

* python: make queue size export optional

* nodejs: receive events on a dedicated thread

* nodejs: release haskell thread after receive

* python: receive on a dedicated thread per chat

* python: test receive shutdown order

* nodejs: one receive thread per chat controller

* nodejs: harden receiver shutdown and tests

* nodejs: stop chat before closing store

* python: stop chat before closing store

* nodejs, python: harden close regression and retry

* python: free results with ucrt on windows

* nodejs: enable c++ exceptions on mac and windows
2026-09-19 12:18:46 +01:00
EvgenyandEvgeny @ SimpleX Chat edd44c5d54 test: fix compilation in ghc8.10.7 (#7541)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-19 08:43:49 +01:00
EvgenyandEvgeny @ SimpleX Chat c8466b2010 core: refactor groups (#7503)
* core: refactor groups

* refactor

* refactor

* refactor

* refactor

* refactor

* rename

* refactor

* remove

* rename

* diff

* simplify

* relay requests

* bot types

* check useRelays

* refactor

* query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-18 10:18:10 +01:00
spaced4ndy c7b3e362ec core, ui: badge credential details in developer tools (#7527) 2026-09-17 16:18:04 +00:00
spaced4ndy f38c7e0f2b core, ui: badge redeem errors and fixes (#7515)
- redeem errors are typed (CEBadgeRedeemError) instead of matched by text in the apps
- service timeout (A_SERVICE) decodes in the apps and offers Retry via the existing retry alert
- unexpected redeem errors show the error itself instead of a generic message
- service error codes are a typed enum in the apps (BadgeServiceErrorCode)
- CRBadgeRedeemed returns badge state, so the apps skip a second round-trip after redeem
- setBadgeAlertAcked is scoped to user_id
- badgeChanged updates non-active profiles, so other profiles' badges don't go stale
- pitch banner is not shown to a profile that already has a badge
- one badgeTypeName per platform, used by the badge screen and the badge info alert
- BadgeAlertKind and BadgeAlertPrice decode via standard JSON, no custom decoders
- dead "Support ended" title branch removed from Your Badge view
- kotlin: users from badge responses carry remoteHostId
- kotlin: redeem code field keeps the IME's cursor and composition state
- kotlin: "Get your code" shown in all flavours
- kotlin: "Don't show again" -> "Dismiss", matching iOS
- kotlin: parseBadgeCode moved next to its FFI in platform/Core.kt
- kotlin: BadgesView no longer cross-fades on badge state updates
- kotlin: section title not uppercased
- ios: redeem code field parses once per change
- ios: A_SERVICE rejected reason is not decoded
- CLI: "cannot redeem badge code: ..." with the source of the error
- comments clarified
2026-09-16 14:15:11 +00:00
brenzi 9af6fb00e6 minimal adjustment to make client compile against SMP-v22 PR (#7520)
* minimal adjustment to make client compile against SMP-v22 PR

* repin after upstream merge
2026-09-16 10:07:18 +01:00
spaced4ndy bac8d187ba Merge branch 'master' into badges 2026-09-14 17:13:58 +04:00
Alain Brenzikofer 4255b46c04 let remote use wallet, but filter logs to avoid leaking secrets 2026-09-14 15:01:47 +02:00
Alain BrenzikoferandClaude Opus 5 ba673f95bf core: export says which kind of secret, so other kinds can follow
/_wallet export name <k> rather than an index straight after export. The
bare form stays the seed mnemonic, and a profile's key can be added beside
the name one without the argument having to be guessed from its shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-14 08:09:04 +00:00
EvgenyandEvgeny @ SimpleX Chat 237409890e core: stop all workers on chat controller stop (#7502)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-13 17:19:15 +01:00
EvgenyandEvgeny @ SimpleX Chat ae19a81201 directory: option to set observer role by default (#7501)
* directory: set role

* role

* option

* shorter help

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-13 15:17:27 +01:00
EvgenyandEvgeny @ SimpleX Chat ca114a7a2a core: option to limit the max number of loaded chats (#7499)
* core: option to limit the max number of loaded chats

* update bot api

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-13 12:23:39 +01:00
EvgenyandEvgeny @ SimpleX Chat 5ffbe733a8 core: attach badge proofs to files over size limit (#7455)
* core: attach badge proofs to files over size limit

* types

* more types

* implement file badge proofs

* tests

* move file limits to config, add tests

* more tests, work correctly in "send as group" case

* fix races in tests

* group badge tests

* query plans

* add history support, fixes

* simplify

* refactor

* refactor

* type

* restructure schema for proofs

* rename, refactor

* refactor

* fix, refactor

* refactor

* ui

* comments

* alerts

* update nix, ios library

* updare sharing

* update simplexmq

* update text

* improve messages

* api types

* postgres schema

* fix

* test

* query plans

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-12 14:33:52 +01:00
Alain BrenzikoferandClaude Opus 5 87a0232d8e core: deleting the seed reports ok, not the empty wallet
Delete re-ran /_wallet, so a successful delete printed "no wallet key",
which is the same words the error uses and reads as a failure. There is
nothing to show after a delete.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-11 15:24:18 +00:00
Alain BrenzikoferandClaude Opus 5 da20a039ae core: the argument is a mnemonic, so name it one
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-11 14:06:26 +00:00
Alain BrenzikoferandClaude Opus 5 443fd43545 core: one command for the seed, whichever way it arrives
create and import differed only in where the entropy came from and already
shared one store function, so they are one command with the source named:
/_wallet create new, or /_wallet create seed=<phrase>. Naming it means no
seed is generated by typing a prefix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-11 12:28:46 +00:00
Alain BrenzikoferandClaude Opus 5 309358a162 core: names are the device's, so drop the per-profile account
A name's profile is the record it resolves to, not the key that owns it, so
the account level was carrying a mapping nothing needs. It was also the only
source of the profile to account ambiguity after a restore, of /_wallet
bind, and of the index gap and the refusal that told a visible profile an
account was held by one it cannot see. All of it goes.

Names sit in account 0 from index 1. Index 0 is left unused so neither the
names nor the profile accounts, which start at 1, claim the origin of both
dimensions. users gains no columns at all now, so the migration is one
CREATE TABLE.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-11 12:12:41 +00:00
EvgenyandEvgeny @ SimpleX Chat 44773d0412 core: support message signing in p2p groups (#7312)
* core: support message signing in p2p groups

* improve

* add member key

* distribute keys and sign

* refactor

* better query

* map

* sign in relay groups too

* clean up

* list

* fix test

* update bot types

* some refactor

* remove unnecessary condition

* simplify

* refactor

* simplify

* move

* clean up

* diff

* diff

* limit attempts for key sending

* optimize

* fix test

* split

* fuse

* null

* only mark as "key sent" when forwarder supports binary encoding

* fix bot apis

* fix some tests

* add key distribution steps, and fix some tests

* fix test

* increase timeout

* fix tests

* fix more tests

* simplify

* disable test output

* mark keys sent with invitations

* fix test

* fix test, query plans

* unify signing of connection info packets

* revert change to createNewGroup

* create key at group/member creation

* rename, remove liftIO

* clean up

* fix type

* remove ad hoc key sending

* update bot api

* diff

* reduce diff

* failing test

* fix sending messages in groups with members before version 18

* remove test delays

* update query plans

* update test

* add tests

* fix tests

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-09-11 12:33:07 +01:00
spaced4ndy c2c70fa114 core: fix flaky badge presentation catch-up test 2026-09-11 14:26:32 +04:00
spaced4ndy bd97e4df34 core: verify the badge ledger sent by the service (#7480) 2026-09-11 09:41:23 +00:00
Alain BrenzikoferandClaude Opus 5 619434626c core: store the seed as bytes, and bind one account per profile
On Postgres a bare ByteString binds as a text literal, so entropy with a
backslash or a high bit was rejected and entropy with a zero byte was
truncated: the BIP-39 test vector stored as an empty seed. Blob columns go
through DB.Binary here, as every other one does.

/_wallet bind with no account moved a profile that already had one to a
fresh account, abandoning the old one without saying so. It refuses now;
moving is asked for by number.

The counter could walk past 2^31, where BIP-32 hardening folds every index
back onto a low one, so a profile handed 2147483648 derived account 0's
keys and printed account 0's path. Binding refuses once the counter is
there, and a very long index is now rejected on its digit count rather than
after reading it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 14:28:06 +00:00
Alain BrenzikoferandClaude Opus 5 03b6ed9a53 core: drop the types nothing reads, and say account where it means account
AccountRef and WalletAccount were built and never read: deriveNameKey now
returns the key, and the address comes from addressFromPrivateKey, which
already exists. SeedId is a plain Int64 like every other row id here.

The master key is derived once per command rather than once per name key,
which is where PBKDF2 runs.

A device has a key and a profile has an account, so /_wallet says "no
account for this profile" rather than repeating "no wallet key", which is
what it says when the device has none.

Also: no "wallet: " in front of "bad chat command: ", strEncode for the
address, the repeated seed lookup in one place, comments cut to what the
code does not say, and the export test pins its addresses and secrets,
including one whose first byte is zero.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 13:45:48 +00:00
Alain BrenzikoferandClaude Opus 5 2d9fe10252 core: test the restore cases the key has to survive
A database backed up after the key carries the key and the binding, so the
restore is all of it and an import is refused. A database backed up before
the key comes back with the profiles and no binding, so the phrase is
imported and each profile says which account was its. A key imported before
the database is restored is replaced by what the backup held.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 13:12:27 +00:00
Alain BrenzikoferandClaude Opus 5 1e0c3503e0 core: create binds no profile either
Create and import differed only in whether they bound a profile, which made
the convenient one inconsistent. Neither binds now, so the store keeps one
function for both, and a profile reaches an account only through bind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 13:06:45 +00:00
Alain BrenzikoferandClaude Opus 5 9cba89aa17 core: create makes the seed, bind claims a path
The two were one command: on a device that already had a seed, /_wallet
create only bound a profile. Now create makes the seed and refuses when one
exists, and binds every profile that exists, as a new seed has no account
that already owns a name.

/_wallet import binds nothing. Which account a profile had is what an
import is recovering, and the seed does not say, so the profile says it
with /_wallet bind <account>. /_wallet bind with no account takes the next
free one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 12:51:09 +00:00
Alain BrenzikoferandClaude Opus 5 07acdbb85b core: say same seed, not same key, for the other profiles
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 12:31:23 +00:00
Alain BrenzikoferandClaude Opus 5 de895ff43a core: /_wallet bind, and name the other profiles instead of numbering them
Restoring a chat database older than the key loses which account each
profile had, and the keys are still there, so /_wallet bind <account> sets
it by hand. The counter moves past an account bound this way, and an
account another profile holds is refused.

/_wallet now shows the paths of the active profile only, and names the
other profiles on the key. Their account indexes were the gap that showed
a hidden profile exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 12:21:32 +00:00
Alain BrenzikoferandClaude Opus 5 ab50d9f4b1 core: reject a key index BIP-32 cannot harden
A.decimal wraps into Word32 and hardened leaves anything at or above 2^31
alone, so /_wallet export 4294967296 0 returned account 0's secret under the
path m/44'/60'/0'/0/0. Handing out a different account's key for a mistyped
index is the wrong failure for this command.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 11:15:02 +00:00
Alain BrenzikoferandClaude Opus 5 db1b6413e0 core: export the secret of a single name key
/_wallet export gives the seed mnemonic, /_wallet export <account> <name>
gives the secret of one derived key, so a single name can be handed over
without the seed. Both are what a wallet takes on import: the mnemonic as a
recovery phrase, the secret as hex.

The commands are named for what they return, APIWalletExportSeedMnemonic
and APIWalletExportDerivedSecret, as the difference is which secret leaves
the device.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvc3HbiWBTqbAvRT45G5oX
2026-09-10 10:11:29 +00:00