create account

RE: Posting Authority Revoked. by mahdiyari

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @fulltimegeek/rv8nfy

· @mahdiyari · (edited)
$0.64
See https://github.com/mahdiyari/hive-tx-js
I added an example there

Block explorers can easily display the public key used for signing the transaction. hivehub.dev might be interested in adding that feature. @asgarth

CC @edicted @brianoflondon
👍  , , ,
properties (23)
authormahdiyari
permlinkrv9oav
categoryhive-167922
json_metadata{"links":["https://github.com/mahdiyari/hive-tx-js"],"app":"hiveblog/0.1","users":["asgarth","edicted","brianoflondon"]}
created2023-05-26 13:04:09
last_update2023-05-26 13:11:03
depth3
children4
last_payout2023-06-02 13:04:09
cashout_time1969-12-31 23:59:59
total_payout_value0.320 HBD
curator_payout_value0.320 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length246
author_reputation166,511,987,105,254
root_title"Posting Authority Revoked. "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id123,853,712
net_rshares1,400,783,143,167
author_curate_reward""
vote details (4)
@asgarth ·
$0.29
I thought about this a few times in the past. Thanks for sharing the code, will try to include it in an upcoming release 👍
👍  , , ,
properties (23)
authorasgarth
permlinkre-mahdiyari-rv9qie
categoryhive-167922
json_metadata{"tags":["hive-167922"],"app":"peakd/2023.5.1"}
created2023-05-26 13:51:51
last_update2023-05-26 13:51:51
depth4
children1
last_payout2023-06-02 13:51:51
cashout_time1969-12-31 23:59:59
total_payout_value0.144 HBD
curator_payout_value0.143 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length122
author_reputation37,723,305,336,356
root_title"Posting Authority Revoked. "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id123,854,673
net_rshares627,868,616,044
author_curate_reward""
vote details (4)
@andablackwidow ·
I'd advise to implement it in such a way that `sig_digest` of a transaction is taken from server (since a node already has `pack`ed version of transaction - this way you don't need to deal with differences between legacy and hf26 version of binary serialization), but the extraction of public key from signature happens on client side, preferably on demand only (that part of the process carries almost all the cost, if you do it on the server you just invite DoS attack).
properties (22)
authorandablackwidow
permlinkre-asgarth-2023527t388463z
categoryhive-167922
json_metadata{"tags":["hive-167922"],"app":"ecency/3.0.31-surfer","format":"markdown+html"}
created2023-05-27 01:08:09
last_update2023-05-27 01:08:09
depth5
children0
last_payout2023-06-03 01:08:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length472
author_reputation66,021,123,572,392
root_title"Posting Authority Revoked. "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id123,873,275
net_rshares0
@fulltimegeek ·
Hive-tx is new to me. Was this possible before with other libraries like [hive-js](https://gitlab.syncad.com/hive/hive-js) / [dhive](https://gitlab.syncad.com/hive/dhive)?

I see that you manually reconstructed the transaction to get the digest. Can that step be automated?

<pre>
<code>
const signature = hiveTx.Signature.from('203dfa2f2620f94a033c424710bbf22c518e1d9aec4170b342789acdc714bf0b483ff1e2ec1fcd5607e5df767ba09751792484a7ac1cf31c94cf55b1e81df6be30')
const trx = new hiveTx.Transaction({
    ref_block_num: 30883,
    ref_block_prefix: 3663302639,
    expiration: '2023-05-26 07:49:44',
    operations: [[
        'vote',
        {
            voter: 'mahdiyari',
            author: 'afa.hb03',
            permlink: 'esp-engcoastal-sentry-splinterlands-art-contest-week-242-by-afahb03',
            weight: 2000
        }
    ]],
    extensions: []
})
const { digest } = trx.digest()
const publicKey = signature.getPublicKey(digest).toString()
// STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF
// To find which account has this public key
const account = await hiveTx.call('condenser_api.get_key_references', [["STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF"]])
// steemauto
</code>
</pre>
properties (22)
authorfulltimegeek
permlinkrv9re1
categoryhive-167922
json_metadata{"links":["https://gitlab.syncad.com/hive/hive-js"],"app":"hiveblog/0.1"}
created2023-05-26 14:10:48
last_update2023-05-26 14:10:48
depth4
children1
last_payout2023-06-02 14:10:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,217
author_reputation82,536,800,030,957
root_title"Posting Authority Revoked. "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id123,855,104
net_rshares0
@mahdiyari ·
$0.47
I don't think it is possible with hivejs but might be possible with dhive.
```js
const tx = await hiveTx.call("condenser_api.get_transaction", ["207c06a5448e18b501d15891aed6f3ecbeb96b83"])
const signature = hiveTx.Signature.from(tx.result.signatures[0])
const trx = new hiveTx.Transaction(tx.result)
const { digest } = trx.digest()
const publicKey = signature.getPublicKey(digest).toString()
const account = await hiveTx.call('condenser_api.get_key_references', [[publicKey]])
console.log(publicKey, account)
```
👍  , ,
properties (23)
authormahdiyari
permlinkrv9rxg
categoryhive-167922
json_metadata{"app":"hiveblog/0.1"}
created2023-05-26 14:22:30
last_update2023-05-26 14:22:30
depth5
children0
last_payout2023-06-02 14:22:30
cashout_time1969-12-31 23:59:59
total_payout_value0.236 HBD
curator_payout_value0.235 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length512
author_reputation166,511,987,105,254
root_title"Posting Authority Revoked. "
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id123,855,350
net_rshares1,029,941,968,166
author_curate_reward""
vote details (3)