Coder Social home page Coder Social logo

Adopt TORv2 addresses about rust-lnpbp HOT 12 CLOSED

dr-orlovsky avatar dr-orlovsky commented on August 26, 2024
Adopt TORv2 addresses

from rust-lnpbp.

Comments (12)

Kixunil avatar Kixunil commented on August 26, 2024 2

Would it be possible to disregard the distinction between addresses and just defer to torut::OnionAddress/torut::TorPublicKey?

from rust-lnpbp.

dr-orlovsky avatar dr-orlovsky commented on August 26, 2024 1

Good news! Lets try to remove Copy on InetAddr and see how much problems we will get after

from rust-lnpbp.

rajarshimaitra avatar rajarshimaitra commented on August 26, 2024 1

Opened the PR. @Kixunil would appreciate your review. So far it can only parse onion v2 from an address string.

from rust-lnpbp.

dr-orlovsky avatar dr-orlovsky commented on August 26, 2024

Hard to say... We do distinguish IPv4 from IPv6 in the enum, so at least at that level it would be nice to distinguish TORv2 from TORv3.

Don't spend time on this issue, I left it for new contributors b/c it's very simple to implement as a first issue

from rust-lnpbp.

Kixunil avatar Kixunil commented on August 26, 2024

Sure, was just randomly looking around and noticed it because I had to look into torut to implement parse_arg properly. :)

from rust-lnpbp.

rajarshimaitra avatar rajarshimaitra commented on August 26, 2024

If this issue is still open, I am willing to work on it.

Small note after initial look, torut doesn't seem to support TorPubKeyV2 to OnionAddressV2 conversion. As we are only storing the publickeys in the structure do we plan to implement the conversion too? Or there are other ways of doing it?

from rust-lnpbp.

dr-orlovsky avatar dr-orlovsky commented on August 26, 2024

It is still open, you are welcome to pick it!

As for V2, I think we only need to support OnionAddressV2, w/o support for TorPubKeyV2

from rust-lnpbp.

rajarshimaitra avatar rajarshimaitra commented on August 26, 2024

Ok, I went some distance and so far it seems workable.

Need some technical help. OnionAddressV2 from torut doesn't implement Copy. This is causing error in #[derive(Copy)] for InetAddr which wraps over OnionAddressV2. I cant manually implement Copy as OnionAddressV2 is from an external crate.
One option is to disable Copy derivation on InetAddr but that will cause ripple effects upstream.

So what's the best way to fix this situation?

from rust-lnpbp.

Kixunil avatar Kixunil commented on August 26, 2024

@rajarshimaitra What about a PR against torut for the address to implement Copy?

from rust-lnpbp.

dr-orlovsky avatar dr-orlovsky commented on August 26, 2024

We can do that for sure, but I expect there are some limitations b/c of the key structure such that Copy is unreasonable?

from rust-lnpbp.

rajarshimaitra avatar rajarshimaitra commented on August 26, 2024

@rajarshimaitra What about a PR against torut for the address to implement Copy?

@Kixunil I thought of the same at first. But the OnionAddressV3 also doesn't implement copy. So there is probably something with it as @dr-orlovsky suggested.

Good news! Lets try to remove Copy on InetAddr and see how much problems we will get after

I gave a try at removing Copy derivations. The changes ripples through few more modules of the library, but nothing major. Not sure about the rgb node though. There might be more dependency on it.

from rust-lnpbp.

Kixunil avatar Kixunil commented on August 26, 2024

such that Copy is unreasonable?

I wonder why though, keys should be representable as a fixed-length array of bytes, which is always Copy...

from rust-lnpbp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.