qianbin on master
fix(disco): load key from keyhe… Merge pull request #307 from li… (compare)
uldaman on fix-#34
Issue #34 (compare)
@qianbin
chainTag is bound to network, the last byte of genesis block id. 0x4a for mainnet and 0x27 for testnet.
What would I set the chainTag if I am running my own network?
Fee delegation
, check https://medium.com/@ziheng.zhou/what-you-might-not-know-about-vechainthor-yet-part-iii-transaction-fee-delegation-vip-191-4ee71d690f1b
Hi again!
Can you please help me with understanding VIP-191 concept of signing delegated transactions?
I checked and tried this demo: https://github.com/zzGHzz/ThorDemo3 and it works pretty well, but it uses connex.vendor.sign('tx').request() method for singing and sending transactions.
What I need is to sign delegated transaction avoiding use of wallet. So I just want to send delegated transaction like that:
const tx = new Transaction(body);
const signingHash = cry.blake2b256(tx.encode());
tx.signature = cry.secp256k1.sign(signingHash, Buffer.from(sk.slice(2), 'hex'));
const encoded = tx.encode();
const raw = '0x' + encoded.toString('hex');
let ret = await net.http("POST", 'transactions', {
headers: { 'x-genesis-id': connex.thor.genesis.id },
query: {},
body: { raw }
});
So before sending it, I also have to sign it by gasPayer like that:
const tx = new Transaction(body);
const hash = cry.blake2b256(tx.encode());
const delegatorSigningHash = cry.blake2b256(hash, Buffer.from(origin.slice(2), 'hex'));
const sig = cry.secp256k1.sign(delegatorSigningHash, Buffer.from(skDelegator.slice(2), 'hex'));
As it said in VIP-191 docs, signature of delegated transaction consists of 2 parts:
Bytes | Attribute |Type | Optional
0-64 | senderSignature | byte[65] | no
65-129 | gasPayerSignature | byte[65] | yes
According that, how to concatenate both signatures properly to achieve raw transaction which is ready to send?
Thanks in advance.
KeyStore
(which is stored in imToken) to Sync or mobile wallet and remember only KeyStore
works