INNER CODE UNIT · Go

nextEphemeral

lightningnetwork/lightning-onion · cmd/main.go:333

func nextEphemeral(ctx *cli.Context) error {
	privKeyByte, err := hex.DecodeString(ctx.String("priv"))
	if err != nil {
		return err
	}
	if len(privKeyByte) != 32 {
		return fmt.Errorf("private key must be 32 bytes")
	}

	privKey, _ := btcec.PrivKeyFromBytes(privKeyByte)

	pubKeyBytes, err := hex.DecodeString(ctx.String("pub"))
	if err != nil {
		return err
	}

	pubKey, err := btcec.ParsePubKey(pubKeyBytes)
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…