go-multiaddr icon indicating copy to clipboard operation
go-multiaddr copied to clipboard

Onion addresses need 12 bytes, not 10

Open sbuss opened this issue 9 years ago • 2 comments

In codec.go you append the onion address to the port, which results in 12 bytes, but according to your spec, onion addresses are only 10 bytes (80 bits)

This mismatch results in being unable to decode the onion addresses correctly, since you can't get the port number back.

Should the spec be updated to be 12 bytes, or is prepending a varint to the (addr, port) bytes better?

sbuss avatar Mar 06 '16 19:03 sbuss

Is this still an issue?

cc @david415 @cpacia

ghost avatar Jan 18 '17 03:01 ghost

it's true that we need to use 12 bytes... but i thought we fixed that a while ago. i guess we missed this bug. good catch!

david415 avatar Jan 18 '17 09:01 david415