diff --git a/conversations/src/api.rs b/conversations/src/api.rs index d8eb367..f8c8346 100644 --- a/conversations/src/api.rs +++ b/conversations/src/api.rs @@ -49,8 +49,8 @@ pub struct ContextHandle(pub(crate) Context); /// # Returns /// Opaque handle to the store. Must be freed with destroy_context() #[ffi_export] -pub fn create_context() -> repr_c::Box { - Box::new(ContextHandle(Context::new())).into() +pub fn create_context(name: String) -> repr_c::Box { + Box::new(ContextHandle(Context::new_with_name(name))).into() } /// Destroys a conversation store and frees its memory diff --git a/conversations/src/context.rs b/conversations/src/context.rs index 4ca0bc0..0305b32 100644 --- a/conversations/src/context.rs +++ b/conversations/src/context.rs @@ -21,16 +21,6 @@ pub struct Context { } impl Context { - pub fn new() -> Self { - let identity = Rc::new(Identity::default()); - let inbox = Inbox::new(Rc::clone(&identity)); // - Self { - _identity: identity, - store: ConversationStore::new(), - inbox, - } - } - pub fn new_with_name(name: impl Into) -> Self { let identity = Rc::new(Identity::new(name)); let inbox = Inbox::new(Rc::clone(&identity)); // @@ -170,8 +160,8 @@ mod tests { #[test] fn ctx_integration() { - let mut saro = Context::new(); - let mut raya = Context::new(); + let mut saro = Context::new_with_name("saro"); + let mut raya = Context::new_with_name("raya"); // Raya creates intro bundle and sends to Saro let bundle = raya.create_intro_bundle().unwrap(); diff --git a/conversations/src/identity.rs b/conversations/src/identity.rs index 0623a89..76c2700 100644 --- a/conversations/src/identity.rs +++ b/conversations/src/identity.rs @@ -36,7 +36,7 @@ impl Identity { // Names are a friendly developer chosen identifier for an Identity which // can provide between logging. pub fn get_name(&self) -> &str { - return &self.name; + &self.name } } diff --git a/conversations/src/inbox/handler.rs b/conversations/src/inbox/handler.rs index f953cca..278ae16 100644 --- a/conversations/src/inbox/handler.rs +++ b/conversations/src/inbox/handler.rs @@ -238,10 +238,10 @@ mod tests { #[test] fn test_invite_privatev1_roundtrip() { - let saro_ident = Identity::new(); + let saro_ident = Identity::new("saro"); let saro_inbox = Inbox::new(saro_ident.into()); - let raya_ident = Identity::new(); + let raya_ident = Identity::new("raya"); let mut raya_inbox = Inbox::new(raya_ident.into()); let bundle = raya_inbox.create_intro_bundle(); diff --git a/conversations/src/lib.rs b/conversations/src/lib.rs index 8ae1d51..810afb9 100644 --- a/conversations/src/lib.rs +++ b/conversations/src/lib.rs @@ -21,8 +21,8 @@ mod tests { #[test] fn test_message_roundtrip() { - let mut saro = create_context(); - let mut raya = create_context(); + let mut saro = create_context("saro".into()); + let mut raya = create_context("raya".into()); // Raya Creates Bundle and Sends to Saro let intro_result = create_intro_bundle(&mut raya); diff --git a/nim-bindings/.gitignore b/nim-bindings/.gitignore new file mode 100644 index 0000000..f3685e2 --- /dev/null +++ b/nim-bindings/.gitignore @@ -0,0 +1,3 @@ +nimble.develop +nimble.paths +nimbledeps diff --git a/nim-bindings/config.nims b/nim-bindings/config.nims new file mode 100644 index 0000000..8ee48d2 --- /dev/null +++ b/nim-bindings/config.nims @@ -0,0 +1,4 @@ +# begin Nimble config (version 2) +when withDir(thisDir(), system.fileExists("nimble.paths")): + include "nimble.paths" +# end Nimble config diff --git a/nim-bindings/examples/pingpong.nim b/nim-bindings/examples/pingpong.nim index 339e5e6..3c7dfdc 100644 --- a/nim-bindings/examples/pingpong.nim +++ b/nim-bindings/examples/pingpong.nim @@ -15,8 +15,8 @@ proc encode*(s: string): seq[byte] = proc pingpong() = - var raya = newConversationsContext() - var saro = newConversationsContext() + var raya = newConversationsContext("raya") + var saro = newConversationsContext("saro") # Perform out of band Introduction diff --git a/nim-bindings/specs b/nim-bindings/specs new file mode 100644 index 0000000..351697a --- /dev/null +++ b/nim-bindings/specs @@ -0,0 +1,1970 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GitHub - logos-messaging/specs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ Skip to content + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + / + + specs + + + Public +
+ + +
+ +
+ + +
+
+ +
+
+ + +

License

+ + + + +
+ +
+ Notifications + You must be signed in to change notification settings + +
+ + + + +
+
+ +
+ + + + +
+ + + + + +
+ + + + + + +

logos-messaging/specs

+
+
+ +
+
+ + + + + +

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

430 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waku Specifications

+

Waku builds a family of privacy-preserving, censorship-resistant communication protocols for web3 applications. +This repository contains specifications for the Waku suite of protocols.

+

List of Specifications:

+
    +
  • Standards +
      +
    • Core: Standards and protocols for the core Waku p2p communications offering.
    • +
    • Application: Standards and protocols that describe various applications or encryption use cases built on top of a Waku network.
    • +
    +
  • +
  • Informational: Waku design issues, general guidelines or background information that does not constitute a new feature.
  • +
+

