Secret Message PoC Build Error

@vilkris I’m trying to build this encrypted message PoC

However I get this error. I have installed the necessary dependency as outlined in the original post.

Dart SDK version: 3.4.0 (stable) (Mon May 6 07:59:58 2024 -0700) on "macos_arm64"

environment:
  sdk: '>=2.14.0 <3.0.0'

dependencies:
  dcli: ^1.7.1
  znn_sdk_dart:
    git:
      url: https://github.com/zenon-network/znn_sdk_dart.git
      ref: 367ddc7fbfefb6484d7553d9ac7e4532003a7008 # v0.0.4

Could this be a Dart version issue? Looks like the SDK is fixed.

mkdir -p build
dart compile exe cli_handler.dart -o build/znn-cli
../../.pub-cache/hosted/pub.dev/dcli-1.12.4/lib/src/script/runner.dart:34:21: Error: The method 'waitFor' isn't defined for the class 'ScriptRunner'.
 - 'ScriptRunner' is from 'package:dcli/src/script/runner.dart' ('../../.pub-cache/hosted/pub.dev/dcli-1.12.4/lib/src/script/runner.dart').
Try correcting the name to the name of an existing method, or defining a method named 'waitFor'.
    final process = waitFor<Process>(
                    ^^^^^^^
../../.pub-cache/hosted/pub.dev/dcli-1.12.4/lib/src/util/wait_for_ex.dart:25:17: Error: Method not found: 'waitFor'.
    value = cli.waitFor<T>(future);
                ^^^^^^^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/grp.dart:296:35: Error: Field 'gr_name' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? gr_name;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/grp.dart:299:35: Error: Field 'gr_passwd' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? gr_passwd;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/grp.dart:303:17: Error: Field 'gr_gid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? gr_gid;
                ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/grp.dart:306:48: Error: Field 'gr_mem' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Pointer<ffi.Int8>>? gr_mem;
                                               ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:291:35: Error: Field 'pw_name' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? pw_name;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:295:35: Error: Field 'pw_passwd' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? pw_passwd;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:299:17: Error: Field 'pw_uid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? pw_uid;
                ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:303:17: Error: Field 'pw_gid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? pw_gid;
                ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:306:35: Error: Field 'pw_gecos' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? pw_gecos;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:309:35: Error: Field 'pw_dir' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? pw_dir;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/pwd.dart:312:35: Error: Field 'pw_shell' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? pw_shell;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:723:40: Error: Field '_unique___locales_item_0' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_0;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:724:40: Error: Field '_unique___locales_item_1' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_1;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:725:40: Error: Field '_unique___locales_item_2' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_2;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:726:40: Error: Field '_unique___locales_item_3' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_3;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:727:40: Error: Field '_unique___locales_item_4' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_4;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:728:40: Error: Field '_unique___locales_item_5' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_5;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:729:40: Error: Field '_unique___locales_item_6' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_6;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:730:40: Error: Field '_unique___locales_item_7' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_7;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:731:40: Error: Field '_unique___locales_item_8' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_8;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:732:40: Error: Field '_unique___locales_item_9' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_9;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:733:40: Error: Field '_unique___locales_item_10' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_10;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:734:40: Error: Field '_unique___locales_item_11' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_11;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:735:40: Error: Field '_unique___locales_item_12' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<__locale_data>? _unique___locales_item_12;
                                       ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:741:35: Error: Field '_unique___names_item_0' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_0;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:742:35: Error: Field '_unique___names_item_1' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_1;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:743:35: Error: Field '_unique___names_item_2' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_2;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:744:35: Error: Field '_unique___names_item_3' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_3;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:745:35: Error: Field '_unique___names_item_4' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_4;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:746:35: Error: Field '_unique___names_item_5' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_5;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:747:35: Error: Field '_unique___names_item_6' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_6;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:748:35: Error: Field '_unique___names_item_7' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_7;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:749:35: Error: Field '_unique___names_item_8' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_8;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:750:35: Error: Field '_unique___names_item_9' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_9;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:751:35: Error: Field '_unique___names_item_10' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_10;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:752:35: Error: Field '_unique___names_item_11' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_11;
                                  ^
../../.pub-cache/hosted/pub.dev/posix-2.2.3/lib/src/string/string.dart:753:35: Error: Field '_unique___names_item_12' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_12;
                                  ^
Error: AOT compilation failed
Bad state: Generating AOT kernel dill failed!
make: *** [all] Error 64
1 Like

This is because you’re running a newer dart version. Either use an old version or try dart pub upgrade.

OK - did that and then got this

mkdir -p build
dart compile exe cli_handler.dart -o build/znn-cli
init_znn.dart:83:9: Error: 'ArgParser' isn't a type.
  final ArgParser argParser = ArgParser();
        ^^^^^^^^^
init_znn.dart:83:31: Error: Method not found: 'ArgParser'.
  final ArgParser argParser = ArgParser();
                              ^^^^^^^^^
Error: AOT compilation failed
Bad state: Generating AOT kernel dill failed!
make: *** [all] Error 64

Had to add import 'package:args/args.dart'; to init_znn.dart. Now I’m getting an argon error libargon2_ffi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

Looks like I’ll move to ‘x86_64’ and retry

OK - Im in. I’m going to send Zir Gay a message and see if he can get through all these hurdles. Check out the response below.

Can't fetch recipient public key because the recipient's account chain is empty.

I got it to work finally. Need to send to an account chain with more than 0 tokens in it. Let’s see if the recipient can decipher it.

1 Like

@vilkris I sent you an encrypted message to test your PoC. I finally found a reason to use it. Curious if you can read this. LMK if anyone else wants to receive a message.

{
    "version": 1,
    "chainIdentifier": 1,
    "blockType": 2,
    "hash": "bcabd874738166b062e6ea17c7b26b2d6503df823cd604b813ff7e9162154945",
    "previousHash": "ccedaeefc50d6b65930b7baa7320d8318715f2880eef035018d15e96257e7a77",
    "height": 5,
    "momentumAcknowledged": {
        "hash": "7d337b2fcf1ec145947a53b9b77740b8d090df5c1179f409b9e4d39479b4aba7",
        "height": 8744704
    },
    "address": "z1qrj8v9krx4r6adwacyq4a8n7qcq3l2jn2v50u2",
    "toAddress": "z1qrgnzs4jh2yfldarepysqgsukgdmwmqw5v0t7c",
    "amount": "0",
    "tokenStandard": "zts1qqqqqqqqqqqqqqqqtq587y",
    "fromBlockHash": "0000000000000000000000000000000000000000000000000000000000000000",
    "descendantBlocks": [],
    "data": "ss0rILb9tnQSsobUg5WS4H024G\/ib5vlaLbNv+29vj+4xUNg5GisdzaeqGblf3Y3svOKr0c7Q0d6mQhCDGiE06m8nNAMLM8mzTd7JvD+V8x12+u23ck=",
    "fusedPlasma": 0,
    "difficulty": 40272000,
    "nonce": "fa9b5138d8e88e70",
    "basePlasma": 26848,
    "usedPlasma": 26848,
    "changesHash": "0000000000000000000000000000000000000000000000000000000000000000",
    "publicKey": "cbWW+XpNeiE0hPc0bvxZ1g+OKppc39HwuZJqDoJibTs=",
    "signature": "4c0a5pyupss4kGh4MrYw6GXZLz\/ObtJxZJJY\/tLHGG15pAwrjoOzQjfA7EGo7V303CvyQuMLJKvURiDh6rRiBw==",
    "token": null,
    "confirmationDetail": {
        "numConfirmations": 4071,
        "momentumHeight": 9293981,
        "momentumHash": "fd4c5814e8c9300b570cbe1f6f71f72001a7a463cf6146b78b8783fca643285b",
        "momentumTimestamp": 1736261900
    },
    "pairedAccountBlock": null
}
1 Like