Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
share
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
张振华
share
Commits
cf6bc34b
Commit
cf6bc34b
authored
Jul 11, 2019
by
张振华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c5158a13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
Dpos投票合约介绍.md
dpos共识/Dpos投票合约介绍.md
+10
-1
No files found.
dpos共识/Dpos投票合约介绍.md
View file @
cf6bc34b
...
@@ -163,6 +163,15 @@ Available Commands:
...
@@ -163,6 +163,15 @@ Available Commands:
# 七.采用VRF算法来确定超级节点的出块顺序
# 七.采用VRF算法来确定超级节点的出块顺序
VRF要点:
```
go
k
,
pk
:=
GenerateKey
()
//生成secp256k1公私钥
r
,
p
:=
k
.
Evaluate
(
m
)
//私钥对明文m计算出r,p,并对外公布
r
'
:=
pk
.
ProofToHash
(
m
,
p
)
//可以用公钥对m,p进行计算,得到的r'
r
==
r
'
//如果与r一致,则得到验证
```
## (1)各个超级节点,在一个Cycle开始时,发布各自的M
## (1)各个超级节点,在一个Cycle开始时,发布各自的M
./chain33-cli --rpc_laddr="${rpcAddr}" dpos vrfMRegist -c 10001 -m data1 -k 03EF0E1D3112CF571743A3318125EDE2E52A4EB904BCBAA4B1F75020C2846A7EB4
./chain33-cli --rpc_laddr="${rpcAddr}" dpos vrfMRegist -c 10001 -m data1 -k 03EF0E1D3112CF571743A3318125EDE2E52A4EB904BCBAA4B1F75020C2846A7EB4
./chain33-cli --rpc_laddr="${rpcAddr}" wallet sign -a 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b -d
./chain33-cli --rpc_laddr="${rpcAddr}" wallet sign -a 15LsTP6tkYGZcN7tc1Xo2iYifQfowxot3b -d
...
...
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