Elegant Bitcoin protocol implement in Swift