Bitcoin Forum

Bitcoin => Project Development => Topic started by: seoincorporation on January 29, 2019, 07:59:18 PM



Title: Bitcoin lock if (time == 5years || price == $50k)
Post by: seoincorporation on January 29, 2019, 07:59:18 PM
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?


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: TryNinja on January 29, 2019, 08:08:08 PM
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?


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: NeuroticFish on January 29, 2019, 08:17:24 PM
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.


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: KingZee on January 29, 2019, 08:36:15 PM
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 :D But so far I couldn't think of anything that isn't reversible.


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: seoincorporation on January 29, 2019, 10:04:29 PM
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 :D 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.


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: KingZee on January 29, 2019, 10:08:28 PM
----

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.


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: seoincorporation on January 30, 2019, 02:17:32 AM
----

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

Code:
echo "Your private key is 5XXXXXXXXXXXXXXXXXX"


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

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  ;)


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: elda34b on January 30, 2019, 03:49:06 AM
Let me try it if anybody has successfully made the apps. :D
I'll unlock it when 1 BTC = $1 million.

We can also use this to ensure that whales or big players won't dump their Bitcoin by daring them to lock their Bitcoin and unlock it when the price reach whatever that they predicted. I'm sure McAfee won't use this though.


Title: Re: Bitcoin padlock if (time == 5years || price == $50k)
Post by: KingZee on January 30, 2019, 03:55:21 AM

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  ;)

Makes sense, bash can easily be turned into binary and linux can easily run that binary code. This could work, you just need to figure out how to ping blockchain.com's (or any other) api to retrieve the price.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: pooya87 on January 30, 2019, 05:06:51 AM
what are you going to do if you received a false response? for example if the API you used returned $1 million as the price when you made the call? i may be wrong about this part you can't also prevent any interception of the API response either since you are not doing a certificate check.

also what are you going to do if these sites died or changed their API address? for example from api.blockchain.info to api.blockchain.com. and if you make it flexible then what will you do to prevent changing it to anything to get a fake result and "unlocking" the private key?


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Kakmakr on January 30, 2019, 05:33:11 AM
This will come in handy for the following reason too, because I have family that knows I am invested in Bitcoin and they are constantly nagging me to sell more coins to fund silly things like holidays and cheap consumer goods.  >:(

If you lock those funds <like a fixed deposit at a Bank>, nobody can force you to use those coins and you will have the perfect excuse when they come knocking for money.  ;D

Non-Bitcoiners does not understand the concept of Hodling!  ::)


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: NeuroticFish on January 30, 2019, 06:57:28 AM
what are you going to do if you received a false response? for example if the API you used returned $1 million as the price when you made the call? i may be wrong about this part you can't also prevent any interception of the API response either since you are not doing a certificate check.

also what are you going to do if these sites died or changed their API address? for example from api.blockchain.info to api.blockchain.com. and if you make it flexible then what will you do to prevent changing it to anything to get a fake result and "unlocking" the private key?

It has just occurred to me: He can always override the hosts settings in his computer and redirect to a "fake" API made by himself and hosted locally.
And on a similar logic I think that even the time barrier can be broken - local time can be set by hand and the time servers can be spoofed.
I think that the only reliable "barrier" is the "current" block number on the blockchain.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Piggy on January 30, 2019, 08:33:30 AM
It has just occurred to me: He can always override the hosts settings in his computer and redirect to a "fake" API made by himself and hosted locally.
And on a similar logic I think that even the time barrier can be broken - local time can be set by hand and the time servers can be spoofed.
I think that the only reliable "barrier" is the "current" block number on the blockchain.

I assume it may be even possible to access the memory used by that bash script while is running, then force one of the two conditions to occur by changing some values. This in case somebody determined enough is able to get his hand on it.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: eternalgloom on January 30, 2019, 01:17:26 PM
I personally don't think it's a good idea to add a price condition to the lock, I have tried regular time-locks for +1 year though.
Just don't think it's a good idea to rely on any sort of external API for the price.

It has just occurred to me: He can always override the hosts settings in his computer and redirect to a "fake" API made by himself and hosted locally.
And on a similar logic I think that even the time barrier can be broken - local time can be set by hand and the time servers can be spoofed.
I think that the only reliable "barrier" is the "current" block number on the blockchain.

