bip reference implementation