Replies: 49 comments 33 replies
-
Yes, it can, and it will, given that I have the resource to do it. It has always been my intention to create a version in C. When I have added the last few features to the Python reference implementation, and I lock in the API, I will start work on the C implementation. |
Beta Was this translation helpful? Give feedback.
-
Also, I would very much appreciate help on this endeavour, so if you want to join in, you are very welcome. I do however think it’s necessary to wait until the Python implementation is done, the API has been locked in, and the documentation has been completed. |
Beta Was this translation helpful? Give feedback.
-
Okay ping me once you're ready to create the C version. I've listed some interesting ideas on the Meshtastic forum. |
Beta Was this translation helpful? Give feedback.
-
Are you still maintaining it? |
Beta Was this translation helpful? Give feedback.
-
hard to tell , no updating since last August. Let's find out is there anything we can do? |
Beta Was this translation helpful? Give feedback.
-
Well first of all check if the current version is reliable enough to be used, then start porting it to C using a proper HAL in order to support as many embedded platforms as possible. |
Beta Was this translation helpful? Give feedback.
-
sounds like a plan |
Beta Was this translation helpful? Give feedback.
-
I am still very much maintaining Reticulum. Life has not been too generous with time lately though, and I've had to focus on things more related to survival than passions. Although I had a goal of having Reticulum in an API-stable beta release by the first day of 2021, it did not pan out that way, and I was severely delayed. Things have calmed down for me now though, and for the next few months, I should be able to complete that work. I'd really strongly suggest against starting a C-port right now. There's still a few crucial details that need locking in, and doing this without the API documentation I'm currently writing would be a frustrating experience. I would very much appreciate the help once it is time, but please have just a little more patience :) I know it's been a long wait, but it will be worth it very soon. |
Beta Was this translation helpful? Give feedback.
-
And in the meantime I am open for any discussion on the matter in this thread. I will be available to answer questions and discuss it here. |
Beta Was this translation helpful? Give feedback.
-
How nice, happy to know you were back. It's ok, we will wait for your docs and lock in the few crucial details |
Beta Was this translation helpful? Give feedback.
-
Hello everyone who is still listening here. Today, I released Reticulum 0.2.0. This is the first release marked as being in beta state. This also means the API documentation and manual has been published at: https://markqvist.github.io/Reticulum/manual/. In a sense, one could at this point start writing a C port. In the service of being as transparent as possible, I will have to say that I am planning a very big change to the internals of Reticulum though, which will greatly impact any implementations. I am 95% sure that I will change Reticulum to completely use Elliptic Curve Cryptography on Curve25519 for all assymetric cryptography operations. This will mean RSA is no longer needed, which has been a very limiting factor in the project so far. By using Ed25519 signatures and X25519 ECDH key derivation instead of RSA, protocol overhead will be greatly reduced, and security will be staggeringly enhanced. It really seems like a win-win, but when I worked on the theory behind Reticulum 5 years ago, I didn't know enough about elliptic curves to utilize them confidently, and as such chose to go with RSA-1024 instead. I'm currently researching the last 5% of doubt I have about this decision, and one of the topics I'm looking into is the feasibility of running X25519/Ed25519 on low-power MCUs and what C implementations exist. I am very interested to hear anyones thoughts on this. |
Beta Was this translation helpful? Give feedback.
-
Hey, first of all nice to have you back and to see Reticulum is under development. Going to the actual task of porting it to C, we need to define some common guidelines beforehand, such as using size-constrained integers ( |
Beta Was this translation helpful? Give feedback.
-
The m parameter is not appended into the message, because it is already there in the header field ;) Byte two of the header field is the "hops" byte, which tells how many hops a packet has taken, which is also true for announces. I updated the "wire format" section in the manual to make it more clear. Ok, I just finished moving everything to elliptic curves. Was actually a lot less work than I had anticipated. And as you say, it seems there is good support on microcontrollers and in C, so this is going to be the way forward. Protocol overhead has also been greatly reduced now. It's all very, very nice. What you're saying regarding locking in the typing definitely makes sense, as does having a way to control dynamic vector allocation. I'm going to take a break for a couple of days now, cause I'm literally exhausted ;) When I start again, I will start mapping out the outline of the C version. I'm quite hesitant to use a RTOS, since I've been down that road before a long time ago, and in the end it ended up being much more hassle than help. My current stance is that making the C port as dependency free as possible is the way to go. We'll need crypto libraries, yes, but that should be more or less it. Task scheduling and async io should be possible with an internal job handler, since the internal "transport machine" of Reticulum is actually pretty simple. You're welcome to convince me otherwise though :) |
Beta Was this translation helpful? Give feedback.
-
Happy to hear that. I am here still listening |
Beta Was this translation helpful? Give feedback.
-
Ok moving forward, I've created a pull request to act as WIP for us all. Other general things we need to think about before starting are:
Small OT: have you seen the Helium project (www.helium.com)? |
Beta Was this translation helpful? Give feedback.
-
Rweather now has HKDF rweather/arduinolibs@4429613 |
Beta Was this translation helpful? Give feedback.
-
That is great news, it's going to speed up things a bit :) |
Beta Was this translation helpful? Give feedback.
-
I am also interested in helping here. My primary use for a C port would be to make it easier to use RNS in C programs targeting Linux on x86 and ARM/RISCV. Unfortunately I don't have much experience with embedded systems, but would like to help make that possible as well. Unfortunately, there doesnt seem to be an existing Fernet C implementation so I think I will start by trying to implement that. ^https://github.com/4c3e/fernet-c/tree/main Would love input on choosing the crypto and utility libraries 👍 Currently I'm looking at libsodium and tiny-aes for crypto edit: I'm probably going to spend time working on a python i2p interface implementation before diving in to a complete library rewrite in C 😄 |
Beta Was this translation helpful? Give feedback.
-
I'm an electronics engineer, not a software engineer, but I'm watching this very closely. RNS and associated software and hardware make up a brilliant system that I'm very excited about. I was hopeful that a C port would allow RNS to run on a microcontroller system like Arduino in order to minimize power consumption for remote repeater systems. Solar powering an RNode indefinitely would be a lot easier than using a Raspberry Pi (I've been dreaming about updated RNode firmware that would allow it to be a self contained RNS repeater, but I'm not sure that there is enough memory/horsepower in the Atmega). Any thoughts about whether something like this is on the C port road map or if it's even feasible? Edit: |
Beta Was this translation helpful? Give feedback.
-
@4c3e and @OtisByron, thanks for joining here and offering your help and interest. The Reticulum C port is getting closer by the day. Currently, there is only one protocol-level addition that needs to be added to the Python implementation, before I am willing to commit to work on the C version (namely an ordered data mode for links). When that is done, and after a round of testing, I think it will be feasible to start the work. @4c3e, if you manage to do a portable C implementation of Fernet, that would help the effort along tremendously. Many of the other components exist in various forms already, some don’t. Have a look at the other comments in this thread, if you didn’t already, there is some good resources regarding crypto libs. Either way, the help is welcome. @OtisByron, regarding the feasibility of Reticulum on very resource-limited hardware like RNode, it is my current position that it is feasible, yes. A device like an RNode will not be able to handle very deep networks with tens of thousands of nodes, due to RAM limitations, but for smaller setups, it should be sufficient as a standalone system. On larger systems with a bit more RAM and CPU, it should also be possible to handle larger networks, but then you also get the higher power consumption, so I really understand where you are coming from with that. One of the design goals of RNode was to use as little power as possible, exactly for purposes like this. I hope this gives a little more clarification about the current status and intents. If you have any questions, ideas or insights, I’d love to hear them. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Since this is not an issue per se, but now a pretty long and informative repository on the C-porting effort, I am moving this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hi. I recently came across this cryptoPP library. I believe it would be possible to implement Fernet easily by using this library. |
Beta Was this translation helpful? Give feedback.
-
Is there a sense of where this fits into the overall roadmap? I'm interested in building solar networks, doing that in a cost-effective way requires a version that can run on microcontrollers. |
Beta Was this translation helpful? Give feedback.
-
Ok, I will have something more concrete info on this in the pretty near future, but we are getting there soon, I promise. For now there is a much more coherent roadmap of the entire current state of Reticulum available here: https://github.com/markqvist/Reticulum/blob/master/Roadmap.md The very short version is that to do this properly, and to ensure the future viability of everything related to Reticulum, I need to secure funding for this work. The development of this entire ecosystem is currently more than a full-time job, and believe it or not, so far all development has been completely unsponsored, apart from the (very much appreciated donations) from people like you. These help a great deal in paying for expenses, but I really do need to eat and pay bills at some point too ;) I'm working on this, and will hopefully have more info to share in the near future. If anyone has ideas on that front in the meantime, I am also very interested in hearing them! |
Beta Was this translation helpful? Give feedback.
-
@markqvist this is really exciting! i'm curious if you've considered a memory safe language as an alternative to C/C++. Rust comes to mind because it has a small VM (and no garbage collector), but there are others such as Elixir or Go depending on what the requirements are. for security critical software, this seems like it would be of benefit. |
Beta Was this translation helpful? Give feedback.
-
That is really cool! C rocks! |
Beta Was this translation helpful? Give feedback.
-
Just recently found Reticulum. Very compelling project. Amazing that you've done all of this solo @markqvist. I'd love to be able to help push the µRNS effort along. Nice to see @ellenhp tackling the rust implementation. I assume the plan is to still have a C/C++ implementation as well, is that right? If so and you still don't have the bandwidth yourself I'd be willing to take a stab at it. Just want to be sure I wouldn't be stepping on any toes. |
Beta Was this translation helpful? Give feedback.
-
Yay, this is just wonderful, a C++ reticulum! I'll test soon in a Raspberry Pi 4 running Linux. |
Beta Was this translation helpful? Give feedback.
-
It's great to see the work that's been done on other implementations of Reticulum. Currently I'm working on an implementation of Reticulum in Zig. For those unfamiliar with Zig - here are some reasons why it's a great choice.
The more implementations the better in my opinion. |
Beta Was this translation helpful? Give feedback.
-
That is great news!! Right now as a user (hopefully will be able to start helping with code at some point), we support whatever decision to put Reticulum in place running native code! |
Beta Was this translation helpful? Give feedback.
-
A question more than an issue.
Can Reticulum be ported to C? It would benefit all those uC like the ESP32 or the NRF52840 that power many low power LoRa transceivers. Micropython is quite expensive CPU-wise and increases power consumption.
What are the main problems to be faced when porting it to C? I can do it myself but I'll need support throughout the process.
Beta Was this translation helpful? Give feedback.
All reactions