Skip to content

Instantly share code, notes, and snippets.

View craigwrong's full-sized avatar
Building @swift-bitcoin

Craig Wrong craigwrong

Building @swift-bitcoin
View GitHub Profile
@craigwrong
craigwrong / bitcoin.swift
Last active October 15, 2025 11:40
A prototypical bitcoin implementation in Swift
import Foundation
import CryptoKit
typealias TxID = Int
typealias BlockID = Int
typealias Time = Int
typealias Amount = Int
typealias PrivateKey = P256.Signing.PrivateKey
typealias PublicKey = P256.Signing.PublicKey
typealias Signature = P256.Signing.ECDSASignature