The fact that you can override it defeats the purpose of having such a lock in the first place.
If you can't help yourself, you'll just break it before it's time.

For anyone interested in doing a time-lock based on block height or date, here's a guide for Coinb.in:
https://bitcointalk.org/index.php?topic=2415595.msg24712087#msg24712087


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: hatshepsut93 on January 30, 2019, 06:21:13 PM
What if you use network difficulty instead of the price? Difficulty correlates with the price, because the higher the price, the more profitable mining becomes, which means more miners, which means more difficulty. Of course, this is far from perfect, because change happens over long periods of time, but if you can create a script that checks for network difficulty, you'll be able to avoid dealing with any third parties, which is totally in spirit of Bitcoin.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: pooya87 on January 31, 2019, 05:36:11 AM
i like the difficulty idea, but the basic problem with this idea and other ideas similar to it is that you can fake the data as long as you are the only one responsible for it.
the only reason why the scripts such as OP_HODL work is because you are not responsible for it, the whole network decides whether your transaction is valid or not. you can still fake it and sign the transaction but the rest of the network will reject it because it is invalid until the time comes.
so unless you can come up with a OP code that the network has to validate, you won't be able to come up with a perfect plan.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: CristianOff on February 07, 2019, 11:49:17 PM
Imagine Bitcoin reaching $49,999.99 at the top and drops back to $5k  ;D
If only we were not controlled by 3rd parties aliens like in a Sims game (https://en.wikipedia.org/wiki/The_Sims_4) who force us to spend our Bitcoins...


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Pmalek on February 08, 2019, 10:25:09 AM
Seems like a very dangerous idea honestly. Who knows what might happen to you and the ones close to you in a year after you lock up your bitcoins and you would have to wait for another 4 years to get access to them.
Also, if you can override the lock and still access the Bitcoins before set conditions are met then it hasn't really achieved its purpose and the time and resources spent making it would be thrown away.
It would be like trying to lose weight and getting fit by hiding your candy under you pillow so that you can't find them. 


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: seoincorporation on February 08, 2019, 08:47:46 PM
Imagine Bitcoin reaching $49,999.99 at the top and drops back to $5k  ;D
If only we were not controlled by 3rd parties aliens like in a Sims game (https://en.wikipedia.org/wiki/The_Sims_4) who force us to spend our Bitcoins...

Lol that would be the trollest day in human history.

What if you use network difficulty instead of the price? Difficulty correlates with the price, because the higher the price, the more profitable mining becomes, which means more miners, which means more difficulty. Of course, this is far from perfect, because change happens over long periods of time, but if you can create a script that checks for network difficulty, you'll be able to avoid dealing with any third parties, which is totally in spirit of Bitcoin.

I think this is a good idea because we can get that information direct from bitcoin-cli, but the problem now would be that the script would need bitcoin core to run, so, is almost the same than have a 3rd party plugin.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Patatas on February 08, 2019, 09:07:35 PM
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
It all works in favor of a private key holder. Doesn't matter how restrictive your designed software is, if the user has access to his private keys he can liquidate them anytime. I don't think to ask an owner for his private key is a good idea.

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?
Hiding is easy, retrieval is all that matters. If you need it on an urgent basis, how complicated is the retrieval procedure? Should they be allowed to even retrieve even if the condition is not met.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Initscri on February 10, 2019, 01:58:37 AM
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.

I vouch for using paper wallets as a method of saving (not just storage). Simply something being an inconvenience is enough for most people not to spend savings.

It's the same concept as having a separate banking account for funds you really don't want to spend. If spending is too convenient, you're not going to save.

As for the exchange idea, you could definitely code something, but you would have to essentially run the code, and as such, you would technically have access to the coins. No way to invalid the funds on a conditional basis within the chain


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Bitcoin-Turkiye on February 10, 2019, 02:22:42 PM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: seoincorporation on February 10, 2019, 07:43:11 PM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(

Damn, making brute force to 25 digits mixed with numbers isn't easy, but if you want to try then JTR is the tool you need... How much do you lose this way? If is a big amount for sure you can find someone on this forum to recover those BTC.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Bitcoin-Turkiye on February 16, 2019, 12:50:25 PM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(

Damn, making brute force to 25 digits mixed with numbers isn't easy, but if you want to try then JTR is the tool you need... How much do you lose this way? If is a big amount for sure you can find someone on this forum to recover those BTC.

At least 4 bitcoin, but I don't trust that I send wirnar to someone. I tried 500 passwords and couldn't find it.  I e-mailed Winrar, they said they couldn't do anything about it. I think my last resort a bug in winrar..  there was a way, but it doesn't work anymore.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: seoincorporation on February 16, 2019, 02:57:12 PM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(

Damn, making brute force to 25 digits mixed with numbers isn't easy, but if you want to try then JTR is the tool you need... How much do you lose this way? If is a big amount for sure you can find someone on this forum to recover those BTC.

At least 4 bitcoin, but I don't trust that I send wirnar to someone. I tried 500 passwords and couldn't find it.  I e-mailed Winrar, they said they couldn't do anything about it. I think my last resort a bug in winrar..  there was a way, but it doesn't work anymore.

4 BTC is some nice cash my friend, i would like to insist in JTR (Jhon the ripper), here are some tutorials about how to use it: https://dfir.science/2014/07/how-to-cracking-zip-and-rar-protected.html

If you have more information like the number of words or the total of numbers on the pasword, then we could make some brute force with 'Crunch'.


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: Bitcoin-Turkiye on February 21, 2019, 10:27:39 PM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(

Damn, making brute force to 25 digits mixed with numbers isn't easy, but if you want to try then JTR is the tool you need... How much do you lose this way? If is a big amount for sure you can find someone on this forum to recover those BTC.

At least 4 bitcoin, but I don't trust that I send wirnar to someone. I tried 500 passwords and couldn't find it.  I e-mailed Winrar, they said they couldn't do anything about it. I think my last resort a bug in winrar..  there was a way, but it doesn't work anymore.

4 BTC is some nice cash my friend, i would like to insist in JTR (Jhon the ripper), here are some tutorials about how to use it: https://dfir.science/2014/07/how-to-cracking-zip-and-rar-protected.html

If you have more information like the number of words or the total of numbers on the pasword, then we could make some brute force with 'Crunch'.


Thank you so much. I know the first six digits. Can 6 digits remain fixed? does it make a combination from my list?


Title: Re: Bitcoin lock if (time == 5years || price == $50k)
Post by: seoincorporation on February 22, 2019, 02:57:03 AM
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?

I put my bitcoins in a winrar, and I put the password, I can't find the password 25 digits, the number was mixed with letters, I don't know what to do. this is really sad. I hope you don't fall into this mistake I did. be careful :(

Damn, making brute force to 25 digits mixed with numbers isn't easy, but if you want to try then JTR is the tool you need... How much do you lose this way? If is a big amount for sure you can find someone on this forum to recover those BTC.

At least 4 bitcoin, but I don't trust that I send wirnar to someone. I tried 500 passwords and couldn't find it.  I e-mailed Winrar, they said they couldn't do anything about it. I think my last resort a bug in winrar..  there was a way, but it doesn't work anymore.

4 BTC is some nice cash my friend, i would like to insist in JTR (Jhon the ripper), here are some tutorials about how to use it: https://dfir.science/2014/07/how-to-cracking-zip-and-rar-protected.html

If you have more information like the number of words or the total of numbers on the pasword, then we could make some brute force with 'Crunch'.


Thank you so much. I know the first six digits. Can 6 digits remain fixed? does it make a combination from my list?


yes, you can make a passwords list with a tool called 'crunch'.

Let's say the first 6 digits are 123456 and the password is a 12 chars pass made only with numbers, the crunch command would be:

Quote
crunch 12 12 1234567890 + + + -t 123456@@@@@@

So, with crunch and JTR should be possible to crack, i will leave some links here about crunch.

https://null-byte.wonderhowto.com/how-to/tutorial-create-wordlists-with-crunch-0165931/
https://null-byte.wonderhowto.com/how-to/hack-like-pro-crack-passwords-part-4-creating-custom-wordlist-with-crunch-0156817/