Skip to content

Conversation

@Overtorment
Copy link
Member

@Overtorment Overtorment commented Apr 18, 2025

helping @junderw test the RC for bitcoinjs v7.
surprisingly, all tests passed, including e2e.

v7 moved from buffers to uint8arrays , which is a major change for all consumers.
this is also our first step towards migrating away from buffers.

@socket-security
Copy link

socket-security bot commented Apr 18, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​ecpair@​2.0.1 ⏵ 3.0.0100 +110086 +378100
Updatednpm/​bitcoinjs-lib@​6.1.6 ⏵ 7.0.0-rc.09910010082100

View full report

Copy link
Collaborator

@limpbrains limpbrains left a comment

Choose a reason for hiding this comment

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

Awesome stuff!

@Overtorment Overtorment force-pushed the ref-bump-bitcoinjs-to-v7 branch from eab57d3 to ab9ec96 Compare April 18, 2025 19:16
@Overtorment Overtorment requested a review from limpbrains April 18, 2025 19:17
Copy link
Collaborator

@limpbrains limpbrains left a comment

Choose a reason for hiding this comment

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

I don’t see any issues. My only concern is that if we store a bigint in the Wallet state and then try to Json.serialize it, the operation could crash, so we need to be careful with this.

@junderw
Copy link
Collaborator

junderw commented Apr 20, 2025

If you have any requests to get into v7 before we release the final v7.0.0 version let me know.

Once this PR is ready to merge I think I'll go through the bitcoinjs ecosystem and push releases of all these major version bumps. Then we can bump this to 7.0.0 and merge.

@Overtorment
Copy link
Member Author

@junderw the only inconvenience was that bitcoinjs.crypto.sha256() is not exposed anymore, instead hash256() is exposed which is a double hash.

of course we would need to test the actual app builds with v7 thoroughly

Comment on lines +46 to +62
const origclone = unfinalized.clone;
unfinalized.clone = () => {
const newPsbt = origclone.apply(unfinalized);
const original = newPsbt.txOutputs;

Object.defineProperty(newPsbt, 'txOutputs', {
get() {
return original.map(o => ({
...o,
script: Buffer.from(uint8ArrayToHex(o.script), 'hex'),
}));
},
});

return newPsbt;
};

Copy link
Member Author

Choose a reason for hiding this comment

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

@junderw fyi thats the only ugly hack i had to do in order to make it work with v7 (patting myself on the back for having pretty good test coverage)

@Overtorment Overtorment added the testflight Upload iOS and macOS builds to Testflight. label May 14, 2025
@github-actions
Copy link

✅ Build 7.1.9 (1747232192) has been uploaded to TestFlight and will be available for testing soon.

const xOnlyPubkey = keyPair.publicKey.subarray(1, 33);
address = bitcoin.payments.p2tr({
pubkey: Buffer.from(xOnlyPubkey),
pubkey: xOnlyPubkey,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice

@Overtorment Overtorment removed the WIP label May 15, 2025
@Overtorment
Copy link
Member Author

@junderw im seriously intending to merge this and yolo bitcoinjs v7 into production. can i get your blessing please?

@github-actions
Copy link

✅ Build 7.1.9 (1747476185) has been uploaded to TestFlight and will be available for testing soon.

@Overtorment Overtorment merged commit 63c3e29 into master May 25, 2025
13 checks passed
@Overtorment Overtorment deleted the ref-bump-bitcoinjs-to-v7 branch May 25, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testflight Upload iOS and macOS builds to Testflight.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants