stellar / go

Stellar's public monorepo of go code
https://stellar.org/developers
Apache License 2.0
1.3k stars 499 forks source link

bifrost: p2sh support? #263

Closed ramontayag closed 6 years ago

ramontayag commented 6 years ago

Any plans to support p2sh? Thinking of having deposits go directly to a multi-sig cold storage wallet, controlled by something like Electrum. I'm far less familiar with the options for Ethereum -- like if a smart contract can have a HD wallet of some kind.

bartekn commented 6 years ago

I think this would make the process less user-friendly:

To solve this you can create a background process that forwards payments from hd-wallet addresses to a multi-sig wallet. Because it's likely that you don't need to move these funds right away you can set a lower fee on these transactions so that they will be added to a block eventually (ex. after 2-3 days). However this worker should work on an offline machine because it will need to have master private key to sign transactions.

Will reopen this when there is interest in this feature from more users.

ramontayag commented 6 years ago

@bartekn ok thanks for the response. I want to clarify that it shouldn't make it more complicated to the person depositing. They will still see their unique address, like 3Qxxxxxxxxxxx. Since posting this I did a but more research, and what I'm referring to is hierarchical deterministic multisig (or HDM). I can't tell if there's a standard way to create these.

In case the community shows interest, here are some libraries that do this:

bartekn commented 6 years ago

OK, then I misunderstood you. I thought that you want users to send to a single address but you want to create many P2SH addresses and each user will have it's own.

There's probably a smart way to do it in Bitcoin. However, in Ethereum you'd have to deploy (init) each of the multisig contract before receiving a payment - this requires more coordination and can be expensive (in terms of network fees).