Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative discovery and transport protocols #6

Open
vasco-santos opened this issue Jan 30, 2019 · 6 comments
Open

Alternative discovery and transport protocols #6

vasco-santos opened this issue Jan 30, 2019 · 6 comments

Comments

@vasco-santos
Copy link
Member

vasco-santos commented Jan 30, 2019

We have been discussing recently what new protocols for discovery and transport we should aim to support in the near future.

The purpose of this issue is to discuss what are the possible protocols, its advantages according to the ones we currently support, offline-first capabilities as well as their compatibility with devices / types of nodes that we have.

We have been discussing some protocols so far, like bluetooth, audio-frequency, among others, and we have several other ones that we never discussed, such as infrared.

cc @momack2 @mgoelzer @raulk @jacobheun @daviddias @Stebalien @jhiesey

@vasco-santos
Copy link
Member Author

One of the protocols that we have been talking recently is Bluetooth, for obvious reasons. It encompasses discovery and transport, it is widely spread in devices and requires low resources. One of the biggest points for it is the new WebBluetooth api libp2p/js-libp2p#261 which would enable web nodes

In this context, I made some initial experiments with WebBluetooth and here follow my initial report. Basically, I Created a simple React app for finding and getting data from my smartphone through Bluetooth. A mobile app (BLE scanner) was used as my smartphone does not have Bluetooth Low energy support.

Concerns

  • Bluetooth 4.0 or later
  • Needs to be a Bluetooth Low Energy device (installed an app in my smartphone for testing it, it is not supported for a large number of regular devices), more proper to IoT stuff
  • Needs a click on application level (API)
  • Only supports Passive scanning for now, you can't scan for all devices around you — for good privacy reasons — and you can't just connect to a single device
  • Draft spec
  • Can't find in the spec / doc / examples a way to exchange arbitrary data, only to access characteristics of the device, such as heart beat, battery, …

Other notes

  • https://github.com/noble/noble Node support for exchange arbitrary data (no browser!)
  • Web NFC API also exists
    • Report from w3c created 1 month ago though

Conclusion

  • We can try to go deeper and try to create a PoC for js-libp2p using web bluetooth. I still need to make sure if they really do not support the exchange of arbitrary data, but I think it will not be stable and available to a large set of platforms in a near future. However, it seems the best approach for browser nodes in spite of not being in a good shape yet

@lidel
Copy link
Member

lidel commented Aug 29, 2019

@vasco-santos I see latest WebBluetooth spec supports reading and writing to "Characteristic User Description":

If it was possible to expose such a writable characteristic value from a browser (which I don't think is possible atm?), then we would have means of passing arbitrary data between two browsers.

@Tolsi
Copy link

Tolsi commented Oct 15, 2019

You might be interested, there's an article about custom audio transport protocol. Source code

@bertrandfalguiere
Copy link

bertrandfalguiere commented Oct 15, 2019

I love the idea behind the audio transport! It may be nice to bootstrap a discovery by advertising an address for another, regular, protocol. I don't see many use cases apart from discovery, but I'm sure more creative people will.

Along the same line, we could even imagine a vibrating phone transmitting data to another's accelerometer. I don't know if it's feasible in practice and/or even useful...

@lidel
Copy link
Member

lidel commented Oct 15, 2019

A proof-of-concept for WebRTC signaling using sound: https://github.com/ggerganov/wave-share

@lidel
Copy link
Member

lidel commented Mar 22, 2020

Chrome 81 introduces the mobile web to NFC with an origin trial:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants