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

P2SH support for coinbase transaction #144

Open
HashUnlimited opened this issue May 22, 2018 · 6 comments
Open

P2SH support for coinbase transaction #144

HashUnlimited opened this issue May 22, 2018 · 6 comments

Comments

@HashUnlimited
Copy link
Collaborator

So P2SH (and bech32) support isn't there. That wouldn't be a problem if someone sometimes would do some work on it, but the really BAD thing is that this part:

`exports.addressToScript = function(addr){

var decoded = base58.decode(addr);

if (decoded.length != 25){
    console.error('invalid address length for ' + addr);
    throw new Error();
}

if (!decoded){
    console.error('base58 decode failed for ' + addr);
    throw new Error();
}

var pubkey = decoded.slice(1,-4);

return Buffer.concat([new Buffer([0x76, 0xa9, 0x14]), pubkey, new Buffer([0x88, 0xac])]);

};
`

Is decoding any P2SH address from the config into a VALID P2PKH which does of course NOT belong to the local wallet and there for effectively burning coins without notification.

I think that's a reason to work on P2SH support pretty quickly....

@zone117x
Copy link
Owner

Ah, unfortunately this project is only in minimal maintenance mode. We need new maintainers and developers to build out any new features.

@HashUnlimited
Copy link
Collaborator Author

I am going to try try to make it more open by using bitcoinjs-lib for extracting the scripts for any kind of blockchain. This will require either to add networks or ultimately adding the address prefixed to the coin config. Can you pls. create a dev branch so we can hand the changes to more people for testing?

Open for a discussion how to pass this info through the code, inputs welcome. We are going to stick around here for a while together with some other devs as NOMP currently is the only known Open Source repo to me which isn't loaded with useless BS and the parts are functioning as required, little dated though. Once we got this major issue here fixed, I am planning to get the MPOS Wiki using us as example setup as well.

Due to the fact that all useful combinations of Open Source projects have almost vanished, I would like to invest some work so that us Shitcoin devs, we got something to rely on, perform our testing without big hassle and even offer a basic mining setup to others.

So feel free to add me as a maintainer if you like, just not going to answer tons of "help pls" issues.

@zone117x
Copy link
Owner

Created a dev branch, and added you as a maintainer. What other repos do you need maintainer access to?

@HashUnlimited
Copy link
Collaborator Author

Alright mate, I'd suggest the NOMP and the multi-hashing. In my current approach I am trying (so far no success, how to get a stupid number out of the JSON and store it as a hex? :-D) to initialise the address prefixes directly in init.js to avoid reading all the way back on each block. Then bitcoinjs is going to determine the key type for us and return the output script.

@ahmedbodi
Copy link
Contributor

I believe the address is verified in pool.js during startup by calling validateaddress. That ensures it does belong to the network of the coin weve specified

@cryptozeny
Copy link

fully agreed to add this feature. bech32 address is a nice future. any update?

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

No branches or pull requests

4 participants