What -could- be done is this:
An online service advertises a "daily limit" service. You register an account on that service, you fix your allowance, and they send you a private-public key pair.
You print the private key, and keep it locked.
You generate another private-public key pair, for use with your own hot wallet. (you also print a copy and keep it locked too)
Now you send all your funds to a multisig address which must be signed by both your key, and the service's key.
Form now on, when you want to spend coins, your wallet generates a transaction, signs it, forwards it to the "daily limit" service. The service inspects the transaction, verifies the amount transferred, and it it is below your daily quota, signs it and broadcasts it. It will confirm after a few minutes.
Now, if:
1. Your wallet is compromised, an attacker cannot spend more that your daily limit. After that the daily limit service refuses to sign.
2. If the service is compromised, the attacker cannot spend your funds because he doesn't know your private key.
3. Only if both your wallet AND the service is compromised then the attacker can steal all your funds.
Now, if your wallet is compromised, or if the service goes down, or in any case you want to move more money that what your daily limit allows, not a problem! You have all the necessary private keys to initiate any transaction locked in a safe place; you can retrieve them.
I proposed that upthread. The service actually wouldn't want to give you their private key to the user as they lose deniability in the event something adverse happens. The user could "overspend" and then claim they were hacked and the service failed to stop it. Service can't prove they didn't sign the tx, brand and reputation suffers. This concept goes beyond just this example,
only one entity should have access to a single active private key.
However there is an easy work around with no loss of functionlaity. Just make it a 2 of 4 key multi-sig and use two override keys.
Generate Kepair 1 & 2, print them out, put them in a safe. This is your "override" key(s).
Generate keypair for your wallet.
Service will generate a keypair but send you only the public key.
Generate multi-sig address which requires 2 of the 4 keys to sign and the entities produce four unique key pairs (SERVICE, WALLET, OVERRIDE1, OVERRIDE2).
Combinations used:
WALLET + SERVICE = normal operation
OVERRIDE1 + OVERRIDE2 = override the service (lost wallet and/or service goes rouge)
The service can not only provide a spending limit but they also can provide a form of 2FA. User receives a text message from service on a cellphone or other device (not same device as wallet) from the service to authorize a signing. If wallet is compromised, user can decline and attacker can't spend even a single satoshi. When overlimit the service would refuse to sign and notify user on the same device.
Normal Use:
User creates and partially signs tx.
Partially signed tx is sent to service.
Service Requests approval from user via 2FA device.
User approves.
Device adds signature and broadcasts.
Overlimit:
User creates and partially signs tx.
Partially signed tx is sent to service.
Service deletes partially signed tx as invalid.
Service notifies user of over limit rejection via 2FA device.
Compromised wallet:
User creates and partially signs tx.
Partially signed tx is sent to service.
Service Requests approval from user via 2FA device.
User declined. (Also possible here for an option for user to report wallet compromised which will auto-reject all requests).
Service deletes partially signed tx as invalid.
Override:
User removes paper wallet with two override keys.
User generates a tx spending all funds from this address.
User signs with both keys.
User broadcasts to network.
Why do we need an override key?
In case either the wallet is destroyed or the service becomes malicious (freezes funds refusing to sign any transactions) either for personal gain or possible under threat of violence by a nation state.
Why two override keys?
Technically you could just have one override key and also use wallet key but if your wallet is lost/destroyed without backup you would be unable to spend funds. Initially I said this can be accomplished by having ie be (wallet AND service) OR (override) but it is easier done by requiring any two keys and have two override keys. The two override keys could be printed on the same sheet of paper (simply key 1 & key 2).
Why not share the same key between service and override?
Deniability. There is no way to know WHO authorized the override is keys are shared. By using separate keys the blockchain becomes irrefutable proof of which entity or entities authorized the transaction.
This seem like a lot just for a single address. Any way to extend it to multiple addresses?
Very easily using HD wallets. Instead of a single key pair for each four keys (wallet, service, override1, override2) they would be HD public and private seeds. The user and service would share the public seeds, keep their private seeds secure and could deterministically generate as many P2SH addresses as needed.