policy-driven signing service

Overview

SigningService (maybe we'll have a more clever name one day!)

What is this?

This repo has a little "serverless" (runs on lambda and some other services) multisig signing oracle that will sign (or not) based on policy. The idea is that you can have a 2-of-3 multisig wallet in Bluewallet (or another wallet of your choice, right now we have a parser for bluewallet multisig setup files, so anything that outputs those files -- Sparrow, some tool you write, you writing it yourself, etc. should work) where one key is on the phone, one key is kept safely offline (in case you blow away SigningService or whatever), and then one key is held by SigningService. When you want to spend, your phone makes one signature, and then you send the PSBT to SigningService, where it will evaluate the request against a configured set of policies, and if it passes, will sign the PSBT and return it. From there you load the signed PSBT into Bluewallet, hit "finalize" and are ready to broadcast the transaction! If the transaction violates any of the policies, then the SigningService refuses to sign it. At that point the money can't be spent without going and digging out the third "recovery" key.

The goal is to (eventually, after the code gets better and the integration isn't a giant kludge) have the convenience and portability of a phone wallet but have it be secure enough that you can keep access to reasonably large amount of money without losing sleep over the risk of malware or theft/loss of your phone ("reasonably large amount of money" to me means something like your checking account -- the funds you expect to spend over a few weeks or a month, and sits between what you'd normally keep as cash in your wallet, and your "savings" which should be in some offline multisig setup).

What policies exist so far?

  1. ValuePolicy - set a limit on the maximum amount (excluding change) that can be spent in one transaction

  2. AndonPolicy - an "andon cord": if you trigger this policy (by setting a boolean to true) then all signings are rejected. This is a "big red button" to halt all spends in the case of theft/loss/attack.

  3. Right now, these policies have hardcoded values. The plan is to have their configuration stored in DDB, and then have a UI (or something) to dial in the desired configuration.

How to build/deploy

(more detailed instructions coming one day. If any of these things sound confusing, then SigningBot is too early for you)

  1. install npm, cdk, the rust toolchain
  2. (if you are on an apple silicon mac) read the directions in signing_bot/README.md on how to get the cross-compilation setup
  3. have AWS creds configured
  4. run make deploy

How to use SigningService with Bluewallet

TODO: write me!

Risks/Things to be aware of

  1. This code is SUPER alpha. There are known issues (like key-create not being idempotent!!!) that need to get solved, and probably a shitload of bugs. The fact that the integration with Bluewallet is through an iOS shortcut should give you the correct amount of discomfort trusting it with real money (for your own definition of "real"). It's been tested quite a bit, but caveat emptor, buyer beware, NO WARRENTY, etc.
  2. Right now SigningService stores its keys in an S3 bucket. That's it, that's all it does to protect them is a non-public S3 bucket.
  3. TODO: write more things that are horrible about the current state of this codebase

API

From the endpoint you get out of deploying the stack:

POST `key_name=[key name]` to /keys -> create new key
GET /keys/{key} -> get xpub # not implemented yet
POST bluewallet_export to /keys/{key} -> create wallet
POST psbt to /keys/{key}/wallet -> sign psbt

Future plans

  • More (and more interesting) policies
    • max spend in X hours/days/weeks
    • auto-deny list, auto-approve list (blacklist and whitelist)
  • Encrypt private keys (either credstash-style with KMS wrapping, or possibly just SSE in s3, unclear)
  • MFA (or some other mechanism) to override denials
  • Some easy-to-get-too mechanism to trigger the Andon Cord policy (send a text to a phone number, button on a website, iot button, etc)
  • Some UI (authenticated website?) to set policy parameters (spend threshold, blocked hours, address whitelist, etc)
  • multi-step spend paths with network monitors/watchtowers to enforce policy (until we get convenents -- basically what Revault does)
  • proper (not the Shortcuts HACK) integration into Bluewallet or another wallet
You might also like...
Conference Monitoring Project based on Image Recognition that uses Rust Language and AWS Rekognition service to get the level of image similarity.

Conference Monitoring System based on Image Recognition in Rust This is a Conference Monitoring Project based on Image Recognition that uses Rust Lang

Plex webhook service to automatically update your Anilist watching list.

anifunnel Plex webhook service to automatically update your Anilist watching list. Description anifunnel is a web server that will consume incoming Pl

Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded.

Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded. It also offers image optimization and storage options. It has configurable privacy and storage settings, as well as custom cache expiration.

COCONUT Secure VM Service Module

This is the source code repository for the COCONUT Secure VM Service Module (SVSM), a software which aims to provide secure services and device emulations to guest operating systems in confidential virtual machines (CVMs). It requires AMD Secure Encrypted Virtualization with Secure Nested Paging (AMD SEV-SNP), especially the VM Privilege Level (VMPL) feature.

Infino - Fast and scalable service to store time series and logs - written in Rust

Infino 〽️ πŸͺ΅ β€” πŸ” πŸ“Š β€” βš–οΈ πŸ’° Ingest Metrics and Logs β€” Query and Insights β€” Scale and Save $$ Infino is an observability platform for storing metrics

Service-Oriented Design Patterns for Rust

SOD: Service-Oriented Design Overview This crate provides Service, MutService, and AsyncService traits and associated utilities to facilitiate service

Backend service to build customer facing dashboards 10x faster. Written in Rust.
Backend service to build customer facing dashboards 10x faster. Written in Rust.

Frolic is an open source backend service (written in Rust) to build customer facing dashboards 10x faster. You can directly connect your database to t

Authentication and authorization service, written in Rust

auth-rs auth-rs provides a simple authentication and authorization service for use in other services. The service is written in Rust and uses the acti

A monitor (service) for your monitor (display). Intercepts window behaviour when monitor configuration changes.

Mon-Mon A monitor (service) for your monitor (display). Listens for changes to display configuration (e.g. plugging in an additional screen) and allow

Owner
null
A command driven spotify player

spotify-player Table of Contents Introduction Examples Demo Installation Requirements Spotify Connect Streaming Commands Actions Search Page Mouse sup

Thang Pham 185 Dec 28, 2022
Make data-driven table rendering easy with Dioxus

Dioxus Table Make data-driven table rendering easy with Dioxus Installation Until the next release of Dioxus this requires Dioxus nightly from git. Th

null 9 Oct 9, 2022
gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

Nick Gerace 215 Jan 4, 2023
Open-source Rust framework for building event-driven live-trading & backtesting systems

Barter Barter is an open-source Rust framework for building event-driven live-trading & backtesting systems. Algorithmic trade with the peace of mind

Barter 157 Feb 18, 2023
Holo is a suite of routing protocols designed to support high-scale and automation-driven networks.

Holo is a suite of routing protocols designed to support high-scale and automation-driven networks. For a description of what a routing protocol is, p

Renato Westphal 42 Apr 16, 2023
A CLI tool to drive test-driven Rust workshops

wr A Rust workshop runner wr is a CLI to drive test-driven workshops written in Rust. It is designed to be used in conjunction with a workshop reposit

Mainmatter 7 Oct 16, 2023
Galileo OSNMA (Open Service Navigation Message Authentication)

galileo-osnma galileo-osnma is a Rust implementation of the Galileo OSNMA (Open Service Navigation Message Authentication) protocol. This protocol is

Daniel EstΓ©vez 26 Nov 25, 2022
πŸ“Έ website screenshots as a service

website-screenshot ?? website screenshots as a service Features ?? powered by Rust ?? blazing fast ?? ‍‍ built-in ratelimiter ?? built-in storage prov

Tomio 13 Oct 22, 2022
By mirroring traffic to and from your machine, mirrord surrounds your local service with a mirror image of its cloud environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and

MetalBear 2.1k Jan 3, 2023
Bracket QOS - a Quality of Service/Experience server system writtin in Rust. Derived from the excellent LibreQOS Project.

Bracket QOS - Open Source Edition This project is based on the excellent LibreQOS project. It is hoped that this can be useful for the upstream projec

Herbert 12 Dec 2, 2022