qianbin on vip-193-scratch
poa: collect beta from block he… Revert "chain: save beta from b… Merge pull request #442 from li… (compare)
qianbin on vip-193-scratch
block: store alpha in header apply new block signer's signat… consensus: tests and 2 more (compare)
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
is calculate the intrinsicGas enough?
nope, you need add vm gas also
Hi again! We have couple of failed transactions in mainnet:
https://insight.vecha.in/#/main/txs/0x19edb3fedd6e3f5f91c3e9e8e858c51ef0640663af649cdaa1dc1bae737069fb
https://insight.vecha.in/#/main/txs/0xafa6134cd6684899f12b678747c72292c6edd238a47efe5e2120e00b948e86bb
Is there any way to find out the reason of fail?
Thanks in advance!
0xabce2eb3c43b85aeb000/811328063099000000000000 wei
but the address only hold 0xabce2eb3c43b859df000/811328063098999998902272 wei