Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢昇
test
Commits
c79b9ab0
Commit
c79b9ab0
authored
Jun 20, 2022
by
谢昇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传新文件
parent
ea59e611
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
btc脚本钱包找回.md
btc脚本钱包找回.md
+74
-0
No files found.
btc脚本钱包找回.md
0 → 100644
View file @
c79b9ab0
# btcscript 命令总览
# btcscript 命令总览
```
Available Commands:
recovaddr get recover address
signrecov sign wallet recovery tx
```
# 1.btcscript recovaddr 获取btc脚本钱包找回地址
`cli btcscript recovaddr -h`
```
Usage:
local-cli btcscript recovaddr [flags]
Flags:
-c, --controlPub string control address public key(hex format)
-t, --delayheight int relative delay height (default 1)
-h, --help help for recovaddr
-r, --recoverPub string recovery address public key(hex format)
```
获取找回地址需要控制地址A和备份地址B的公钥,可以通过cli命令通过地址获得私钥,再通过私钥获得公钥。
通过钱包地址获得私钥:
`cli account dump_key -a 钱包中的地址`
通过私钥获得公钥:
`cli account pubkey -k 私钥`
获取A、B地址的公钥后,通过命令获得找回地址X:
`cli btcscript recovaddr -c A公钥 -r B公钥 -t 延时区块高度`
-t的参数为正整数高度。
后续要将需要操作的token转入X地址,使用A或B地址来进行提取操作。
# 2.btc signrecov 对btc脚本钱包找回交易签名
`cli btcscript signrecov -h`
```
Usage:
local-cli btcscript signrecov [flags]
Flags:
-a, --addr string sign address(must exist in wallet)
-c, --controlPub string control address public key(hex format)
-t, --delayheight int relative delay height (default 1)
-h, --help help for signrecov
-k, --privkey string sign private key(hex format)
-r, --recoverPub string recovery address public key(hex format)
-d, --txdata string tx data for sign(hex format)
```
对X地址的资产操作,分为使用A或B地址两种操作。控制地址A可以随时对X的资产进行提取。
## 使用控制地址A对找回地址X进行资产提取
首先构造交易,此处以普通转账举例:
`cli coins transfer -a 金额 -t 目标地址`
返回hex格式的交易数据
对该hex进行签名:
`cli btcscript signrecov -c A公钥 -t 延时区块高度(这个高度需和获取X地址时候的高度一致) -r B公钥 -d 上一步构造交易获得的hex -a/-k(A的地址或私钥,若为地址需在钱包)`
返回hex格式的签名数据
发送该交易:
`cli wallet send -d 上一步获得的hex`
返回交易哈希,可在链上查询。
## 使用备份地址B对找回地址X进行资产提取
首先构造交易,此处以普通转账举例:
`cli coins transfer -a 金额 -t 目标地址`
返回hex格式的交易数据
对该hex进行签名:
`cli btcscript signrecov -c A公钥 -t 延时区块高度(这个高度需和获取X地址时候的高度一致) -r B公钥 -d 上一步构造交易获得的hex -a/-k(B的地址或私钥,若为地址需在钱包)`
返回hex格式的签名数据
需要基于该tx1 hex构造延时存证交易tx2:
可以直接使用send构造一步操作:
`cli send none delay -t 延时区块高度(这个高度需和获取X地址时候的高度一致) -d tx1的hex`
需等待-t的高度后,tx1交易会打包上链。该交易回执中可查询到tx1的交易哈希,可通过该哈希查询到tx1的交易。
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment