{"id":26651707,"url":"https://github.com/dialectlabs/dart-web3","last_synced_at":"2026-01-11T13:36:35.877Z","repository":{"id":38939706,"uuid":"506757528","full_name":"dialectlabs/dart-web3","owner":"dialectlabs","description":"A simple dart protocol wrapper built with cryptoplease","archived":false,"fork":false,"pushed_at":"2022-06-28T19:38:19.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T03:05:09.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dialectlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-23T18:55:38.000Z","updated_at":"2024-07-07T09:41:10.000Z","dependencies_parsed_at":"2022-09-18T19:12:58.167Z","dependency_job_id":null,"html_url":"https://github.com/dialectlabs/dart-web3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dialectlabs/dart-web3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialectlabs%2Fdart-web3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialectlabs%2Fdart-web3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialectlabs%2Fdart-web3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialectlabs%2Fdart-web3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dialectlabs","download_url":"https://codeload.github.com/dialectlabs/dart-web3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dialectlabs%2Fdart-web3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267600092,"owners_count":24113712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-25T03:05:12.032Z","updated_at":"2026-01-11T13:36:35.843Z","avatar_url":"https://github.com/dialectlabs.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Twitter Follow](https://img.shields.io/twitter/follow/saydialect?style=social)](https://twitter.com/saydialect)\n[![Discord](https://img.shields.io/discord/944285706963017758?label=Discord)](https://discord.gg/cxtZVyrJ)\n\n# Protocol \u0026 web3\n\n## Summary\n\nDialect is a smart messaging protocol for dapp notifications and wallet-to-wallet messaging on the Solana Blockchain.\n\nDialect `v0` currently supports one-to-one messaging between wallets, which powers both dapp notifications as well as user-to-user chat. Future versions of Dialect will also support one-to-many and many-to-many messaging.\n\nThis repository contains a dart client for Dialect's Solana program, published as `dialect_web3`. This repository does not contain the Dialect rust programs (protocol). For more information on Dialect's protocol, including instructions for local development, visit our [protocol GitHub](https://github.com/dialectlabs/protocol).\n\n## Table of Contents\n\n1. Usage\n2. Local Development\n3. Examples\n4. Message Encryption\n\n## Usage\n\nThis section describes how to use Dialect protocol in your app by showing you an example in the`example/` directory of this repository. Follow along in this section, \u0026 refer to the code in those examples.\n\n### Create your first dialect, send and receive message\n\nThe example in `example/dialect_web3_example.dart` demonstrates how to create a new dialect, send and receive message.\n\n```dart\nimport 'package:dialect_protocol/dialect_protocol.dart';\nimport 'package:dialect_protocol/src/api/index_test.dart';\nimport 'package:solana/solana.dart';\n\nfinal program = // ... initialize dialect program\nfinal Ed25519HDKeyPair user1 = await Ed25519HDKeyPair.random();\nfinal Ed25519HDKeyPair user2 = await Ed25519HDKeyPair.random();\n// fund users\n\nfinal List\u003cMember\u003e dialectMembers = [\n    Member(publicKey: user1.publicKey, scopes: [true, true]),\n    Member(publicKey: user2.publicKey, scopes: [false, true])\n];\n\nfinal user1Dialect = await createDialect(\n    client: client,\n    program: program,\n    owner: KeypairWallet.fromKeypair(user1),\n    members: dialectMembers,\n    encrypted: false); // create dialect on behalf of first user\n\nawait sendMessage(client, program, user1Dialect,\n    KeypairWallet.fromKeypair(user1), \"Hello dialect!\"); // send message\n\nfinal dialect = await getDialectForMembers(\n    client, program, dialectMembers.map((e) =\u003e e.publicKey).toList()); // get dialect\nprint(dialect.dialect.messages.map((e) =\u003e e.text));\n// Will print (Hello dialect!)\n```\n\nRun the example above\n\n```shell\ndart example/dialect_web3_example.dart\n```\n\n## Local Development\n\nUsing this Dialect client with Solana's deployed mainnet and devnet works out-of-the-box as expected. If you'd like to use this client to develop with a local running instance of the Dialect program, follow the [Local Development](https://github.com/dialectlabs/protocol#local-development) section of our [protocol GitHub](https://github.com/dialectlabs/protocol).\n\n## Message Encryption\n\nA note about the encryption nonce.\n\nhttps://pynacl.readthedocs.io/en/v0.2.1/secret/\n\n### Nonce\n\nThe 24 bytes nonce (Number used once) given to encrypt() and decrypt() must **_NEVER_** be reused for a particular key.\nReusing the nonce means an attacker will have enough information to recover your secret key and encrypt or decrypt arbitrary messages.\nA nonce is not considered secret and may be freely transmitted or stored in plaintext alongside the ciphertext.\n\nA nonce does not need to be random, nor does the method of generating them need to be secret.\nA nonce could simply be a counter incremented with each message encrypted.\n\nBoth the sender and the receiver should record every nonce both that they’ve used and they’ve received from the other.\nThey should reject any message which reuses a nonce and they should make absolutely sure never to reuse a nonce.\nIt is not enough to simply use a random value and hope that it’s not being reused (simply generating random values would open up the system to a Birthday Attack).\n\nOne good method of generating nonces is for each person to pick a unique prefix, for example b\"p1\" and b\"p2\". When each person generates a nonce they prefix it, so instead of nacl.utils.random(24) you’d do b\"p1\" + nacl.utils.random(22). This prefix serves as a guarantee that no two messages from different people will inadvertently overlap nonces while in transit. They should still record every nonce they’ve personally used and every nonce they’ve received to prevent reuse or replays.\n\n## Features, bugs, and further help\n\nFor feature requests, bug reports, or additional assistance using this client, feel free to reach out in our [Dialect Discord server](https://discord.gg/cxtZVyrJ). We will continue to update documentation as often as possible.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialectlabs%2Fdart-web3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdialectlabs%2Fdart-web3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdialectlabs%2Fdart-web3/lists"}