rgb-cln/TODO.md

2.7 KiB

Looking for things to hack on?

I've marked things as simple if you want something easy to work on!

Cleanups

  • Wean off openssl's -lcrypto

    • (simple) use libsodium for all RNG
    • (simple) use libbase58
  • Remove our specific libsecp256k1 in secp256k1/ and use the installed one.

    • Implement sig_valid, using secp256k1_ecdsa_signature_normalize
    • Use secp256k1_ecdsa_signature_parse_compact/_serialize_compact in signature_to_proto

Minor improvements

  • Optimize bitcoind_poll_transactions not to list all transactions every time
  • Make json_get_params fail if unknown parameters are specified by user.
  • Print backtrace in log_crash
  • Support locktime in blocks in accept_pkt_open, accept_pkt_htlc_add, commit_tx_depth
  • Get bitcoind's idea of time for commit_tx_depth, not our wall clock.
  • When unpacking a packet, reject any with an unknown odd-numbered field as per BOLT #2.
  • Provide details (string) when a command fails because state() returns CMD_FAIL
  • logging: add log_struct() for common structs.
  • state_single should only kill the specific peer when it enters an error state.
  • Limit total number of peers in new_peer, or at least in peer_connected_in.
  • logging: add IO logging for peers.
  • implement on-chain HTLCs correctly (peer_watch_our_htlc_outputs etc in peer.c).
  • Add history RPC command which shows all prior commit txs.
  • Improve getpeers to show status of peers when connecting, DNS lookups etc.
  • Add pings to protocol
    • Timeout a peer if they don't respond in a given time (eg. 2 pings)
  • Add timers to drop peer if we approach timeout for HTLCs and they're still uncommitted to closing it (see BOLT #2 "Risks With HTLC Timeouts").

Testing:

  • Add more unit tests in bitcoin/test.
  • Test more scenarios with daemon/test/test.sh
  • Implement compile-time crypto-free mode
    • Implement canned conversation files for fuzz testing (eg AFL).
  • Write canned input/output test cases for various conversations, and include them in a form suitable for other implementations to test.

Major improvements:

  • Use dynamic fee calculation for initial commitment fee rate.

    • (MAJOR) Implement fee renegotiation acceptance.
    • (MAJOR) Implement fee renegotiation as fee rate changes.
  • Don't fail funding if fees insufficient, fall back as per BOLT #2.

  • (MAJOR) Do proper close, still allowing ongoing HTLCs to resolve.

  • (MAJOR) Use segregated witness for all transactions.

  • (MAJOR) Implement reconnection.

  • Save preimages in shachain.

    • (MAJOR) Implement persistence.
  • (MAJOR) Implement onion

    • (MAJOR) Implement routing
    • (MAJOR) Implement failure messages

Other

Happy hacking!
Rusty.