Skip to content

Remove bitcoin for secp256k1 with no-std fix#157

Merged
nyonson merged 1 commit intorust-bitcoin:mainfrom
nyonson:drop-bitcoin
Sep 6, 2025
Merged

Remove bitcoin for secp256k1 with no-std fix#157
nyonson merged 1 commit intorust-bitcoin:mainfrom
nyonson:drop-bitcoin

Conversation

@nyonson
Copy link
Copy Markdown
Collaborator

@nyonson nyonson commented Sep 5, 2025

Extends #156 with a no-std fix and doc fixes (maybe there is a better way to do this than a new PR, but my git-foo is lacking here).

@rustaceanrob should we try to lower the version of secp for flexibility or is there a reason to set the bar at v0.29.0? EDIT: guess we should just match bitcoin to not cause a multiple versions for consumers.

To help with type safety a bit, I have public callsites use an `impl
Borrow<[u8; 4]>`, which the `p2p::Magic` type implements. This way one
can pass magic variables directly. In the handshake this just gets
dereferenced anyway, but it still feels more ergonomic than forcing a
`to_bytes` on the caller IMO.

I keep the `secp256k1` the same, but maybe it can be bumped. I forget if
there are problems when attempting to build conflicting versions or not.

Concat usage was dropped in favor of explicit array handling. This was
probably being iron'd out by the compiler before, but this patch
introduces Borrow which broke no-std environment support.

Co-authored-by: Nick Johnson <nick@yonson.dev>
@nyonson nyonson requested a review from rustaceanrob September 5, 2025 21:32
@rustaceanrob
Copy link
Copy Markdown
Collaborator

rustaceanrob commented Sep 6, 2025

ACK 0aecda7

I'll let you do the honors on merging. Yeah, I think we just match bitcoin here. We don't need anything special and ideally consumers have a single secp

@nyonson nyonson merged commit 8c46943 into rust-bitcoin:main Sep 6, 2025
15 of 16 checks 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