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

library release on cocoapods? #260

Closed
mattiaferrari02 opened this issue Dec 9, 2022 · 10 comments
Closed

library release on cocoapods? #260

mattiaferrari02 opened this issue Dec 9, 2022 · 10 comments
Labels
🤔 question Further information is requested

Comments

@mattiaferrari02
Copy link

mattiaferrari02 commented Dec 9, 2022

Do you plan to release the lib on cocoapods or to add a .podspec file in the repo.
I'm working on react native so I don't have access to swfit package manager, only to pods

@csjones
Copy link
Contributor

csjones commented Dec 10, 2022

Hey @mattiaferrari02 👋

You can definitely add this Swift package to your react native project, just need to treat it as a dependency in Xcode. I will not be supporting cocoapods because the build system uses SPM directly which is why there are no .xcworkspace or .xcodeproj files included.

If cocoapods is required, several secp256k1 pods exist even one that's a fork of this project.

@mattiaferrari02
Copy link
Author

Ok thank you for letting me know about that, also, do you know this same lib but written in java?

@csjones
Copy link
Contributor

csjones commented Dec 11, 2022

Your package wraps bitcoin-core/secp256k1, not this one, the thing that i need is the module generator that isn't present in the bitcoin-core/secp256k1 lib

Noticed your reply. This package does support ElementsProject/secp256k1-zkp. You might want to fork this project, add the podspec from the cocoapod fork, then update the spec to point to the zkp source files instead. The two secp256k1 projects are nearly identical with mostly additional source files added to zkp but also added header paths to make it build for spm (which may or may not be needed for cocoapods).

Ok thank you for letting me know about that, also, do you know this same lib but written in java?

Not familiar with java versions, GitHub does have several search results to look at though.

@mattiaferrari02
Copy link
Author

yeah the only problem is that, your package works, i already tried adding a podspec to the elementsProject version (following what they did the fork of this project that you mentioned), but when i tried calling secp256k1_ecdh from the elements project compiled from the podspec, it crashed with an error

@csjones
Copy link
Contributor

csjones commented Dec 11, 2022

What does the zkp podspec look like?

@mattiaferrari02
Copy link
Author

I forked the project and added the podspec https://github.com/mattiaferrari02/secp256k1-zkp/blob/master/secp256k1ZkpWrapper.podspec . To make it work i had to change some include paths aroud the project, this way at least compiles...

@csjones
Copy link
Contributor

csjones commented Dec 12, 2022

Looks like there are a few issues in the spec. For example, using secp256k1_ecdh I think still requires defining ENABLE_MODULE_ECDH and the include paths for the spec use src/bench.h when it might need to be excluded.

@mattiaferrari02
Copy link
Author

mattiaferrari02 commented Dec 12, 2022

https://github.com/mattiaferrari02/secp256k1-zkp/blob/729e21836b2e250102afb4e2b3b5e38bac8023a9/secp256k1ZkpWrapper.podspec#L25
ecdh is included

So do you think i should add "src/bench*.h" to the exclude_files?

I simply tried porting the file existing podspec https://github.com/portto/secp256k1/blob/master/secp256k1Wrapper.podspec from the guy that you linked above, but as you can see he is using the bitcoin-core version and not the zkp one, there are some differences.
The module generator, for example, is required in our project...

@csjones
Copy link
Contributor

csjones commented Dec 12, 2022

This is reason for me suggesting SPM because this project supports zkp and you can reference the files included in zkp_bindings directory. It might be beneficial to try explicitly listing each file to include/exclude in the spec but there could still end up being other nuance differences between spm and cocoapods.

@mattiaferrari02
Copy link
Author

Oh shit it works, I used your zkp package and also https://github.com/portto/secp256k1.swift (I still cannot import your secp256k1 because it doesn't compile and I still needed something that added that extensions to the string object to swift)

Really, thank you, now MAYBE I can proceed with my implementations!

I still need to find the counterpart working in java (or kotlin), I looked to what you linked and they don't look so good...

@csjones csjones closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants