Adding support for Autonomi Community Token to Friends

Hello. I think next logical step for ACT is add support to Friends. As we’ve seen recently, transacting with barebones ACT Wallet is a little tedious and an out-of-band channel is required to exchange keys, spend addresses etc. This seems like a perfect task for Friends.

I think if we could integrate a wallet into Friends, and separate a special type of message (or maybe just parse for specific syntax, some kind of tags?), user experience would become nicer, no need for copy-pasting long hexadecimal strings of data. Just 1) select a contact and a token to request, 2) accept a request and enter amount of money to send, 3) click “receive”, DONE!

In the process, I would add ACT support to dweb, because it’s needed by Friends, so all dweb-powered apps would also get this.

@happybeing, @riddim, what do you say?

13 Likes

Sounds cool but might confuse if people assume this is an Autonomi wallet. I think we can avoid that though.

To reiterate your point, a big benefit for users and developers, of building on dweb is that:

  • users will only need to set up a wallet with one app (the Autonomi dweb App *), and only need to trust that one app with their private key. Developers won’t need to worry about wallets at all, because if you build an app on dweb, you get dweb wallet handling for free.

So I would like to see wallet handling in the Autonomi dweb App (it currently just shows your balance - thanks to @riddim), but it would be better IMO to start with the Autonomi wallet and then offer ACT as an optional extra wallet so people always have the Autonomi wallet as the default option. This should avoid the confusion I mentioned at the start.

* The Autonomi dweb App is ready for release and would be the perfect place for users to manage a wallet which would then be used by all their dweb apps. It does not have a UI for this yet, though the functionality could be copied from Colony fairly easily. The dweb API will not need to be extended to support this because the wallet would be passed directly to the instance of DwebServer, and private keys will only ever be known to the dweb app (which includes the server).

I don’t have much time at the moment so can’t offer much more than reviewing of PRs. Today I’m fighting CI to build the dweb App so I can release it.

In summary, This is a great idea! I’d very much like to support an ACT wallet as an option integrated in the not yet released Autonomy dweb App, but think it should be in addition to a default Autonomi wallet, and be hidden by default.

Adding support for an Autonomi wallet should be straightforward. Supporting ACT will need something added to the REST API to enable a dweb app to enquire about available wallets and select something other than the default. That sounds pretty easy. I’m not sure what dweb would then do differently though!

I don’t have time to code this but will welcome PRs. If anyone is interested in taking this on, please open an issue on Codeberg with a copy the above (and a link), or describe your own proposal if different.

6 Likes

I think a plugin for friends would fit nicely here :slight_smile:
and with such a nice use case that requires 1. Additional buttons to easily send your token, 2. Send messages ‘for the user’, 3. maybe status info within the message “pending” /“validating”, 4. Additional timeline view with current balances… Maybe additional status info in the friends bar about balances… The first plugin interface could be defined nicely

For dweb support we would need graphEntry support (they’re used by the history datatype but don’t have routes in the rest api so far) and since you may not want to program everything back-propagation/-validation relevant in JavaScript some additional ACT specific comfort rest routes might make sense.

(sorry a bit busy right now but so cool that you reach out and would be cool to see these applications merging together a bit :tada: )

9 Likes

I was actually thinking about integrating a wallet frontend into Friends, not Dweb. In Dweb I would only need endpoints for basic ACT operations like balance/request/pay/receive for Friends to integrate with. But maybe private key handling could indeed be done on Dweb level. Main private key could also be used to handle ACT operations I think.

All the Rust parts I could probably do myself, no problem.

I was actually thinking about all the ACT functionality being on the Rust side, so only have REST routes for high-level operations, not to duplicate ACT code in JavaScript.

There is also another possible solution – to extend ACT Wallet to interact with Friends, but that would need to be done in Rust. Probably a rust crate for Friends should be created (similar to what Colony has), and I don’t know if WebRTC is possible/sensible outside of a browser at all.

1 Like

This is encouraging. While you are considering how this might best be done there’s something you should take a look at.

I have an app version of dweb ready for release. This uses the new dweb-server library to integrate the REST endpoint into the app so it’s like dweb serve with a GUI. No more command line :partying_face:

Adding the wallet here will be a bit like adding it to Friends, giving users a nice GUI and a server that is always running (by me adding auto start functionality). It will also ensure that private keys are only known to this app. And it will work with Friends, Atlas and any other dweb apps.

So it’s a great place to integrate a wallet. You have direct Rust access for short term (eg using an ACT lib) and can add routes to REST later if that makes sense for dweb apps, though they might not need much. I think this fits with your plan as described above.

For the moment the dweb-app GUI shows any wallet picked up from the system (feature added by @riddim :folded_hands:) but could include a way to create or select different wallets.

Take a look in the dweb repo. You can run it there with cargo tauri dev.

I want to add auto start before release, so maybe next week.

8 Likes

sounds realistic.

if you do that and we have dweb routes for the high level OPs then we could discuss together what would be a good way to go forward as first version for friends integration + I could help you with a first PoC draft of a friends plugin and you could work from there and make it nicer to use and enhance the user experience/appearence from there :slight_smile:

3 Likes