Skip to content

Commit

Permalink
change PubKey/PrivKey prefixes of "ostracon/" to "tendermint (#445) (#…
Browse files Browse the repository at this point in the history
…447)

1. The private key may remain "pstracon/PrivKeyXxx" as it's never exposed to outside world. However, it makes no sense to keep the ostracon prefix even with asymmetric naming, so it should be modified with "tendermint/PrivKeyXxx"
2. BLS12 and Composite key types are not compatible with current Cosmos assets to begin with.  To make this clear, these Ostracon-specific prefixes are left as "ostracon/".
  • Loading branch information
torao authored Jul 27, 2022
1 parent f42887f commit 18bdbd7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ var testGenesisFmt = `{
"validators": [
{
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"power": "10",
Expand All @@ -626,18 +626,18 @@ var testGenesisFmt = `{
var testPrivValidatorKey = `{
"address": "A3258DCBF45DCA0DF052981870F2D1441A36D145",
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value": "AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
},
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "EVkqJO/jIXp3rkASXfh9YnyToYXRXhBr6g9cQVxPFnQBP/5povV4HTjvsy530kybxKHwEi85iU8YL0qQhSYVoQ=="
}
}`

var testNodeKey = `{
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "hICuZLlVwHdzz6pAQOKk07MFn3Hze1EwwTUUhEDIdti9a1cQLR5Co/lxAzeGcyPWS/LuEr7qbgHmDUJT/nxx+Q=="
}
}`
Expand Down
4 changes: 2 additions & 2 deletions crypto/ed25519/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "ostracon/PrivKeyEd25519"
PubKeyName = "ostracon/PubKeyEd25519"
PrivKeyName = "tendermint/PrivKeyEd25519"
PubKeyName = "tendermint/PubKeyEd25519"
// PubKeySize is is the size, in bytes, of public keys as used in this package.
PubKeySize = 32
// PrivateKeySize is the size, in bytes, of private keys as used in this package.
Expand Down
4 changes: 2 additions & 2 deletions crypto/secp256k1/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (

//-------------------------------------
const (
PrivKeyName = "ostracon/PrivKeySecp256k1"
PubKeyName = "ostracon/PubKeySecp256k1"
PrivKeyName = "tendermint/PrivKeySecp256k1"
PubKeyName = "tendermint/PubKeySecp256k1"

KeyType = "secp256k1"
PrivKeySize = 32
Expand Down
4 changes: 2 additions & 2 deletions crypto/sr25519/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
var _ crypto.PrivKey = PrivKey{}

const (
PrivKeyName = "ostracon/PrivKeySr25519"
PubKeyName = "ostracon/PubKeySr25519"
PrivKeyName = "tendermint/PrivKeySr25519"
PubKeyName = "tendermint/PubKeySr25519"

// SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed
// Sr25519 point, and a field element. Both of which are 32 bytes.
Expand Down
10 changes: 5 additions & 5 deletions rpc/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
Expand Down Expand Up @@ -1698,7 +1698,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
Expand Down Expand Up @@ -1857,7 +1857,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM="
Expand Down Expand Up @@ -2028,7 +2028,7 @@ components:
- "value"
properties:
type:
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: "string"
example: "VNMNfw7mrQBSpEvCtA9ykOe6BoR00RM9b/a9v3vXZhY="
Expand Down Expand Up @@ -2803,7 +2803,7 @@ components:
properties:
type:
type: string
example: "ostracon/PubKeyEd25519"
example: "tendermint/PubKeyEd25519"
value:
type: string
example: "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
Expand Down
6 changes: 3 additions & 3 deletions tools/tm-signer-harness/internal/test_harness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const (
keyFileContents = `{
"address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748",
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc="
},
"priv_key": {
"type": "ostracon/PrivKeyEd25519",
"type": "tendermint/PrivKeyEd25519",
"value": "8O39AkQsoe1sBQwud/Kdul8lg8K9SFsql9aZvwXQSt1kKy5ONpzMTKifvSeYrHC/C76Oqturk4ffJCNwrRIXFw=="
}
}`
Expand Down Expand Up @@ -61,7 +61,7 @@ const (
{
"address": "D08FCA3BA74CF17CBFC15E64F9505302BB0E2748",
"pub_key": {
"type": "ostracon/PubKeyEd25519",
"type": "tendermint/PubKeyEd25519",
"value": "ZCsuTjaczEyon70nmKxwvwu+jqrbq5OH3yQjcK0SFxc="
},
"power": "10",
Expand Down
10 changes: 5 additions & 5 deletions types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ func TestGenesisBad(t *testing.T) {
[]byte(
`{"validators":[` +
`{"pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// too big chain_id
[]byte(
`{"chain_id": "Lorem ipsum dolor sit amet, consectetuer adipiscing", "validators": [` +
`{"pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// wrong address
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"address": "A", "pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}` +
`]}`,
),
// missing some params in voter_params
[]byte(
`{"chain_id":"mychain", "validators":[` +
`{"pub_key":{` +
`"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="` +
`},"power":"10","name":""}], ` +
`"voter_params":{"voter_election_threshold":"1"}` +
`}`,
Expand All @@ -75,7 +75,7 @@ func TestGenesisGood(t *testing.T) {
"initial_height": "1000",
"consensus_params": null,
"validators": [{
"pub_key":{"type":"ostracon/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"pub_key":{"type":"tendermint/PubKeyEd25519","value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="},
"power":"10",
"name":""
}],
Expand Down

0 comments on commit 18bdbd7

Please sign in to comment.