Pages:
Author

Topic: Bitcoin lock if (time == 5years || price == $50k) - page 2. (Read 436 times)

legendary
Activity: 3346
Merit: 3130
----

Yes but how are you going to store the private key? ...

Code:
echo "Your private key is 5XXXXXXXXXXXXXXXXXX"


Quote

The private key would be visible when you make the code. But if after that you encrypt the code with sch, you will not able to see the private key, but if you run the encrypted code it will print the PK if the "IF" is true.

The magic step is while you encrypt the bash script #Cypherpunk  Wink
sr. member
Activity: 938
Merit: 452
Check your coin privilege
----

Yes but how are you going to store the private key? What I said is that it's not easy to come up with a solution where neither you or anyone will access the private key before one of the two things happen.

Time-locks are safe because the money is stuck until the block height is reached.

Storing the private key is not safe, because at any time you, or anyone can look at the source code and extract it. Hashing it also won't work because it's one way. I'm still thinking of one last thing which would be split-key generation. But I can't gather the thought yet.
legendary
Activity: 3346
Merit: 3130
You can already do the “time lock” that only allows spending your coins after X blocks/days/years/etc... I’ve done it successfully once and got my coins after a few months - all of that without having to trust a third party. Check out https://coinb.in/#newTimeLocked

Now, for the “lock until BTC is $x, I don’t think you can’t do it without a third party kind of oracle. Otherwise, where would you get the price from?

You are right, we need a third party to verify the price, and if the third party change their code, then our lock will fail.

I've thought about this for a while and the hard part would be to hide the private key.

You need some way to generate a private key AND store it in a way that you or anyone else can't access, but at the same time, make it only available if the price is above the limit you want.

If you can answer this question I can code it for you for free Cheesy But so far I couldn't think of anything that isn't reversible.

I was thinking about some encripted code, fo example with bash we can do something like:

Code:
a=$(curl -s https://api.coindesk.com/v1/bpi/currentprice/usd.json | grep -o 'rate":"[^"]*' | cut -d\" -f3);
year=1548799076;

if (date +%s -ge $year)
then
echo "Your private key is 5XXXXXXXXXXXXXXXXXX"
else if ($a -ge 50000)
echo "Your private key is 5XXXXXXXXXXXXXXXXXX"
else
echo "Try again on date $(date -d @$year +'%Y-%m-%d %H:%M:%S', or when the price reach $50k"
fi

Then just encript that bash script with sch: https://www.thegeekstuff.com/2012/05/encrypt-bash-shell-script/?utm_source=tuicool

NOTE: The code is just an example and shouldn't work, but was just to show it's possible.
sr. member
Activity: 938
Merit: 452
Check your coin privilege
I've thought about this for a while and the hard part would be to hide the private key.

You need some way to generate a private key AND store it in a way that you or anyone else can't access, but at the same time, make it only available if the price is above the limit you want.

If you can answer this question I can code it for you for free Cheesy But so far I couldn't think of anything that isn't reversible.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
So, the main idea is a code who hide a privatekey. Shouldn't be hard to do, at least i could easy do it with bash linux. But want to know what do you think about this, is it a good or bad idea? and how would you do it?

Imho is not a good idea. You never know when something really bad happens and you need that money.
The method that worked out for me until now was to use paper wallets. Most of the amounts on the paper wallets are untouched. All that didn't get onto the paper wallets was spent.
Of course, it's not so big amounts but still, the paper wallets made me think twice before spending.

PS. Maybe you should split your "problem" in two, because the "good or bad idea" debate is more on the Discussions field than Project.
legendary
Activity: 2758
Merit: 6830
You can already do the “time lock” that only allows spending your coins after X blocks/days/years/etc... I’ve done it successfully once and got my coins after a few months - all of that without having to trust a third party. Check out https://coinb.in/#newTimeLocked

Now, for the “lock until BTC is $x, I don’t think you can’t do it without a third party kind of oracle. Otherwise, where would you get the price from?
legendary
Activity: 3346
Merit: 3130
Lot of us are terrible holders (me on that list...), and regrets about not holding since long time ago, so, i was thinking about a bitcoin lock, some code to hold the bitcoins until one of these conditions become true:

Code:
time == 5years
price == $50k

So, the main idea is a code who hide a privatekey. Shouldn't be hard to do, at least i could easy do it with bash linux. But want to know what do you think about this, is it a good or bad idea? and how would you do it?
Pages:
Jump to: