ZenGo-X/gotham-city

send same transcation with one address,but sign result not some

freehere107 opened this issue · 11 comments

hello,
When i sign same transcation,but sign with server result not same.is once sign always create new private and public key?

let signature = api::sign( client_shim, BigInt::from_hex(&sig_hash.le_hex_string()), &mk, BigInt::from(0), BigInt::from(address_derivation.pos), &self.private_share.id, );

hey @freehere107 , I am not sure I follows but since each signature uses a fresh randomness - signatures on the same message will look different but will still be valid. As long as you get signature as output it means that the signature is valid (because as part of the signing we do a verification).

Does this answer your question ?

OK,signature is valid.i try to boradcast .but i don't know what address to send this transaction.

We run on bitcoin testnet (can be changed to mainnet). if you want to send you need to specify the address to send to

how to specify the address to send to, i change this
let address_derivation = self .addresses_derivation_map .get(&transaction.from) .unwrap();
but always the same result

why do you want to do that?
if you want to receive to the wallet, just generate new address and send to it (./target/release/cli wallet -a).
If you want to send Gotham will assemble the txid you need for the tx. Do you need to assemble it yourself ?

I want to use the send method, but I am prompted to have no balance, but I have generated a wallet and recharged it, but I still have no balance. My print transaction found the address signed by the server and found that the address is not the one I generated. address. This makes me confused

did you charged the wallet with funds from testnet?
try generate new address, and send funds to it from: https://testnet-faucet.mempool.co/
wait for confirmation and check the balance. let me know if balance is zero/error

May I ask a question:

What if I signed the same message twice using same client part key, and got two sign_tx and the corresponding ec_recover'd signing addresses. Is it true that the two signing address(ec_recovered) should be equal?

@hackfisher In general this is true. Even if you sign on separate messages .

@omershlo OK,i fix it.thank you