Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic structure for crypto, state, time #13

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/crypto/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package crypto

const (
HashSize = 32
BandersnatchSize = 32
Ed25519PublicSize = 32
Ed25519PrivateSize = 64
BLSSize = 144
)
3 changes: 3 additions & 0 deletions internal/crypto/hash.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package crypto

type Hash [HashSize]byte
8 changes: 8 additions & 0 deletions internal/crypto/keys.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package crypto

import (
"crypto/ed25519"
)

type Ed25519PublicKey ed25519.PublicKey
type Ed25519PrivateKey ed25519.PrivateKey
4 changes: 4 additions & 0 deletions internal/state/state.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package state

type State struct {
}
9 changes: 9 additions & 0 deletions internal/time/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package time

import "time"

const (
TimeslotsPerEpoch = 600
TimeslotDuration = 6 * time.Second
EpochDuration = TimeslotsPerEpoch * TimeslotDuration
)
3 changes: 3 additions & 0 deletions internal/time/epoch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package time

type Epoch uint32
3 changes: 3 additions & 0 deletions internal/time/timeslot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package time

type Timeslot uint32
Loading