xanimo / dogecoin-payment-server-archive

MIT License
1 stars 3 forks source link

convert RS_STRUCTURE to validate against ints instead of strings #8

Open xanimo opened 2 years ago

xanimo commented 2 years ago

and configure services test accordingly. add make logs.

rllola commented 2 years ago

I think we should agree on the ;. I am used to remove it.

The second issue is the use of Partially Signed Bitcoin Transaction. There is no way to get from a serialized transaction the hex psbt equivalent using the lib. To avoid writing the piece of code that does that, I have changed the expected parameters for announce to received the RedeemScript only.

You can still use bitcoin-js lib and derive the p2sh address to track the funding.

I have also dissociated payment into 2 endpoints announce (initiate the payment channel) and payment (send Alice signed transaction that will count as a micro payment).

Some of the modifications you have here I can port them into the other PR.

xanimo commented 2 years ago

I think we should agree on the ;. I am used to remove it.

The second issue is the use of Partially Signed Bitcoin Transaction. There is no way to get from a serialized transaction the hex psbt equivalent using the lib. To avoid writing the piece of code that does that, I have changed the expected parameters for announce to received the RedeemScript only.

You can still use bitcoin-js lib and derive the p2sh address to track the funding.

I have also dissociated payment into 2 endpoints announce (initiate the payment channel) and payment (send Alice signed transaction that will count as a micro payment).

Some of the modifications you have here I can port them into the other PR.

iirc you can. i think the flow goes, sign inputs, finalize and then you extract raw tx hash by writing:

let rawTxHash = psbt.ExtractTransation()

which outputs raw rx hex which i've confirmed using ./dogecoin-tx -json <extracted tx hex>.

i'm afk can you confirm if you have a chance? and or is the issue that you need the hex prior to signing/finalizing?

xanimo commented 2 years ago

also as far as ; lets integrate a standard and use linter so we can just configure and forget about, lint prior to push.

i've yet to see pr, but i'm fine with either way you want to do. if possible to make sure you cherry pick the qa/testing stuff, at very least validation stuff on payment service or i can just fix up after we have agreed upon endpoints.

rllola commented 2 years ago

iirc you can. i think the flow goes, sign inputs, finalize and then you extract raw tx hash by writing

I don't use the library to sign the transaction and then I can't just the take the signed hex and convert it to psbt format. I am trying to avoid using libs too.

Also I am not super enthusiast about this format as it is quite specific to Bitcoin and include Bitcoin specific features. Also the lib in question is more Bitcoin oriented and compatibility is not sure in the future.

rllola commented 2 years ago

also as far as ; lets integrate a standard and use linter so we can just configure and forget about, lint prior to push.

i've yet to see pr, but i'm fine with either way you want to do. if possible to make sure you cherry pick the qa/testing stuff, at very least validation stuff on payment service or i can just fix up after we have agreed upon endpoints.

For linter, I propose using StandardJS (https://standardjs.com/) ?

I can add this and cherry pick your modification in the PR I opened the other day.

rllola commented 2 years ago

There is a lot that has been changed since this PR was first opened. Maybe open smaller PRs from main and I will review them asap.