Core standards

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Waku SpecificationsDescription
10/WAKU2Waku Overview
11/WAKU2-RELAYWaku Relay
12/WAKU2-FILTERWaku Filter
13/WAKU2-STOREWaku Store
14/WAKU2-MESSAGEWaku Message
17/WAKU2-RLN-RELAYWaku RLN Relay
19/WAKU2-LIGHTPUSHWaku Lightpush
33/WAKU2-DISCV5Waku Discovery v5 Ambient Peer Discovery
34/WAKU2-PEER-EXCHANGEWaku Peer Exchange
36/WAKU2-BINDINGS-APIWaku C Bindings API
64/WAKU2-NETWORKWaku Network
66/WAKU2-METADATAWaku Metadata
WAKU2-ENRWaku Usage of ENR
WAKU2-INCENTIVIZATIONWaku Incentivization
WAKU2-RLN-CONTRACTWaku RLN Contract Specification
RELAY-SHARDINGWaku Relay Sharding
WAKU2-SYNCWaku Sync
WAKU-MIXWaku Mix
WAKU-RENDEZVOUSWaku Rendezvous
+

Application standards

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Waku SpecificationsDescription
20/TOY-ETH-PMToy Ethereum Private Message
21/WAKU2-FAULT-TOLERANT-STOREWaku Fault-Tolerant Store
22/TOY-CHATWaku Toy Chat
26/WAKU2-PAYLOADWaku Message Payload Encryption
53/WAKU2-X3DHX3DH Usage for Waku Payload Encryption
54/WAKU2-X3DH-SESSIONSSession Management for Waku X3DH
DANDELIONWaku Dandelion
WAKU2-DEVICE-PAIRINGDevice Pairing and Secure Transfers with Noise
WAKU2-NOISENoise Protocols for Waku Payload Encryption
TOR-PUSHWaku Tor Push
RLN-KEYSTOREWaku RLN Keystore JSON schema
P2P-RELIABILITYWaku P2P Reliability
WAKU-APIWaku API
+

Informational

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Waku SpecificationsDescription
23/WAKU2-TOPICSWaku Topic Usage Recommendations
27/WAKU2-PEERSWaku Peer Management Recommendations
29/WAKU2-CONFIGWaku Parameter Configuration Recommendations
30/ADAPTIVE-NODESAdaptive Nodes
ADVERSARIAL-MODELSWaku Adversarial Models and Attack-based Threat List
RELAY-STATIC-SHARD-ALLOCWaku Relay Static Shard Allocation
+

Resources

+

Relevant Waku resources related to the specifications located in this repository:

+ +

Contributions

+

Contributions are welcome from any party. +Contributors can create specifications relating to the Waku domain and +create a pull request to begin discussion.

+

Please adhere to the following contribution guidelines:

+
    +
  • use the recommended template for new proposed specifications
  • +
  • use keywords as per the language recommendations in the template and Vac COSS
  • +
  • use semantic breaks
  • +
  • links to Waku, Vac or other IFT-related specifications must be to the corresponding Github repository and not to a webpage. +For example, Waku specs reside in waku-org/specs and Vac RFCs in vacp2p/rfc-index.
  • +
  • we no longer use "v2" in the name of new specifications (and existing spec names inconsistent with this rule will eventually be revised). For example, do not call your specification "Waku v2 New Protocol" but simply "Waku New Protocol"
  • +
  • the title of new specifications must be prefixed with WAKU2- to differentiate it from other projects' specs and previous RFC generations. For example, "Waku New Protocol" could be titled WAKU2-NEW-PROTOCOL.
  • +
+

New specifications are considered a proof of concept. +Once a rough consensus is reached towards stabilization, +the specification may be considered to receive the draft status and +further discussion will continue on the Vac RFC-Index repository.

+

NOTE: Specifications located in this repository should be considered not production ready. +Discussion should be conducted with the intention of maturing each specification.

+

Head over to the Vac RFC-Index repository where other Waku specifications live.

+
+
+ + + +
+
+ +
+
+
+
+

About

+ +
+ No description, website, or topics provided. +
+ + +

Resources

+ + + +

License

+ + + + + + + + + + + + + + + + +

Stars

+ + +

Watchers

+ + +

Forks

+ + + + +
+ +
+
+ + +
+
+

+ Releases

+ +
No releases published
+ +
+
+ + + +
+
+ +

+ Packages +

+ + +
+ No packages published
+
+ + + +
+
+ + + + + +
+
+

+ Contributors + 18

+ + + + +
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
+ + +
+ + +
+
+ + + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+

Footer

+ + + + +
+
+ + + + + © 2026 GitHub, Inc. + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + + diff --git a/nim-bindings/src/bindings.nim b/nim-bindings/src/bindings.nim index a03d5d2..3c30bc8 100644 --- a/nim-bindings/src/bindings.nim +++ b/nim-bindings/src/bindings.nim @@ -97,7 +97,7 @@ type ## Creates a new libchat Context ## Returns: Opaque handle to the context. Must be freed with destroy_context() -proc create_context*(): ContextHandle {.importc, dynlib: CONVERSATIONS_LIB.} +proc create_context*(name: ReprCString): ContextHandle {.importc, dynlib: CONVERSATIONS_LIB.} ## Destroys a context and frees its memory ## - handle must be a valid pointer from create_context() diff --git a/nim-bindings/src/libchat.nim b/nim-bindings/src/libchat.nim index c9a5b1b..806e72f 100644 --- a/nim-bindings/src/libchat.nim +++ b/nim-bindings/src/libchat.nim @@ -13,9 +13,9 @@ type data*: seq[uint8] ## Create a new conversations context -proc newConversationsContext*(): LibChat = +proc newConversationsContext*(name: string): LibChat = - result.handle = create_context() + result.handle = create_context(name.toReprCString) result.buffer_size = 256 if result.handle.isNil: raise newException(IOError, "Failed to create context")