Skip to content

Add lamport signature support#85

Merged
jonasmartin merged 6 commits intodevfrom
feature/lamport-signature
Mar 18, 2026
Merged

Add lamport signature support#85
jonasmartin merged 6 commits intodevfrom
feature/lamport-signature

Conversation

@crivasr
Copy link

@crivasr crivasr commented Mar 12, 2026

Adds bitcoin script for Lamport signature verification and support for Lamport signatures in speedup data

src/scripts.rs Outdated
Comment on lines +64 to +75
KeyType::EcdsaKey => Err(ScriptError::InvalidKeyType(
"Lamport".to_string(),
"EcdsaKey".to_string(),
)),
KeyType::XOnlyKey => Err(ScriptError::InvalidKeyType(
"Lamport".to_string(),
"XOnlyKey".to_string(),
)),
KeyType::WinternitzKey { .. } => Err(ScriptError::InvalidKeyType(
"Lamport".to_string(),
"Winternitz".to_string(),
)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not handle every type
_=> Err(ScriptError::InvalidKeyType("Lamport".to_string(), self.to_string() )
if to_string is not implmented, can derive debug, and then format!("{:?}",self)

src/scripts.rs Outdated
Comment on lines +420 to +423
if keep_message {
stack.op_dup();
stack.to_altstack();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not right, the idea is not to keep the signature or preimage, but if it represents 0 or 1


stack.op_swap();
stack.hexstr(&ones[idx]);
stack.op_equal();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// maybe adding this is enough to keep the 1 or 0
if keep {
stack.op_dup();
stack.to_altstack();
}


stack.op_true();
assert!(!stack.run().success);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test for keep_mesage true

Copy link
Contributor

@jonasmartin jonasmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL to the comments.

Copy link
Contributor

@jonasmartin jonasmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonasmartin jonasmartin merged commit 4d00de4 into dev Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants