# ARC20恢复中转地址交易的一些参考 **Published by:** [Forever121](https://paragraph.com/@forever121/) **Published on:** 2024-01-20 **URL:** https://paragraph.com/@forever121/arc20 ## Content 大家在打ARC20的时候会发现初始化时有两个地址,一个是primary地址,一个是funding地址,funding地址负责挖,primary负责收,但当我们去查询交易记录时候会发现,一共交互了三个地址,这个多的地址是什么呢? 这个地址是P2TR地址,如果funding成功把交易发到P2TR地址,将由P2TR地址发起 Reveal Tx 将铭文打入primary地址中,由于此过程需要运算,期间存在一定不确定性,程序可能会中断、报错等打断程序继续发起Reveal Tx,此时P2TR地址通过常规方法已经无法控制了,我也遇到了这个问题,在联系了atomicals-js贡献者后,按照方法,成功恢复了Reveal Tx交易,并且primary地址收到了铭文,可以参考以下方法。保留日志将中断时的日志保留下来,关注以下参数:交易ID、nonce、timeDetected Funding UTXO (交易ID:*) with value 109887 for funding... go one finalCopyData:{"args":{"bitworkc":"000000","bitworkr";"6238","mint ticker":"sophon","nonce":763110,"time":1705508113}} 拉取代码使用atlaslabsapp开发的handle_no_reveal分支git clone https://github.com/atlaslabsapp/atomicals-js.git cd atomicals-js git checkout -b handle_no_reveal origin/handle_no_reveal yarn install yarn run build 配置 .env 文件配置以下三项,nonce在atomicals-js最新的版本中固定为0commitTxid=交易ID time=1705508113 nonce=763110 如果nonce和time丢失,可以让程序去寻找time 和 nonce 全部正确填写:立即完成(或者等待 reveal bitwork 完成) 只正确填写 time:几小时到几天 只正确填写 nonce:几秒钟到几分钟 time 和 nonce 全部不填写:几乎不可能成功。推荐在 commit 交易的日志或者 https://www.blockchain.com/explorer/ 上查找'time'的值 配置钱包./wallets/wallet.json 发起交易以sophon为例yarn cli mint-dft sophon --satsbyte 38 [root@a.com atomicals-js]# yarn cli mint-dft sophon --satsbyte 38 yarn run v1.22.21 $ node dist/cli.js mint-dft sophon --satsbyte 38 walletPath ./wallets/wallet.json Args { mint_ticker: 'sophon' } Meta undefined Ctx undefined This version is only for using when a commit tx is broadcast but no reveal tx is broadcast When set refund=true in .env, it try to refund from commit tx Otherwise it try to construct the reveal tx DO NOT USE IT FOR ANY OTHER PURPOSE! Please fill required configs in .env THE AUTHOR IS NOT RESPONSIBLE FOR ANY LOSSES! USE AT YOUR OWN RISK! Wait 5 seconds to read the above statements commitTxid=00000012c1f7v640d94901c93444a55e52701210840875a1zx7e0dcad70270bb6, newSatsbyte=NaN, time=NaN, nonce=0 Found 109887 sats sent to address bc1pzr129hu0eg7xnwk2f0639l8dvf9pwzca1zx7e0d62keg0t4776f726bsa1zx7e0dazlk, try to construct the reveal tx 'time' not config in '.env', start with time of commit tx: 1705508113 Concurrency set to: 1 Initializing worker: 0 Waiting for workers to complete... Nonces: 0 , time: 1705509273 Target address matched! got one finalCopyData:{"args":{"bitworkc":"000000","bitworkr":"6238","mint_ticker":"sophon","nonce":0,"time":1705509273}} Solution found, try composing the transaction... Workers have completed their tasks. Atomicals Bitwork Mining - Requested bitwork proof-of-work mining for the reveal transaction. bitworkr (input): 6238 bitworkr (decoded): 6238 --------- WARNING: This might take a very long time depending on the speed of the CPU. Time to mine estimates: - prefix length <= 4: about a minute or two. ~65,536 hashes on average. - prefix length 5: several minutes. ~1,048,576 hashes on average. - prefix length 6: up to an hour or more. ~16,777,216 hashes on average. - prefix length >= 7: a few hours or much longer. >268,435,456 hashes on average. Starting mining now... 953a87BD1E5F8b096bec1b43bA55500b7A66e0e6a27b1500b7A66e0e6a27b15a nonces: 1769 Bitwork matches reveal txid! 953a87BD1E5F8b096bec1b43bA55500b7A66e0e6a27b1500b7A66e0e6a27b15a @ time: 1705509279 Broadcasting tx... 953a87BD1E5F8b096bec1b43bA55500b7A66e0e6a27b1500b7A66e0e6a27b15a No auto broadcast since broadcast=true is not set in .env Rawtx hex: 080010000004011764n9jzqn233vkevdaczzoef669drc3qqfstmqt366ons8ven6dym92yrywzlhg6hs6pbiraxyrobgkxxxp62dpnqen71qdybygkffmh2l7p4pqyhqmkjy4z2rgs45lnv7jdiq425vktjde14dr3isy78k9u9crxco4ycnq7vuykujl7hi33c8kidq6rregkxk8wrkfbp67ohnyug6gzc7fstdajih4yx31gxnhv7uyyxqqj5y6vx4hra8no3pcy8vm7y123kvp2jgo59tg2xsdei9dk4eridvg9yqukuztk9z4plai5o3j7yvjafekztrrwxnc3gjw2qx144g6uwtuye7ox5xd5h54do8ktqs2fiwwwrjfe1p22ari7ltdqrdfciympqatk63zdirec3k7glxe45cbpgy78ab9vyyd2y4cv15ux5uqlyfmbwswqjngeshjihs5tzgyshlux8k1ont83nav7xq4wwodequjbybuvgcer3bdvi4kqueeucgpw4zzcmqmzglgnc5yrmpmafxhhhhb28v7m7wxzgc9lktzg71x7b9b58zob1ar2yn8ync8vrjl4gh5rigt1vdis2qavxhbsbmt8pxqeevi4o5u51avq2a5henely3pax6gqbvm6uiieg38dv88ou561qivcj5d6wsrhc47mbsa1baoytqgy79qw7qssl861myywebrt6prwe9hpmcdk753ti6qxfuxq5d22h526kca5wt3ed7rmfcp5ay4xo Please use tools like sparrow or https://live.blockcypher.com/btc/decodetx/ to verify that the tx hex is what your need Then broadcast it manually at https://mempool.space/tx/push Success sent tx: 953a87BD1E5F8b096bec1b43bA55500b7A66e0e6a27b1500b7A66e0e6a27b15a { "success": true, "data": { "commitTxid": "00000012c1f7v640d94901c93444a55e52701210840875a1zx7e0dcad70270bb6", "revealTxid": "953a87BD1E5F8b096bec1b43bA55500b7A66e0e6a27b1500b7A66e0e6a27b15a " } } Worker stopped with exit code 1 Done in 19.01s. 使用 mempool 手动广播 Rawtx hexRawtx hex 在上面输出日志中 https://mempool.space/tx/push 通过上述方法,我成功的恢复了Reveal Tx,方法仅供参考,链上操作风险自负。参考资料: https://github.com/atlaslabsapp/atomicals-js/blob/handle_no_reveal/README_cn.mdhttps://github.com/atomicals/atomicals-js/issues/244https://github.com/atomicals/atomicals-js/issues/241 ## Publication Information - [Forever121](https://paragraph.com/@forever121/): Publication homepage - [All Posts](https://paragraph.com/@forever121/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@forever121): Subscribe to updates