Onion V3 address consistency (#309)

* initial addition of ov3

* move libwallet address functions into OnionV3Address type

* incorporate OnionV3 type where possible

* factor out manual dalek pubkey manipulations

* corrections due to test failures

* change json-rpc example to use ov3 for payment proof recipient address
This commit is contained in:
Yeastplume
2020-01-24 13:02:09 +00:00
committed by GitHub
parent 3091bd9701
commit a2560179ae
23 changed files with 395 additions and 262 deletions
+2 -1
View File
@@ -26,6 +26,7 @@ use crate::util::{from_hex, static_secp_instance, to_base64, Mutex};
use failure::ResultExt;
use futures::future::{err, ok};
use futures::{Future, Stream};
use grin_wallet_util::OnionV3Address;
use hyper::header::HeaderValue;
use hyper::{Body, Request, Response, StatusCode};
use serde::{Deserialize, Serialize};
@@ -98,7 +99,7 @@ where
let tor_dir = format!("{}/tor/listener", lc.get_top_level_directory()?);
let sec_key = address::address_from_derivation_path(&k, &parent_key_id, 0)
.map_err(|e| ErrorKind::TorConfig(format!("{:?}", e).into()))?;
let onion_address = tor_config::onion_address_from_seckey(&sec_key)
let onion_address = OnionV3Address::from_private(&sec_key.0)
.map_err(|e| ErrorKind::TorConfig(format!("{:?}", e).into()))?;
warn!(
"Starting TOR Hidden Service for API listener at address {}, binding to {}",